aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-16 05:20:28 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-16 05:20:28 +0100
commit092e6a9fe0272b1dd82083e4e7dff8ba859a463e (patch)
tree1b41931ab64624691f8404c15407278380c0bd2b /src
parent41ba0f0fe89032eba308eef964bc6235fefa065f (diff)
downloadghdl-092e6a9fe0272b1dd82083e4e7dff8ba859a463e.tar.gz
ghdl-092e6a9fe0272b1dd82083e4e7dff8ba859a463e.tar.bz2
ghdl-092e6a9fe0272b1dd82083e4e7dff8ba859a463e.zip
simulate: add per signal id.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/elaboration.ads1
-rw-r--r--src/vhdl/simulate/iir_values.adb11
-rw-r--r--src/vhdl/simulate/iir_values.ads10
3 files changed, 20 insertions, 2 deletions
diff --git a/src/vhdl/simulate/elaboration.ads b/src/vhdl/simulate/elaboration.ads
index 992f81716..8a1fb6979 100644
--- a/src/vhdl/simulate/elaboration.ads
+++ b/src/vhdl/simulate/elaboration.ads
@@ -52,6 +52,7 @@ package Elaboration is
-- Flag for wait statement: true if not yet executed.
In_Wait_Flag : Boolean;
+ -- Uniq number for a block instance.
Id : Block_Instance_Id;
-- Useful informations for a dynamic block (ie, a frame).
diff --git a/src/vhdl/simulate/iir_values.adb b/src/vhdl/simulate/iir_values.adb
index 019392b02..62b70f9c2 100644
--- a/src/vhdl/simulate/iir_values.adb
+++ b/src/vhdl/simulate/iir_values.adb
@@ -340,15 +340,24 @@ package body Iir_Values is
function To_Value_Bounds_Array_Acc is new Ada.Unchecked_Conversion
(System.Address, Value_Bounds_Array_Acc);
+ Last_Sig_Id : Signal_Index_Type := 0;
+
+ function Get_Last_Signal_Index return Signal_Index_Type is
+ begin
+ return Last_Sig_Id;
+ end Get_Last_Signal_Index;
+
function Create_Signal_Value (Sig : Ghdl_Signal_Ptr)
return Iir_Value_Literal_Acc
is
subtype Signal_Value is Iir_Value_Literal (Iir_Value_Signal);
function Alloc is new Alloc_On_Pool_Addr (Signal_Value);
begin
+ Last_Sig_Id := Last_Sig_Id + 1;
return To_Iir_Value_Literal_Acc
(Alloc (Global_Pool'Access,
- (Kind => Iir_Value_Signal, Sig => Sig)));
+ (Kind => Iir_Value_Signal,
+ Sig => Sig, Sig_Id => Last_Sig_Id)));
end Create_Signal_Value;
function Create_Terminal_Value (Terminal : Terminal_Index_Type)
diff --git a/src/vhdl/simulate/iir_values.ads b/src/vhdl/simulate/iir_values.ads
index 292e8424a..a134df438 100644
--- a/src/vhdl/simulate/iir_values.ads
+++ b/src/vhdl/simulate/iir_values.ads
@@ -114,8 +114,11 @@ package Iir_Values is
Iir_Value_Quantity,
Iir_Value_Environment);
- type Protected_Index_Type is new Natural;
+ -- Uniq identifier for scalar signal. First identifier is 'First + 1.
+ type Signal_Index_Type is new Natural;
+ function Get_Last_Signal_Index return Signal_Index_Type;
+ type Protected_Index_Type is new Natural;
type Quantity_Index_Type is new Natural;
type Terminal_Index_Type is new Natural;
type Environment_Index_Type is new Natural;
@@ -134,6 +137,9 @@ package Iir_Values is
subtype Iir_Value_Numerics is
Iir_Value_Kind range Iir_Value_I64 .. Iir_Value_F64;
+ subtype Iir_Value_Physicals is
+ Iir_Value_Kind range Iir_Value_I64 .. Iir_Value_I64;
+
type Iir_Value_Literal (Kind: Iir_Value_Kind);
type Iir_Value_Literal_Acc is access Iir_Value_Literal;
@@ -180,6 +186,8 @@ package Iir_Values is
Val_Record: Value_Array_Acc; -- range 1 .. N
when Iir_Value_Signal =>
Sig : Ghdl_Signal_Ptr;
+ -- Each signal has a uniq identifier.
+ Sig_Id : Signal_Index_Type;
when Iir_Value_Protected =>
Prot : Protected_Index_Type;
when Iir_Value_Quantity =>