Paremeterized $table_model file name

From: Muranyi, Arpad <arpad.muranyi_at_.....>
Date: Wed Aug 03 2005 - 13:20:44 PDT
Geoffrey, 

Yes, what you say about the macro used as file name works
in the simulators I tried.  However, I wonder whether the
usage of string parameters as file names is legal or not
according to the spec.  If not, may I make a request to
add it to the spec ASAP?  It seems that since string
parameters are constants, this should still work without
any complications.

Thanks,

Arpad
=========================================================

-----Original Message-----
From: geoffrey.coram@analog.com [mailto:geoffrey.coram@analog.com] 
Sent: Tuesday, July 26, 2005 10:14 AM
To: Muranyi, Arpad
Cc: VerilogAMS Reflector
Subject: Re: define and strings

Arpad -

> By the way, can this string literal come from a macro then?

I would expect that this would work:

`define FILENAME "mytable.txt"

I(a,b) <+ $table_model(`FILENAME, V(a,b), ...);

because the preprocessor would place "mytable.txt" inside the
$table_model call before the syntax is checked.  This does not
conflict with the earlier contention that "$table_model can only
take a double quote enclosed string literal."

> And if string parameters are treated a constants which can
> only change at compile time, why couldn't it come from a
> string parameter?

I believe that parameters can change at *elaboration* time, 
which is subtly different from compile time.  But, as pointed
out before, it is an obvious extension to allow a string
parameter as the first argument to $table_model.


-Geoffrey
Received on Wed Aug 3 13:20:47 2005

This archive was generated by hypermail 2.1.8 : Wed Aug 03 2005 - 13:20:58 PDT