[sv-bc] packed struct with 2 and 4 val fields

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Tue Apr 26 2011 - 03:57:07 PDT

struct packed {reg[1:0][1:0] r; bit [1:0][1:0]b;} s;
module top;
     initial begin
         s.b='x;
         $display("%b", s); //should print all x or xxxx0000???
     end
endmodule

In above example s is 4 value as stated in LRM
My question is what should be written into s.b when it is assigned with 'x.
LRM says that when writing to a 2-val field then implicit 2val to 4 val
cast occurs.
But in this case I'm writing 4 value value into 2 val field.
In my opinion this LRM statement about 2val to 4val implicit cast is not
clear.

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Apr 26 03:56:46 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 26 2011 - 03:57:02 PDT