diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-06-14 18:23:07 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-06-19 20:47:38 +0200 |
commit | cfde49734086a65d79e8ed4bb1a242ab0c407a40 (patch) | |
tree | cb90367bcdab5163c5437028d045aed49dc2c3f6 /src/vhdl/simulate/simul-environments.ads | |
parent | f6379989022c1e71017f4151392a300534d2007a (diff) | |
download | ghdl-cfde49734086a65d79e8ed4bb1a242ab0c407a40.tar.gz ghdl-cfde49734086a65d79e8ed4bb1a242ab0c407a40.tar.bz2 ghdl-cfde49734086a65d79e8ed4bb1a242ab0c407a40.zip |
vhdl: decouple annotations from environments.
Diffstat (limited to 'src/vhdl/simulate/simul-environments.ads')
-rw-r--r-- | src/vhdl/simulate/simul-environments.ads | 92 |
1 files changed, 1 insertions, 91 deletions
diff --git a/src/vhdl/simulate/simul-environments.ads b/src/vhdl/simulate/simul-environments.ads index 68109eb78..30f49aae0 100644 --- a/src/vhdl/simulate/simul-environments.ads +++ b/src/vhdl/simulate/simul-environments.ads @@ -17,8 +17,8 @@ -- 02111-1307, USA. with Ada.Unchecked_Deallocation; -with Types; use Types; with Vhdl.Nodes; use Vhdl.Nodes; +with Simul.Annotations; use Simul.Annotations; with Grt.Types; use Grt.Types; with Grt.Signals; use Grt.Signals; with Grt.Files; @@ -208,99 +208,9 @@ package Simul.Environments is end case; end record; - type Object_Slot_Type is new Natural; - - -- This slot is not used. - Invalid_Object_Slot : constant Object_Slot_Type := 0; - - subtype Parameter_Slot_Type is Object_Slot_Type range 0 .. 2**15; - - type Pkg_Index_Type is new Natural; - - type Block_Instance_Id is new Natural; - No_Block_Instance_Id : constant Block_Instance_Id := 0; - type Objects_Array is array (Object_Slot_Type range <>) of Iir_Value_Literal_Acc; - -- 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; - - -- The annotation depends on the kind of the node. - type Sim_Info_Kind is - ( - Kind_Block, Kind_Process, Kind_Frame, Kind_Protected, Kind_Package, - Kind_Bit_Type, Kind_Enum_Type, Kind_Scalar_Type, Kind_File_Type, - Kind_Object, Kind_Signal, - Kind_File, - Kind_Terminal, Kind_Quantity, - Kind_PSL, - Kind_Extra - ); - - type Instance_Slot_Type is new Integer; - Invalid_Instance_Slot : constant Instance_Slot_Type := -1; - - type Sim_Info_Type (Kind : Sim_Info_Kind); - type Sim_Info_Acc is access all Sim_Info_Type; - - -- Annotation for an iir node in order to be able to simulate it. - type Sim_Info_Type (Kind: Sim_Info_Kind) is record - -- Redundant, to be used only for debugging. - Ref : Iir; - - case Kind is - when Kind_Block - | Kind_Frame - | Kind_Protected - | Kind_Process - | Kind_Package => - -- Number of objects/signals. - Nbr_Objects : Object_Slot_Type; - - case Kind is - when Kind_Block => - -- Slot number in the parent (for blocks). - Inst_Slot : Instance_Slot_Type; - - -- Number of children (blocks, generate, instantiation). - Nbr_Instances : Instance_Slot_Type; - - when Kind_Package => - Pkg_Slot : Object_Slot_Type; - Pkg_Parent : Sim_Info_Acc; - - when others => - null; - end case; - - when Kind_Object - | Kind_Signal - | Kind_File - | Kind_Terminal - | Kind_Quantity - | Kind_PSL => - -- Block in which this object is declared in. - Obj_Scope : Sim_Info_Acc; - - -- Variable index in the block. - Slot: Object_Slot_Type; - - when Kind_Scalar_Type - | Kind_Bit_Type - | Kind_Enum_Type => - Scalar_Mode : Iir_Value_Kind; - Width : Uns32; - - when Kind_File_Type => - File_Signature : String_Acc; - - when Kind_Extra => - Extra_Slot : Extra_Slot_Type; - end case; - end record; - type Block_Instance_Type (Max_Objs : Object_Slot_Type) is record -- Flag for wait statement: true if not yet executed. In_Wait_Flag : Boolean; |