[sv-bc] RE: unsized parameter values

From: Mark Hartoog <Mark.Hartoog@synopsys.com>
Date: Thu Jun 21 2012 - 15:41:05 PDT

Section 6.20.2 of the LRM says:

"A parameter with no range specification, with either a signed type specification or no type specification,
and for which the final value assigned to it is unsized shall have an implied range with an lsb
equal to 0 and an msb equal to an implementation-dependent value of at least 31."

It looks to me like any tool that makes the value 32 bits or more is compliant with the LRM.

I think the intention of this language was that integers could be more than 32 bits, so if a tool was using say 64 bit integers, the result would be 64 bits. The LRM has now been changed to say integers are 32 bits, but I don't think this language got changed.

This language makes it hard to say any result of 32 bits or longer is incorrect.

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Maidment, Matthew R
Sent: Thursday, June 21, 2012 3:10 PM
To: sv-bc@eda.org
Subject: [sv-bc] unsized parameter values

Sending this for Surya:

Hi,
I have a query on unsized parameter value propagation with more than 32 bits value. Please consider the following case, where there are two parameter declarations, one has no range or type specification overridden by unsized based number. Other one is overridden by the previous parameter.

module top;
    A #(36, 'b010001110111011101110111011101110111) iA();

    initial begin
        $display(" parameter values :: iA.p_a %b , iA.iB.p_b %b ", iA.p_a, iA.iB.p_b);
    end
endmodule

module A;
    parameter w = 2;
    parameter p_a = 'b00100;
    reg [w:0] a;

    B #(w, p_a) iB();

endmodule

module B;
    parameter w = 5;
    parameter [(w-1) : 0] p_b = 'b001;
    reg [w:0] a;

endmodule

I know, in the context insensitive places, the unsized expression width becomes same as integer (32), otherwise it should take the size of the context. With that respect, the $display value should print '010001110111011101110111011101110111' for both. But one standard simulator truncates the 'iA.p_a' value to 32 bit and then prints. Though other two shows the result as I understood. What should be the expected result.

Regards
Surya
Received on Thu Jun 21 15:41:11 2012

This archive was generated by hypermail 2.1.8 : Thu Jun 21 2012 - 15:41:16 PDT