Re: ANSI-Parameter List Bug and Ambiguities


Subject: Re: ANSI-Parameter List Bug and Ambiguities
From: Michael McNamara (mac@verisity.com)
Date: Wed Jan 09 2002 - 08:57:06 PST


I have to say I agree with Paul here.

1) his point about limiting to the interface definition only interface
   issues is spot on;

2) his proposed workaround is quite reasonable, and fits with #1

3) with the two above points, IMHO, it is not worth opening up the
   standard for this.

BTW: An alternative non syntactical change would be to allow use of
localparams before definition; as the complier need only search the
containing module to find the local param definition.

Downside of this would be that in examining just the interface
definition one would see this unexplained use of a localparam
'YWIDTH':

     module multiplier #(parameter AWIDTH=8, BWIDTH=8)
             (output [YWIDTH-1:0] y,
               input [AWIDTH-1:0] a,
               input [BWIDTH-1:0] b);
        localparam YWIDTH=AWIDTH+BWIDTH;
        assign y = a * b;
     endmodule

In any case, I agree with Paul that we should leave this as is.

Paul Graham writes:
> > Did we want to broach the issue of localparam being added to the ANSI-C
> > parameter list? Below is a model that requires the ANSI-style localparam;
> > otherwise, the model would have to be coded using the more verbose
> > old-style parameters and ports.
> >
> > module multiplier #(parameter AWIDTH=8, BWIDTH=8;
> > localparam YWIDTH=AWIDTH+BWIDTH)
> > (output [YWIDTH-1:0] y,
> > input [AWIDTH-1:0] a,
> > input [BWIDTH-1:0] b);
> > assign y = a * b;
> > endmodule
>
> Can't you just code it like:
>
> module multiplier #(parameter AWIDTH=8, BWIDTH=8)
> (output [AWIDTH+BWIDTH-1:0] y,
> input [AWIDTH-1:0] a,
> input [BWIDTH-1:0] b);
> assign y = a * b;
> endmodule
>
> I see that it's convenient to have a localparam in an interface list,
> but then what's the point of having an interface list if it's going to
> contain non-interface items?
>
> Paul



This archive was generated by hypermail 2b28 : Wed Jan 09 2002 - 09:10:02 PST