Re: Generate & defparams in Vlog-2001.


Subject: Re: Generate & defparams in Vlog-2001.
From: Shalom Bresticker (Shalom.Bresticker@motorola.com)
Date: Thu Aug 09 2001 - 02:26:54 PDT


Stefen Boyd 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.

Wait a minute.

Steven Sharp (too many "Ste[fv]ens" here ...) was talking about
a defparam from inside the generate to outside the generate.
He was not referring to a defparam which is located outside the
generate and references a parameter which is inside the generate.

By the way, when I read the standard, I understood the meaning to
allow a defparam from one iteration of the generate loop to another iteration,
and not as Steven Sharp wrote.
If that was not the intention, it has to be rewritten.

> >I definitely agree that defparams are not a good.

I partly disagree.

I think defparams have a place.

First of all, if I am not mistaken, they allow a capability not easily achievable otherwise.
See the following example:

module B ();
parameter P = 0 ;
endmodule

module A () ;
B B ;
endmodule

module top ;
A A1 ;
A A2 ;
defparam A1.B.P = 1 ;
defparam A2.B.P = 2 ;

A instantiates B.
A is itself instantiated twice, as A1 and A2.
I want A1.B.P to have one value and A2.B.P to have another value.

There are other ways to do this, but this is the easiest.

They also have advantages of readability (in 1364-1995),
the possibility to centrally group all parameters together
(similar to a central `defines file),
and the ability to customize a design from outside it,
without having to change its contents (e.g., IP reuse).

--
**************************************************************************
Shalom Bresticker                           Shalom.Bresticker@motorola.com
Motorola Semiconductor Israel, Ltd.                  Tel #: +972 9 9522268
P.O.B. 2208, Herzlia 46120, ISRAEL                   Fax #: +972 9 9522890
**************************************************************************



This archive was generated by hypermail 2b28 : Thu Aug 09 2001 - 02:33:59 PDT