Re: Enhancement request (parameterized widths)

From: Adam Krolnik (adamk@cyrix.com)
Date: Mon May 10 1999 - 09:19:27 PDT


Stu,

Please see enhancement request B31 - Specification of sized constants.

Motivation:
Currently the only acceptable way to define the size of a
constant is with a constant number, or a preprocessor
substitution. Allowing parameters would at least bring numbers
to the abilities of ports and other sized data types.

Please consider allowing parameters (at the least) to define
the length of a constant. Should there be other ways to specify
the size of a value? Should there be a restriction that the
size be constant?

An Example

module tst;

`define length 4
`define width 6
parameter size = `len * `wid;

reg[`width:1] a, out;
reg[`length*`width:1] b;

  initial begin
                $display("Size is %0d.", size);
        b = size 'b0; // Using parameter to specify size.
  end

 always @(clk) begin
        {out, b} = {b, a};
  end
endmodule

Proposed text:

To section 2.5.1 "Integer constants" third paragraph, second
sentence, which reads:
"It [size constant] shall be specified as an unsigned decimal
number."

Replace it with:

"It [size constant] shall be specified as an unsigned decimal
number or a parameter."

BNF:

ize ::=
   unsigned_number
 | parameter_identifier

<p><p><p> Adam Krolnik
    Verification Engineer
    Cyrix - NSC.
    Richardson TX. 75085



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:53:27 PDT and
sponsored by Boyd Technology, Inc.