aboutsummaryrefslogtreecommitdiffstats
path: root/src/simul
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-16 04:25:19 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-16 04:25:19 +0200
commit57a927d0e285fe2a3b2e5524df48381a527ecb60 (patch)
treec2a252af74bc2af2e1972dc13d9fe2e54fc4cd78 /src/simul
parentdaa29e96da7ee3557d71005cd31c554f5fd74f34 (diff)
downloadghdl-57a927d0e285fe2a3b2e5524df48381a527ecb60.tar.gz
ghdl-57a927d0e285fe2a3b2e5524df48381a527ecb60.tar.bz2
ghdl-57a927d0e285fe2a3b2e5524df48381a527ecb60.zip
simul: improve support of concurrent procedure call
Diffstat (limited to 'src/simul')
-rw-r--r--src/simul/simul-vhdl_simul.adb21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/simul/simul-vhdl_simul.adb b/src/simul/simul-vhdl_simul.adb
index ffcf0f130..d621ea300 100644
--- a/src/simul/simul-vhdl_simul.adb
+++ b/src/simul/simul-vhdl_simul.adb
@@ -1308,7 +1308,26 @@ package body Simul.Vhdl_Simul is
Execute_Procedure_Call_Statement (Proc, Proc.Proc, Next_Stmt);
if Next_Stmt = Null_Node then
-- Fully executed.
- raise Internal_Error;
+ -- Execute implicit wait.
+ declare
+ Sens : Sensitivity_Index_Type;
+ begin
+ Sens := Processes_Table.Table (Proc.Idx).Sensitivity;
+ while Sens /= No_Sensitivity_Index loop
+ declare
+ S : Sensitivity_Entry renames
+ Sensitivity_Table.Table (Sens);
+ Base : constant Memory_Ptr :=
+ Signals_Table.Table (S.Sig).Sig;
+ begin
+ Add_Wait_Sensitivity
+ (S.Typ, Sig_Index (Base, S.Off.Net_Off));
+ Sens := S.Prev_Proc;
+ end;
+ end loop;
+ Grt.Processes.Ghdl_Process_Wait_Suspend;
+ return;
+ end;
else
-- Execute.
Execute_Sequential_Statements_Inner (Proc, Next_Stmt, False);