Subject: Re: Generate & defparams in Vlog-2001.
From: Stefen Boyd (stefen@boyd.com)
Date: Wed Aug 08 2001 - 16:56:36 PDT
At 04:00 PM 8/8/2001 -0700, Krishna Garlapati wrote:
>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;
This is illegal because you can't defparam into the
generated scope... as Steven Sharp mentioned.
>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 :
No... named blocks don't go away. Take a look at Example 3
on page 180 of Draft 6.
>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.
Again, the hierarchy doesn't go away.
>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.
First, it's generate for, not for () generate... but
once you've fixed the syntax, you'll be generating
instances inside ABC[], such as ABC[0].xyz, ABC[1].xyz, etc.
Forget the defparam because it's not legal, but you
could force a net inside of flop with
"initial force ABC[1].xyz.forced_net"
>I might be asking too much but I would be personally delighted
>if the usage of defparams with generated instances is made illegal.
It's on the list to be depricated... we can't
get rid of them, but we'll try to discourage their
use.
Hope that helps,
Stefen
--------------------
Stefen Boyd Boyd Technology, Inc.
stefen@BoydTechInc.com (408)739-BOYD
www.BoydTechInc.com (408)739-1402 (fax)
This archive was generated by hypermail 2b28 : Wed Aug 08 2001 - 17:09:28 PDT