diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-12-05 04:36:09 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-12-05 04:36:09 +0100 |
commit | 619a6e10cbcd439ba2a499ea74357774e9d4ffae (patch) | |
tree | cc38138c1c06cf7cb69ec26965aeea4835882258 /src/vhdl | |
parent | 6fa695890d8ccae675f3606d25e2bb58bbfb243e (diff) | |
download | ghdl-619a6e10cbcd439ba2a499ea74357774e9d4ffae.tar.gz ghdl-619a6e10cbcd439ba2a499ea74357774e9d4ffae.tar.bz2 ghdl-619a6e10cbcd439ba2a499ea74357774e9d4ffae.zip |
simul: handle package interface, remove iir_value_environment.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/simulate/simul-annotations.adb | 16 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-debugger.adb | 3 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-elaboration.adb | 11 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-elaboration.ads | 6 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-environments.adb | 39 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-environments.ads | 15 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-execution.adb | 6 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-simulation-main.adb | 6 | ||||
-rw-r--r-- | src/vhdl/simulate/simul-simulation.adb | 3 |
9 files changed, 25 insertions, 80 deletions
diff --git a/src/vhdl/simulate/simul-annotations.adb b/src/vhdl/simulate/simul-annotations.adb index f270b9bc7..534fca38a 100644 --- a/src/vhdl/simulate/simul-annotations.adb +++ b/src/vhdl/simulate/simul-annotations.adb @@ -80,10 +80,6 @@ package body Simul.Annotations is Info := new Sim_Info_Type'(Kind => Kind_PSL, Obj_Scope => Block_Info, Slot => Block_Info.Nbr_Objects); - when Kind_Environment => - Info := new Sim_Info_Type'(Kind => Kind_Environment, - Env_Slot => Block_Info.Nbr_Objects, - Nbr_Objects => 0); when Kind_Block | Kind_Process | Kind_Frame @@ -430,8 +426,13 @@ package body Simul.Annotations is is Package_Info : Sim_Info_Acc; begin - Create_Object_Info (Block_Info, Inter, Kind_Environment); - Package_Info := Get_Info (Inter); + Block_Info.Nbr_Objects := Block_Info.Nbr_Objects + 1; + Package_Info := new Sim_Info_Type' + (Kind => Kind_Package, + Nbr_Objects => 0, + Pkg_Slot => Block_Info.Nbr_Objects, + Pkg_Parent => Block_Info); + Set_Info (Inter, Package_Info); Annotate_Interface_List (Package_Info, Get_Generic_Chain (Inter), True); @@ -1166,7 +1167,6 @@ package body Simul.Annotations is when Kind_Object | Kind_Signal | Kind_File | Kind_Terminal | Kind_Quantity - | Kind_Environment | Kind_PSL => Put_Line ("-- slot:" & Object_Slot_Type'Image (Info.Slot)); when Kind_Scalar_Type @@ -1206,7 +1206,7 @@ package body Simul.Annotations is null; end case; when Kind_Object | Kind_Signal | Kind_File - | Kind_Terminal | Kind_Quantity | Kind_Environment + | Kind_Terminal | Kind_Quantity | Kind_PSL => Put_Line ("slot:" & Object_Slot_Type'Image (Info.Slot)); when Kind_Extra => diff --git a/src/vhdl/simulate/simul-debugger.adb b/src/vhdl/simulate/simul-debugger.adb index 74c46c017..3ae364698 100644 --- a/src/vhdl/simulate/simul-debugger.adb +++ b/src/vhdl/simulate/simul-debugger.adb @@ -386,8 +386,7 @@ package body Simul.Debugger is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Disp_Signal; diff --git a/src/vhdl/simulate/simul-elaboration.adb b/src/vhdl/simulate/simul-elaboration.adb index 9ca1e5eaf..57088afd5 100644 --- a/src/vhdl/simulate/simul-elaboration.adb +++ b/src/vhdl/simulate/simul-elaboration.adb @@ -149,8 +149,7 @@ package body Simul.Elaboration is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; return Res; @@ -1060,7 +1059,7 @@ package body Simul.Elaboration is -- expression associated with the generic constant is evaluated -- to determine the value of the constant. when Iir_Kind_Interface_Package_Declaration => - Create_Object (Instance, Get_Info (Decl).Env_Slot); + Create_Object (Instance, Get_Info (Decl).Pkg_Slot); when others => Error_Kind ("elaborate_generic_clause", Decl); end case; @@ -1154,10 +1153,8 @@ package body Simul.Elaboration is Pkg_Block : Block_Instance_Acc; begin Pkg_Block := Get_Instance_By_Scope (Local_Instance, Info); - Environment_Table.Append (Pkg_Block); - Val := Create_Environment_Value (Environment_Table.Last); - Target_Instance.Objects (Get_Info (Inter).Env_Slot) := - Unshare (Val, Instance_Pool); + Target_Instance.Objects (Get_Info (Inter).Pkg_Slot) := + Create_Instance_Value (Pkg_Block); end; goto Continue; diff --git a/src/vhdl/simulate/simul-elaboration.ads b/src/vhdl/simulate/simul-elaboration.ads index 50c7fdfb4..e4af1f21c 100644 --- a/src/vhdl/simulate/simul-elaboration.ads +++ b/src/vhdl/simulate/simul-elaboration.ads @@ -155,12 +155,6 @@ package Simul.Elaboration is Table_Low_Bound => 1, Table_Initial => 2); - package Environment_Table is new Tables - (Table_Component_Type => Block_Instance_Acc, - Table_Index_Type => Environment_Index_Type, - Table_Low_Bound => 1, - Table_Initial => 2); - type Boolean_Vector is array (Nat32 range <>) of Boolean; type Boolean_Vector_Acc is access Boolean_Vector; diff --git a/src/vhdl/simulate/simul-environments.adb b/src/vhdl/simulate/simul-environments.adb index aaf44e562..4e8622da3 100644 --- a/src/vhdl/simulate/simul-environments.adb +++ b/src/vhdl/simulate/simul-environments.adb @@ -87,8 +87,7 @@ package body Simul.Environments is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Is_Equal; @@ -195,8 +194,7 @@ package body Simul.Environments is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Compare_Value; @@ -239,8 +237,7 @@ package body Simul.Environments is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Increment; @@ -288,8 +285,7 @@ package body Simul.Environments is when Iir_Value_Range | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Store; @@ -332,8 +328,7 @@ package body Simul.Environments is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Check_Bounds; @@ -387,17 +382,6 @@ package body Simul.Environments is (Kind => Iir_Value_Quantity, Quantity => Quantity))); end Create_Quantity_Value; - function Create_Environment_Value (Env : Environment_Index_Type) - return Iir_Value_Literal_Acc - is - subtype Environment_Value is Iir_Value_Literal (Iir_Value_Environment); - function Alloc is new Alloc_On_Pool_Addr (Environment_Value); - begin - return To_Iir_Value_Literal_Acc - (Alloc (Global_Pool'Access, - (Kind => Iir_Value_Environment, Environment => Env))); - end Create_Environment_Value; - function Create_Instance_Value (Inst : Block_Instance_Acc) return Iir_Value_Literal_Acc is @@ -703,9 +687,6 @@ package body Simul.Environments is pragma Assert (Src.Sig = null); return Create_Signal_Value (Src.Sig); - when Iir_Value_Environment => - return Create_Environment_Value (Src.Environment); - when Iir_Value_Quantity | Iir_Value_Terminal | Iir_Value_Instance => @@ -808,8 +789,7 @@ package body Simul.Environments is | Iir_Value_Protected | Iir_Value_Terminal | Iir_Value_Quantity - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Get_Nbr_Of_Scalars; @@ -935,8 +915,6 @@ package body Simul.Environments is Put_Line ("terminal"); when Iir_Value_Instance => Put_Line ("instance"); - when Iir_Value_Environment => - Put_Line ("environment"); end case; end Disp_Value_Tab; @@ -955,8 +933,7 @@ package body Simul.Environments is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => return False; when Iir_Value_Range => return Is_Indirect (Value.Left) @@ -1143,8 +1120,6 @@ package body Simul.Environments is Put ("[protected]"); when Iir_Value_Instance => Put ("[instance]"); - when Iir_Value_Environment => - Put ("[environment]"); end case; end Disp_Iir_Value; end Simul.Environments; diff --git a/src/vhdl/simulate/simul-environments.ads b/src/vhdl/simulate/simul-environments.ads index be20e402a..a451ff5a7 100644 --- a/src/vhdl/simulate/simul-environments.ads +++ b/src/vhdl/simulate/simul-environments.ads @@ -113,8 +113,7 @@ package Simul.Environments is Iir_Value_Signal, Iir_Value_Terminal, Iir_Value_Quantity, - Iir_Value_Instance, - Iir_Value_Environment); + Iir_Value_Instance); -- Uniq identifier for scalar signal. First identifier is 'First + 1. type Signal_Index_Type is new Natural; @@ -123,7 +122,6 @@ package Simul.Environments is 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; -- Scalar values. Only these ones can be signals. subtype Iir_Value_Scalars is @@ -203,8 +201,6 @@ package Simul.Environments is Terminal : Terminal_Index_Type; when Iir_Value_Instance => Instance : Block_Instance_Acc; - when Iir_Value_Environment => - Environment : Environment_Index_Type; when Iir_Value_Range => Dir: Iir_Direction; Length : Iir_Index32; @@ -239,7 +235,6 @@ package Simul.Environments is Kind_Object, Kind_Signal, Kind_File, Kind_Terminal, Kind_Quantity, - Kind_Environment, Kind_PSL, Kind_Extra); @@ -255,8 +250,7 @@ package Simul.Environments is when Kind_Block | Kind_Frame | Kind_Process - | Kind_Package - | Kind_Environment => + | Kind_Package => -- Number of objects/signals. Nbr_Objects : Object_Slot_Type; @@ -268,9 +262,6 @@ package Simul.Environments is -- Number of children (blocks, generate, instantiation). Nbr_Instances : Instance_Slot_Type; - when Kind_Environment => - Env_Slot : Object_Slot_Type; - when Kind_Package => Pkg_Slot : Object_Slot_Type; Pkg_Parent : Sim_Info_Acc; @@ -381,8 +372,6 @@ package Simul.Environments is return Iir_Value_Literal_Acc; function Create_Quantity_Value (Quantity : Quantity_Index_Type) return Iir_Value_Literal_Acc; - function Create_Environment_Value (Env : Environment_Index_Type) - return Iir_Value_Literal_Acc; function Create_Instance_Value (Inst : Block_Instance_Acc) return Iir_Value_Literal_Acc; diff --git a/src/vhdl/simulate/simul-execution.adb b/src/vhdl/simulate/simul-execution.adb index 9622b98c7..c4cfa7404 100644 --- a/src/vhdl/simulate/simul-execution.adb +++ b/src/vhdl/simulate/simul-execution.adb @@ -3309,12 +3309,6 @@ package body Simul.Execution is -- Execute code of the 'shared' body Label := Origin; - - -- Get the real instance for package interface. - if Up_Info.Kind = Kind_Environment then - Up_Block := Environment_Table.Table - (Up_Block.Objects (Up_Info.Env_Slot).Environment); - end if; else Label := Imp; end if; diff --git a/src/vhdl/simulate/simul-simulation-main.adb b/src/vhdl/simulate/simul-simulation-main.adb index f55705d2c..9ae9565e9 100644 --- a/src/vhdl/simulate/simul-simulation-main.adb +++ b/src/vhdl/simulate/simul-simulation-main.adb @@ -570,8 +570,7 @@ package body Simul.Simulation.Main is | Iir_Value_Terminal | Iir_Value_Quantity | Iir_Value_File - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Create_Shadow_Signal; @@ -1041,8 +1040,7 @@ package body Simul.Simulation.Main is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Create_Signal; diff --git a/src/vhdl/simulate/simul-simulation.adb b/src/vhdl/simulate/simul-simulation.adb index 73036c4a3..5b7035c3f 100644 --- a/src/vhdl/simulate/simul-simulation.adb +++ b/src/vhdl/simulate/simul-simulation.adb @@ -458,8 +458,7 @@ package body Simul.Simulation is | Iir_Value_Protected | Iir_Value_Quantity | Iir_Value_Terminal - | Iir_Value_Instance - | Iir_Value_Environment => + | Iir_Value_Instance => raise Internal_Error; end case; end Assign_Value_To_Signal; |