-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verilog: assignment pattern expressions
This adds support for struct and array literals to the SystemVerilog frontend by implementing the assignment_pattern_expression production rules.
- Loading branch information
Showing
9 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CORE | ||
array_literal1.sv | ||
--bound 0 | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module main; | ||
|
||
reg [7:0] my_array[10] = '{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; | ||
|
||
initial p0: assert property (my_array[0] == 1); | ||
initial p1: assert property (my_array[9] == 10); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
array_literal2.sv | ||
|
||
^file array_literal2\.sv line 3: number of expressions does not match number of array elements$ | ||
^CONVERSION ERROR$ | ||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module main; | ||
|
||
reg [7:0] my_array[10] = '{1, 2, 3, 4}; // too short | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CORE | ||
structs5.sv | ||
--bound 0 | ||
^\[main\.p1\] always main\.s\.field1 == 1: PROVED up to bound 0$ | ||
^\[main\.p2\] always main\.s\.field2 == 0: PROVED up to bound 0$ | ||
^\[main\.p3\] always main\.s\.field3 == 115: PROVED up to bound 0$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module main; | ||
|
||
struct packed { | ||
bit field1, field2; | ||
bit [6:0] field3; | ||
} s = '{ 1, 0, 'b1110011 }; | ||
|
||
// Expected to pass. | ||
p1: assert property (s.field1 == 1); | ||
p2: assert property (s.field2 == 0); | ||
p3: assert property (s.field3 == 'b1110011); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters