Subject: Overriding localparam value Issues
From: Srikanth Chandrasekaran (schandra@asc.corp.mot.com)
Date: Sun Feb 04 2001 - 18:35:56 PST
Reply To: schandra@asc.corp.mot.com
Organization: Motorola Australia Software Center
X-Mailer: ELM [version 2.5 PL2]
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi all,
This is regarding the feature "local parameter" which has
been introduced in the Verilog 2000/2001 Language (digital) which
would also affect the analog side of things. I am assuming local
parameter would become part of AMS language syntax definition too
in the coming version of the LRM.
According to my understanding, local parameters are those
that are used as constants, and cannot be overwritten.
ie. something like the #defines at module scope. So these parameters
can be defined inside a module and stay constant during simulation
as well as set up time. My concern on local parameters
is with regards to the parameter overrides while instantiating
child modules. Local parameters cannot be overridden.
module blackbox();
parameter real R = 10.0;
localparam K = 3;
parameter real L = 0.1;
...
...
endmodule
module my_blackbox();
...
blackbox #(5.0, , 0.2) bb1 ();
...
endmodule
Option1:
--------
Currently parameter overrides do not support ", ," syntax, where
you can interleave some of the parameters from being overridden
from the instance. IMHO, this syntax would be very useful to support
parameters. This will make it useful, since, the user need
not always do a named override, especially when local parameters
are used in it.
Option2:
--------
Another proposal, is to consider the overrides specified in child
instance apply only to non-local parameters.
So the above child instance specification can be written as
blackbox #(5.0,0.2) bb1();
and this would mean the value of 5.0 refers to override for parameter
R, and value of 0.2 as the override for parameter L (Overrides would
not apply to local params)
If that assumption is correct then current syntax does support
it.
Option3:
--------
There is one more suggestion to deal with this problem where it
could be made mandatory in the language spec that local parameters
can be declared only after module parameters. So, ordered overrides
on the module parameters can still be done.
However, I would prefer the ",," syntax to be supported for
parameter overrides, which could be applied to module
parameters where the syntax could mean, "Take the default value
specified for the parameter", and none of the overrides can
apply to local parameter. So combination of Options 1 & 2.
Regards,
Sri
-- Srikanth Chandrasekaran EDA Solutions and Products SBU Phone: +61-8-8203 3592 Fax: x3501 email: schandra@asc.corp.mot.com
This archive was generated by hypermail 2b28 : Sun Feb 04 2001 - 18:40:09 PST