data/full_repos/permissive/143278/ivltests/struct_packed_value_list.v
 line:8: before: "packed"
1: b'%Warning-STMTDLY: data/full_repos/permissive/143278/ivltests/struct_packed_value_list.v:28: Unsupported: Ignoring delay on this delayed statement.\n      #1;\n      ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/struct_packed_value_list.v:25: Operator PATMEMBER expects 8 bits on the Pattern value, but Pattern value\'s CONST \'9\'h0\' generates 9 bits.\n                                                                                        : ... In instance test\n   assign word5 = \'{high:9\'h000, low:9\'h1ff};\n                    ^~~~\n%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/struct_packed_value_list.v:25: Operator PATMEMBER expects 8 bits on the Pattern value, but Pattern value\'s CONST \'9\'h1ff\' generates 9 bits.\n                                                                                        : ... In instance test\n   assign word5 = \'{high:9\'h000, low:9\'h1ff};\n                                 ^~~\n%Error: Exiting due to 3 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module test;

   typedef struct packed {
      logic [7:0] high;
      logic [7:0] low;
   } word_t;


   word_t word0, word1, word2, word3, word4, word5;


   bit err = 0;


   assign word0 = '{2, 3};
   assign word1 = '{high:5, low:6};
   assign word2 = '{low:7, high:8};
   assign word3 = '{default:13};
   assign word4 = '{high:8'haa, default:1};
   assign word5 = '{high:9'h000, low:9'h1ff};

   initial begin
      #1;

      if (word0 !== 16'b00000010_00000011) begin $display("FAILED -- word0 = 'b%b", word0); err=1; end
      if (word1 !== 16'b00000101_00000110) begin $display("FAILED -- word1 = 'b%b", word1); err=1; end
      if (word2 !== 16'b00001000_00000111) begin $display("FAILED -- word2 = 'b%b", word2); err=1; end
      if (word3 !== 16'b00001101_00001101) begin $display("FAILED -- word3 = 'b%b", word3); err=1; end
      if (word4 !== 16'b10101010_00000001) begin $display("FAILED -- word4 = 'b%b", word4); err=1; end
      if (word5 !== 16'b00000000_11111111) begin $display("FAILED -- word5 = 'b%b", word5); err=1; end

      if (!err) $display("PASSED");
   end

endmodule
module test;


   typedef struct packed {
      logic [7:0] high;
      logic [7:0] low;
   } word_t;


   word_t word0, word1, word2, word3, word4, word5;


   bit err = 0;


   assign word0 = '{2, 3};
   assign word1 = '{high:5, low:6};
   assign word2 = '{low:7, high:8};
   assign word3 = '{default:13};
   assign word4 = '{high:8'haa, default:1};
   assign word5 = '{high:9'h000, low:9'h1ff};

   initial begin
      #1;

      if (word0 !== 16'b00000010_00000011) begin $display("FAILED -- word0 = 'b%b", word0); err=1; end
      if (word1 !== 16'b00000101_00000110) begin $display("FAILED -- word1 = 'b%b", word1); err=1; end
      if (word2 !== 16'b00001000_00000111) begin $display("FAILED -- word2 = 'b%b", word2); err=1; end
      if (word3 !== 16'b00001101_00001101) begin $display("FAILED -- word3 = 'b%b", word3); err=1; end
      if (word4 !== 16'b10101010_00000001) begin $display("FAILED -- word4 = 'b%b", word4); err=1; end
      if (word5 !== 16'b00000000_11111111) begin $display("FAILED -- word5 = 'b%b", word5); err=1; end

      if (!err) $display("PASSED");
   end

endmodule