From e71908840804bbc8e31d700d659dd25675a9f374 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 9 Apr 2024 21:41:00 +0100 Subject: [PATCH] Handle force/release in all-sensitised process. Fixes #877 --- src/common.c | 5 +++++ test/regress/issue877.vhd | 47 +++++++++++++++++++++++++++++++++++++++ test/regress/testlist.txt | 1 + 3 files changed, 53 insertions(+) create mode 100644 test/regress/issue877.vhd diff --git a/src/common.c b/src/common.c index b073f970..41fe9697 100644 --- a/src/common.c +++ b/src/common.c @@ -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: { diff --git a/test/regress/issue877.vhd b/test/regress/issue877.vhd new file mode 100644 index 00000000..6165e698 --- /dev/null +++ b/test/regress/issue877.vhd @@ -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; diff --git a/test/regress/testlist.txt b/test/regress/testlist.txt index 1e4a95b5..314a46f3 100644 --- a/test/regress/testlist.txt +++ b/test/regress/testlist.txt @@ -963,3 +963,4 @@ issue873 normal array19 normal issue874 normal,2008 vhpi14 normal,vhpi +issue877 normal,2008 -- 2.39.2