Skip to content

Commit

Permalink
Merge pull request #580 from diffblue/structs4
Browse files Browse the repository at this point in the history
SystemVerilog: test for cast from packed struct to vector
  • Loading branch information
tautschnig authored Jun 25, 2024
2 parents 668be19 + 55303bc commit 756dfeb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions regression/verilog/structs/structs4.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
structs4.sv
--bound 0
^\[main\.p0\] always main\.w == 'h173: PROVED up to bound 0$
^EXIT=0$
^SIGNAL=0$
--
21 changes: 21 additions & 0 deletions regression/verilog/structs/structs4.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module main;

// The first field is the most-significant bit.
struct packed {
bit field1, field2;
bit [6:0] field3;
} s;

initial begin
s.field1 = 1;
s.field2 = 0;
s.field3 = 'b1110011;
end

// structs can be converted without cast to bit-vectors
wire [8:0] w = s;

// Expected to pass.
p0: assert property (w == 'b1_0_1110011);

endmodule

0 comments on commit 756dfeb

Please sign in to comment.