Skip to content

Commit

Permalink
Handle force/release in all-sensitised process. Fixes #877
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Apr 9, 2024
1 parent a2d80f7 commit 742c3de
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Unreleased changes
- Fixed a crash when a process contains a `force` or `release`
assignment inside a `process (all)` statement (#877).

## Version 1.12.0 - 2024-04-07
- The `--jit` elaboration option no longer requires `--no-save`.
Expand Down
5 changes: 5 additions & 0 deletions src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2242,10 +2242,15 @@ void build_wait(tree_t expr, build_wait_fn_t fn, void *ctx)
break;

case T_VAR_ASSIGN:
case T_FORCE:
build_wait_for_target(tree_target(expr), fn, ctx);
build_wait(tree_value(expr), fn, ctx);
break;

case T_RELEASE:
build_wait_for_target(tree_target(expr), fn, ctx);
break;

case T_CASE:
case T_MATCH_CASE:
{
Expand Down
47 changes: 47 additions & 0 deletions test/regress/issue877.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
entity sub is
port ( o : out natural );
end entity;

architecture test of sub is
signal s : natural;
begin
o <= s + 1 after 1 ns;
end architecture;

-------------------------------------------------------------------------------

entity issue877 is
end entity;

architecture test of issue877 is
signal x : natural;
begin

uut: entity work.sub
port map ( x );

update: process (all) is
alias s is << signal uut.s : natural >>;
begin
if x = 10 then
s <= release;
else
s <= force x;
end if;
end process;

check: process is
begin
wait for 1 ns;
assert x = 1;
wait for 1 ns;
assert x = 2;
wait for 8 ns;
assert x = 10;
wait for 1 ns;
assert x = 1;
std.env.finish;
wait;
end process;

end architecture;
1 change: 1 addition & 0 deletions test/regress/testlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -963,3 +963,4 @@ issue873 normal
array19 normal
issue874 normal,2008
vhpi14 normal,vhpi
issue877 normal,2008

0 comments on commit 742c3de

Please sign in to comment.