Subject: Re: Generate & defparams in Vlog-2001.
From: Krishna Garlapati (krishna@synplicity.com)
Date: Wed Aug 08 2001 - 16:00:44 PDT
Shalom Bresticker wrote:
> In this case, since you want to override the value of the parameter in
> only one of the instances,
> you would put the defparam outside of the generate.
I guess this would be flagged as a syntax error, since
it would be an illegal name in verilog.
Consider:
defparam somename[0].myflop.xyz = 1;
declared outside the generate block. The reader reads
'somename', comes across the subscript, '[0]' and flags an
error since it was expecting a simple_identifier( name ) for
the defparam. My question was how would the reader know
that "somename[0].myflop" is the name for an instance in
the current module. ??
Steven Sharp wrote:
> There is no confusion. It *is* a hierarchical name of depth 3. The
> named block "somename" is a level of hierarchy. It acts similarly to a
> named block in procedural code, which also adds a level of hierarchy and
> an extra dot to the names of any objects declared inside it.
I definitely agree that defparams are not a good. But they are
favorites for some designers; and I get to see them often.
I was just trying to cook up crazy stuff, and looking for screw ups.
The name "somename[1]" is a bad identifier itself.
Correct me if I am wrong. My understanding ( wrt synthesis ) of
generate statements was that, it created a virtual hierarchy. After
elaboration of generates all the contents of generate have all but
"moved" into the containing module. Hence, in a usage like :
somename[0].abc.xyz, the "somename[0].abc" is really a generated
name and the "." in between "somename[0]" and "abc" has nothing to
do with hierachy, and my reasoning of depth 2.
Also if the parser comes across something like :
module zzz(........);
.
.
.
defparam ABC[0].xyz.param = 1;
.
.
.
for(i=0; i < 8; i=i+1)
generate : ABC
flop xyz(.......);
endgenerate
.
endmoudle
How does it know it's dealing with a legal name "ABC[0].xyz" ??
If this is a legal name, the verilog identifier declaration should
allow subscripts to be legal too.
I might be asking too much but I would be personally delighted
if the usage of defparams with generated instances is made illegal.
Again, I am just trying crazy stuff while reading the LRM, hoping
these issues for not for real.
Thanks for any input,
-- - Krishna. Synplicity Inc. (408)215-6152
This archive was generated by hypermail 2b28 : Wed Aug 08 2001 - 16:09:55 PDT