summaryrefslogtreecommitdiff
path: root/translate/grt/grt-processes.ads
diff options
context:
space:
mode:
authorTristan Gingold2014-02-10 01:41:55 +0100
committerTristan Gingold2014-02-10 01:41:55 +0100
commit8705af241d888b16f7ba8eb664aa1a671628c7f9 (patch)
treecb268c2b66a4729e31084e7d91f0df6c00eaedf5 /translate/grt/grt-processes.ads
parentf515f0956ee75d82f7bede20bc7da95cdeae85a9 (diff)
downloadghdl-8705af241d888b16f7ba8eb664aa1a671628c7f9.tar.gz
ghdl-8705af241d888b16f7ba8eb664aa1a671628c7f9.tar.bz2
ghdl-8705af241d888b16f7ba8eb664aa1a671628c7f9.zip
Add one_stack setup, add comments.
Diffstat (limited to 'translate/grt/grt-processes.ads')
-rw-r--r--translate/grt/grt-processes.ads26
1 files changed, 22 insertions, 4 deletions
diff --git a/translate/grt/grt-processes.ads b/translate/grt/grt-processes.ads
index 5566233..22326eb 100644
--- a/translate/grt/grt-processes.ads
+++ b/translate/grt/grt-processes.ads
@@ -49,6 +49,10 @@ package Grt.Processes is
-- If true, the simulation should be stopped.
Break_Simulation : Boolean;
+ -- If true, there is one stack for all processes. Non-sensitized
+ -- processes must save their state.
+ One_Stack : Boolean := False;
+
type Process_Type is private;
-- type Process_Acc is access all Process_Type;
@@ -104,20 +108,34 @@ package Grt.Processes is
-- Resume a process.
procedure Resume_Process (Proc : Process_Acc);
- -- Wait without timeout or sensitivity.
+ -- Wait without timeout or sensitivity: wait;
procedure Ghdl_Process_Wait_Exit;
- -- Wait for a timeout.
+ -- Wait for a timeout (without sensitivity): wait for X;
procedure Ghdl_Process_Wait_Timeout (Time : Std_Time);
- -- Add a sensitivity for a wait.
- procedure Ghdl_Process_Wait_Add_Sensitivity (Sig : Ghdl_Signal_Ptr);
+
+ -- Full wait statement:
+ -- 1. Call Ghdl_Process_Wait_Set_Timeout (if there is a timeout)
+ -- 2. Call Ghdl_Process_Wait_Add_Sensitivity (for each signal)
+ -- 3. Call Ghdl_Process_Wait_Suspend, go to 4 if it returns true (timeout)
+ -- Evaluate the condition and go to 4 if true
+ -- Else, restart 3
+ -- 4. Call Ghdl_Process_Wait_Close
+
-- Add a timeout for a wait.
procedure Ghdl_Process_Wait_Set_Timeout (Time : Std_Time);
+ -- Add a sensitivity for a wait.
+ procedure Ghdl_Process_Wait_Add_Sensitivity (Sig : Ghdl_Signal_Ptr);
-- Wait until timeout or sensitivity.
-- Return TRUE in case of timeout.
function Ghdl_Process_Wait_Suspend return Boolean;
-- Finish a wait statement.
procedure Ghdl_Process_Wait_Close;
+ -- For one stack setups, wait_suspend is decomposed into the suspension
+ -- procedure and the function to get resume status.
+ procedure Ghdl_Process_Wait_Wait;
+ function Ghdl_Process_Wait_Has_Timeout return Boolean;
+
-- Verilog.
procedure Ghdl_Process_Delay (Del : Ghdl_U32);