most of the discrete time (event driven or "verilog") file operators allow this already.. we should allow string parameters, AND string localparam's to be used in these contexts.. (ie not just the $table_model, but in other places where names or strings might be used.. (format strings for $strobe/$display/) And while we are at it, why not allow the (some) of the same format characters as are used in $fopen.. for the file path, or module name? so the file name could be "%M_tunecurve.dat" where %M is the instance name.. or %C_tunecurve.dat where %C is the module name.. (did I get that right?) I'll hope so cause I don't want to open any more docs tonight. Jonathan David Mixed-Signal IC jbdavid@cadence.com Ph (408)894-2646 -----Original Message----- From: owner-verilog-ams@eda.org [mailto:owner-verilog-ams@eda.org] On Behalf Of Muranyi, Arpad Sent: Wednesday, August 03, 2005 1:21 PM To: VerilogAMS Reflector Subject: Paremeterized $table_model file name 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. -GeoffreyReceived on Wed Aug 3 23:08:00 2005
This archive was generated by hypermail 2.1.8 : Wed Aug 03 2005 - 23:08:07 PDT