aboutsummaryrefslogtreecommitdiffstats
path: root/src/simul
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-10-13 03:37:57 +0200
committerTristan Gingold <tgingold@free.fr>2022-10-13 03:37:57 +0200
commit04f89a0a58a325a41b55e5d47b863885530dcad5 (patch)
tree3f6875a2fc0dc6832d06c3a045b3a159d83d9897 /src/simul
parent359d7be5aae9ec4e487f6877df6c5368c16f6177 (diff)
downloadghdl-04f89a0a58a325a41b55e5d47b863885530dcad5.tar.gz
ghdl-04f89a0a58a325a41b55e5d47b863885530dcad5.tar.bz2
ghdl-04f89a0a58a325a41b55e5d47b863885530dcad5.zip
simul-vhdl_simul: keep default value of collapsed signals
Diffstat (limited to 'src/simul')
-rw-r--r--src/simul/simul-vhdl_simul.adb11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/simul/simul-vhdl_simul.adb b/src/simul/simul-vhdl_simul.adb
index d71e15c67..e0dd59b6b 100644
--- a/src/simul/simul-vhdl_simul.adb
+++ b/src/simul/simul-vhdl_simul.adb
@@ -2703,7 +2703,16 @@ package body Simul.Vhdl_Simul is
(E.Sig, E.Typ, E.Val, 0, E.Nbr_Sources.all);
end if;
-- The signal value is the value of the collapsed signal.
- -- TODO: keep the default value ?
+ if Get_Mode (E.Decl) in Iir_Out_Modes then
+ -- Keep default value.
+ Copy_Memory (Signals_Table.Table (E.Collapsed_By).Val,
+ E.Val,
+ E.Typ.Sz);
+ Exec_Write_Signal
+ (Signals_Table.Table (E.Collapsed_By).Sig,
+ (E.Typ, E.Val), Write_Signal_Driving_Value);
+ end if;
+
E.Val := Signals_Table.Table (E.Collapsed_By).Val;
end if;
end;