This seems to be the same question that was discussed in the thread, "Sign of a signed packed array of struct," starting in http://www.eda.org/sv-bc/hm/10532.html. I don't think that thread was ever conclusively resolved.
Regards,
Shalom
> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
> Dhiraj Kumar Prasad
> Sent: Tuesday, March 22, 2011 3:59 PM
> To: sv-bc@server.eda.org
> Cc: Dhiraj Kumar Prasad
> Subject: [sv-bc] Query related with signedness of variable.
>
> 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
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Mar 22 07:36:05 2011
This archive was generated by hypermail 2.1.8 : Tue Mar 22 2011 - 07:36:16 PDT