[sv-bc] Query related with signedness of variable.

From: Dhiraj Kumar Prasad <dhiraj@cal.interrasystems.com>
Date: Tue Mar 22 2011 - 06:59:25 PDT

Hello,

I have a query related with signedness of a variable.

In following example

module test();

typedef struct packed signed {
            bit [1:0] bit1;
}[1:0]S1;
S1 var1;
int i;
initial
begin
    var1[0] = 2'b10;
    i = var1[0];
end
endmodule

Value of i should be 32'b11111111111111111111111111111110 or
32'b00000000000000000000000000000010.

Different standard simulator are behaving differently.

Should the equivalent of struct be like

typedef bit signed [1:0] b1;
typedef b1[1:0] b2;

or
typedef bit signed [1:0][1:0] b2;

Regards,
dhiRAj

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 22 07:18:19 2011

This archive was generated by hypermail 2.1.8 : Tue Mar 22 2011 - 07:18:31 PDT