-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inferring constraints from initial values for signals and variables
- Loading branch information
Showing
7 changed files
with
130 additions
and
15 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- LCS 2016-019 | ||
entity signal32 is | ||
end entity; | ||
|
||
architecture test of signal32 is | ||
type rec_t is record | ||
x : integer_vector; | ||
end record; | ||
|
||
function get_rec return rec_t is | ||
begin | ||
return (x => (5, 6)); | ||
end function; | ||
|
||
signal s1 : integer_vector := (1, 2, 3); | ||
signal s2 : rec_t := get_rec; | ||
begin | ||
|
||
p1: process is | ||
variable v1 : integer_vector := (1, 2, 3); | ||
variable v2 : rec_t := get_rec; | ||
begin | ||
assert s1'length = 3; | ||
assert s1'left = 0; | ||
assert s1(1) = 2; | ||
s1(2) <= 5; | ||
wait for 1 ns; | ||
assert s1 = (1, 2, 5); | ||
assert v1'length = 3; | ||
assert v1(2) = 3; | ||
assert s2.x'length = 2; | ||
assert s2.x = (5, 6); | ||
assert v2.x'length = 2; | ||
assert v2.x = (5, 6); | ||
v2.x(1) := 9; | ||
assert v2.x = (5, 9); | ||
wait; | ||
end process; | ||
|
||
end architecture; |
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 |
---|---|---|
|
@@ -812,3 +812,4 @@ issue724 normal,2019 | |
issue653 normal,2008 | ||
protected10 normal,2019 | ||
reflect1 normal,2019 | ||
signal32 normal,2019 |
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,16 @@ | ||
entity lcs2016_19 is | ||
end entity; | ||
|
||
architecture test of lcs2016_19 is | ||
signal s1 : integer_vector := (1, 2, 3); -- OK | ||
signal s2 : integer_vector; -- Error | ||
begin | ||
|
||
p1: process is | ||
variable v1 : integer_vector := (1, 2, 3); -- OK | ||
variable v2 : integer_vector; -- Error | ||
begin | ||
wait; | ||
end process; | ||
|
||
end architecture; |
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