From: Daryl Stewart (Daryl.Stewart@cl.cam.ac.uk)
Date: Thu Jan 10 2002 - 05:52:20 PST
Precedence: bulk
> Precedence: bulk
>
> Mac & Paul make good points; I had not thought of running the addition in
> the port declarations themselves (duh!)
>
> Let me pursue this a little further because I think there still may be
> value in adding the localparam to the parameter-interface list.
>
> The example I gave was a very simple one. If one or more calculated values
> happen to be used in a large number of declarations, it will become quite
> tedious, verbose and perhaps confusing to place the calculation(s) into all
> of the required declarations.
>
> Second, with the advent of constant functions, added to Verilog-2001 to
> calculate more complex local parameter values from existing parameter
> values, I could foresee the possible need to define a parameter based on a
> constant function before making ANSI-port declarations. I don't see a clean
> way to do this without defining the localparam in the parameter-interface.
>
I know there's a separate thread, but I'd just like to go back to the origin
of the discussion.
The two things you want above can already be done with 'define
'define YWIDTH AWIDTH+BWIDTH
module multiplier #(parameter AWIDTH=8, BWIDTH=8)
(output [YWIDTH-1:0] y,
input [AWIDTH-1:0] a,
input [BWIDTH-1:0] b);
assign y = a * b;
endmodule
'undef YWIDTH
I agree with mac & paul - IMHO it is not worth opening up the standard for
this.
cheers
Daryl
www.tenisontech.com
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:55:34 PDT
and
sponsored by Boyd Technology, Inc.