summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/grt/grt-signals.adb28
-rw-r--r--testsuite/gna/ticket89/repro2.vhdl24
-rwxr-xr-xtestsuite/gna/ticket89/testsuite.sh4
3 files changed, 46 insertions, 10 deletions
diff --git a/src/grt/grt-signals.adb b/src/grt/grt-signals.adb
index 96e2b98..fc97729 100644
--- a/src/grt/grt-signals.adb
+++ b/src/grt/grt-signals.adb
@@ -2774,6 +2774,7 @@ package body Grt.Signals is
procedure Delayed_Implicit_Process (Sig : Ghdl_Signal_Ptr)
is
Pfx : constant Ghdl_Signal_Ptr := Sig.Ports (0);
+ Ntime : Std_Time;
Trans : Transaction_Acc;
Last : Transaction_Acc;
Prev : Transaction_Acc;
@@ -2785,12 +2786,7 @@ package body Grt.Signals is
-- R <= transport S after T;
-- end process;
- -- Create the transaction.
- Trans := new Transaction'(Kind => Trans_Value,
- Line => 0,
- Time => Current_Time + Sig.S.Time,
- Next => null,
- Val => Pfx.Value);
+ Ntime := Current_Time + Sig.S.Time;
-- Find the last transaction.
Last := Sig.S.Attr_Trans;
@@ -2801,11 +2797,23 @@ package body Grt.Signals is
end loop;
-- The transaction are scheduled after the last one.
- pragma Assert (Last.Time <= Trans.Time);
- pragma Assert (Last.Time /= Trans.Time or else Prev = Last);
+ pragma Assert (Last.Time <= Ntime);
+
+ if Last.Time = Ntime then
+ -- Change the projected value.
+ Last.Val := Pfx.Value;
+ else
+ -- Create the transaction.
+ Trans := new Transaction'(Kind => Trans_Value,
+ Line => 0,
+ Time => Ntime,
+ Next => null,
+ Val => Pfx.Value);
+
+ -- Append the transaction.
+ Prev.Next := Trans;
+ end if;
- -- Append the transaction.
- Prev.Next := Trans;
if Sig.S.Time = 0 then
Add_Active_Chain (Sig);
end if;
diff --git a/testsuite/gna/ticket89/repro2.vhdl b/testsuite/gna/ticket89/repro2.vhdl
new file mode 100644
index 0000000..173fdcc
--- /dev/null
+++ b/testsuite/gna/ticket89/repro2.vhdl
@@ -0,0 +1,24 @@
+entity repro2 is
+end repro2;
+
+architecture behav of repro2 is
+ signal s : natural;
+begin -- behav
+ process (s) is
+ variable v : natural;
+ begin
+ v := s'delayed (10 ns);
+ end process;
+
+ process
+ begin
+ s <= 3;
+ wait for 0 ns;
+ s <= 4;
+ wait for 0 ns;
+ s <= 5;
+ wait for 0 ns;
+ s <= 5;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/ticket89/testsuite.sh b/testsuite/gna/ticket89/testsuite.sh
index e383bbc..519bbe1 100755
--- a/testsuite/gna/ticket89/testsuite.sh
+++ b/testsuite/gna/ticket89/testsuite.sh
@@ -4,6 +4,10 @@
analyze repro.vhdl
elab_simulate repro
+
+analyze repro2.vhdl
+elab_simulate repro2
+
clean
GHDL_FLAGS=--work=ieee_proposed