Re: ANSI-Parameter List Bug and Ambiguities


Subject: Re: ANSI-Parameter List Bug and Ambiguities
From: Paul Graham (pgraham@cadence.com)
Date: Tue Jan 08 2002 - 18:41:33 PST


> 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 : Tue Jan 08 2002 - 18:53:06 PST