aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-16 05:19:12 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-16 05:19:12 +0100
commit349fd0f7c940d11b4d4d6ee5b5e5d4f070896140 (patch)
tree195a0092608d2df1bfa5385bb35cfa9e2637c599 /src
parente0da896fef32b75b10a4fe722f176d6651e81a6c (diff)
downloadghdl-349fd0f7c940d11b4d4d6ee5b5e5d4f070896140.tar.gz
ghdl-349fd0f7c940d11b4d4d6ee5b5e5d4f070896140.tar.bz2
ghdl-349fd0f7c940d11b4d4d6ee5b5e5d4f070896140.zip
simulate: add extra_slot.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/annotations.adb19
-rw-r--r--src/vhdl/simulate/annotations.ads10
2 files changed, 22 insertions, 7 deletions
diff --git a/src/vhdl/simulate/annotations.adb b/src/vhdl/simulate/annotations.adb
index 484b9911d..ac5be1962 100644
--- a/src/vhdl/simulate/annotations.adb
+++ b/src/vhdl/simulate/annotations.adb
@@ -108,7 +108,8 @@ package body Annotations is
| Kind_Process
| Kind_Frame
| Kind_Scalar_Type
- | Kind_File_Type =>
+ | Kind_File_Type
+ | Kind_Extra =>
raise Internal_Error;
end case;
Set_Info (Obj, Info);
@@ -1257,10 +1258,13 @@ package body Annotations is
-- Disp annotations for an iir node.
procedure Disp_Vhdl_Info (Node: Iir) is
use Ada.Text_IO;
- Indent: Count;
- Info: Sim_Info_Acc;
+ Info : constant Sim_Info_Acc := Get_Info (Node);
+ Indent : Count;
begin
- Info := Get_Info (Node);
+ if Info = null then
+ return;
+ end if;
+
Indent := Col;
case Info.Kind is
when Kind_Block =>
@@ -1281,7 +1285,8 @@ package body Annotations is
Put_Line ("-- slot:" & Object_Slot_Type'Image (Info.Slot)
& ", scope:" & Image (Info.Obj_Scope));
when Kind_Scalar_Type
- | Kind_File_Type =>
+ | Kind_File_Type
+ | Kind_Extra =>
null;
end case;
end Disp_Vhdl_Info;
@@ -1313,7 +1318,9 @@ package body Annotations is
| Kind_Terminal | Kind_Quantity | Kind_Environment
| Kind_PSL =>
Put_Line ("slot:" & Object_Slot_Type'Image (Info.Slot)
- & ", scope:" & Image (Info.Obj_Scope));
+ & ", scope:" & Image (Info.Obj_Scope));
+ when Kind_Extra =>
+ Put_Line ("extra:" & Extra_Slot_Type'Image (Info.Extra_Slot));
when Kind_Scalar_Type =>
Put_Line ("scalar type: "
& Iir_Value_Kind'Image (Info.Scalar_Mode));
diff --git a/src/vhdl/simulate/annotations.ads b/src/vhdl/simulate/annotations.ads
index 8960258a2..9b99f977d 100644
--- a/src/vhdl/simulate/annotations.ads
+++ b/src/vhdl/simulate/annotations.ads
@@ -36,6 +36,10 @@ package Annotations is
type Pkg_Index_Type is new Natural;
Nbr_Packages : Pkg_Index_Type := 0;
+ -- For Kind_Extra: a number. Kind_Extra is not used by annotations, and
+ -- is free for another pass like preelab.
+ type Extra_Slot_Type is new Natural;
+
-- Annotations are used to collect informations for elaboration and to
-- locate iir_value_literal for signals, variables or constants.
@@ -47,7 +51,8 @@ package Annotations is
Kind_File,
Kind_Terminal, Kind_Quantity,
Kind_Environment,
- Kind_PSL);
+ Kind_PSL,
+ Kind_Extra);
type Sim_Info_Type (Kind: Sim_Info_Kind);
type Sim_Info_Acc is access all Sim_Info_Type;
@@ -127,6 +132,9 @@ package Annotations is
when Kind_File_Type =>
File_Signature : String_Acc;
+
+ when Kind_Extra =>
+ Extra_Slot : Extra_Slot_Type;
end case;
end record;