Geoffrey.Coram wrote:
>edaorg@v-ms.com wrote:
>
>
>>I agree that if you have 400 different descriptions you'll want to minimize
>>your typing, the template approach does that - assuming a bunch of them will
>>be using "ohms" it would be something like -
>>
>> parameter Ohms#("Resistance") from [0:inf);
>>
>>which is less typing than -
>>
>> parameter real "Ohms" from [0:inf) --- "Resistance";
>>
>>
>
>While several parameters might have the same units (RD, RS are ohms),
>none of them will have the same description; it would be very little
>help to the user if the "drain resistance" and "source resistance"
>were given the exact same description.
>
You would have something like:
parameter Ohms#("drain resistance") dr from [0:inf);
parameter Ohms#("source resistance") sr from [0:inf);
>There are also probably a good 40 different units used in BSIM3,
>if you consider some are straight values, some are per unit width,
>some are per unit area, and some even have fractional units because
>they're part of a pow() expression. I don't think it's reasonable
>to make the user `define 40 different expressions that will be
>(a) unique and (b) easy to understand as you read through the
>source code.
>
>
>>Then you can do -
>> `define OHMS (*units="Ohms"*)
>> `define RES (*description="Resistance"*)
>> ...
>> parameter real `OHMS `RES from [0:inf);
>>
>>
>
>No, you can't; you have to do
> `OHMS (*desc="drain resistance"*) parameter real rd from [0:inf);
>because attributes have to go first on the line.
>
>
>-Geoffrey
>
Alright -
`define OHMS (*units="Ohms"*) real
...
parameter `RES `OHMS rx from [0:inf);
You can then change the defs to something else for SV e.g.:
`ifdef __SYSTEM_VERILOG__
`define OHMS
`define RES Ohms#("Resistance")
`endif
BTW, I notice Laurent proposed the same syntax change for attributes.
Kev.
-- Kevin Cameron, CPU Technology, CA 94588, Tel.: (925) 225 4862Received on Thu May 27 09:24:27 2004
This archive was generated by hypermail 2.1.8 : Thu May 27 2004 - 09:24:30 PDT