diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-09-25 07:38:09 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-09-25 07:38:09 +0200 |
commit | 68d26922e31aad3cb34dd3b7689bcec75ad70fcb (patch) | |
tree | ed7d40115bd74b0c4216a94bfc21d5af0837ce4f /simulate | |
parent | 5edf93b87e8f3528d9063df08bf70bf538d72545 (diff) | |
download | ghdl-68d26922e31aad3cb34dd3b7689bcec75ad70fcb.tar.gz ghdl-68d26922e31aad3cb34dd3b7689bcec75ad70fcb.tar.bz2 ghdl-68d26922e31aad3cb34dd3b7689bcec75ad70fcb.zip |
Add a python script to automatically generate disp_tree.
Diffstat (limited to 'simulate')
-rw-r--r-- | simulate/annotations.adb | 2 | ||||
-rw-r--r-- | simulate/elaboration.adb | 18 | ||||
-rw-r--r-- | simulate/execution.adb | 21 | ||||
-rw-r--r-- | simulate/grt_interface.ads | 7 | ||||
-rw-r--r-- | simulate/simulation.adb | 2 |
5 files changed, 25 insertions, 25 deletions
diff --git a/simulate/annotations.adb b/simulate/annotations.adb index 4377ffd1f..d07a99818 100644 --- a/simulate/annotations.adb +++ b/simulate/annotations.adb @@ -761,7 +761,7 @@ package body Annotations is Assoc := Get_Case_Statement_Alternative_Chain (El); loop Annotate_Sequential_Statement_Chain - (Block_Info, Get_Associated (Assoc)); + (Block_Info, Get_Associated_Chain (Assoc)); Assoc := Get_Chain (Assoc); exit when Assoc = Null_Iir; Save_Nbr_Objects; diff --git a/simulate/elaboration.adb b/simulate/elaboration.adb index 391798fa2..0abe8113d 100644 --- a/simulate/elaboration.adb +++ b/simulate/elaboration.adb @@ -633,10 +633,9 @@ package body Elaboration is return Iir_Value_Literal_Acc is Value : Iir_Value_Literal_Acc; - Ref : Iir; + Ref : constant Iir := Get_Type (Bound); Res : Iir_Value_Literal_Acc; begin - Ref := Get_Type (Bound); Res := Create_Value_For_Type (Instance, Ref, False); Res := Unshare (Res, Instance_Pool); Value := Execute_Expression (Instance, Bound); @@ -647,10 +646,9 @@ package body Elaboration is procedure Elaborate_Range_Expression (Instance : Block_Instance_Acc; Rc: Iir_Range_Expression) is - Range_Info : Sim_Info_Acc; + Range_Info : constant Sim_Info_Acc := Get_Info (Rc); Val : Iir_Value_Literal_Acc; begin - Range_Info := Get_Info (Rc); if Range_Info.Scope_Level /= Instance.Scope_Level or else Instance.Objects (Range_Info.Slot) /= null then @@ -1850,6 +1848,9 @@ package body Elaboration is Item := Conf_Chain; while Item /= Null_Iir loop Spec := Get_Block_Specification (Item); + if Get_Kind (Spec) = Iir_Kind_Simple_Name then + Spec := Get_Named_Entity (Spec); + end if; Prev_Item := Get_Prev_Block_Configuration (Item); case Get_Kind (Spec) is @@ -1923,12 +1924,15 @@ package body Elaboration is Info : Sim_Info_Acc; begin Spec := Get_Block_Specification (Item); + if Get_Kind (Spec) = Iir_Kind_Simple_Name then + Spec := Get_Named_Entity (Spec); + end if; case Get_Kind (Spec) is when Iir_Kind_Slice_Name | Iir_Kind_Indexed_Name | Iir_Kind_Selected_Name => -- Block configuration for a generate statement. - Gen := Get_Prefix (Spec); + Gen := Get_Named_Entity (Get_Prefix (Spec)); Info := Get_Info (Gen); Set_Prev_Block_Configuration (Item, Sub_Conf (Info.Inst_Slot)); @@ -2180,7 +2184,9 @@ package body Elaboration is case Get_Kind (Decl) is when Iir_Kind_Function_Declaration | Iir_Kind_Procedure_Declaration => - Elaborate_Subprogram_Declaration (Instance, Decl); + if not Is_Second_Subprogram_Specification (Decl) then + Elaborate_Subprogram_Declaration (Instance, Decl); + end if; when Iir_Kind_Implicit_Function_Declaration | Iir_Kind_Implicit_Procedure_Declaration => null; diff --git a/simulate/execution.adb b/simulate/execution.adb index 304f3bb12..ef4cccc46 100644 --- a/simulate/execution.adb +++ b/simulate/execution.adb @@ -1801,7 +1801,7 @@ package body Execution is Assoc := Get_Association_Choices_Chain (Aggregate); Pos := 0; while Assoc /= Null_Iir loop - Value := Get_Associated (Assoc); + Value := Get_Associated_Expr (Assoc); loop case Get_Kind (Assoc) is when Iir_Kind_Choice_By_None => @@ -1811,9 +1811,9 @@ package body Execution is Set_Elem (Pos); Pos := Pos + 1; when Iir_Kind_Choice_By_Expression => - Set_Elem_By_Expr (Get_Expression (Assoc)); + Set_Elem_By_Expr (Get_Choice_Expression (Assoc)); when Iir_Kind_Choice_By_Range => - Set_Elem_By_Range (Get_Expression (Assoc)); + Set_Elem_By_Range (Get_Choice_Range (Assoc)); when Iir_Kind_Choice_By_Others => for J in 1 .. Length loop if Res.Val_Array.V (Orig + J * Step) = null then @@ -1884,7 +1884,7 @@ package body Execution is Assoc := Get_Association_Choices_Chain (Aggregate); Pos := 1; loop - N_Expr := Get_Associated (Assoc); + N_Expr := Get_Associated_Expr (Assoc); if N_Expr /= Null_Iir then Expr := N_Expr; end if; @@ -1893,7 +1893,7 @@ package body Execution is Set_Expr (Pos); Pos := Pos + 1; when Iir_Kind_Choice_By_Name => - Set_Expr (1 + Get_Element_Position (Get_Name (Assoc))); + Set_Expr (1 + Get_Element_Position (Get_Choice_Name (Assoc))); when Iir_Kind_Choice_By_Others => for I in Res.Val_Record.V'Range loop if Res.Val_Record.V (I) = null then @@ -1993,7 +1993,7 @@ package body Execution is Bound := Res.Bounds.D (Dim); Pos := 0; while Assoc /= Null_Iir loop - Value := Get_Associated (Assoc); + Value := Get_Associated_Expr (Assoc); case Get_Kind (Assoc) is when Iir_Kind_Choice_By_None => null; @@ -2033,7 +2033,7 @@ package body Execution is Assoc := Get_Association_Choices_Chain (Aggregate); Pos := 0; loop - Expr := Get_Associated (Assoc); + Expr := Get_Associated_Expr (Assoc); if Expr = Null_Iir then -- List of choices is not allowed. raise Internal_Error; @@ -4216,7 +4216,8 @@ package body Execution is declare Expr1: Iir_Value_Literal_Acc; begin - Expr1 := Execute_Expression (Instance, Get_Expression (Choice)); + Expr1 := Execute_Expression + (Instance, Get_Choice_Expression (Choice)); Res := Is_Equal (Expr, Expr1); return Res; end; @@ -4225,7 +4226,7 @@ package body Execution is A_Range : Iir_Value_Literal_Acc; begin A_Range := Execute_Bounds - (Instance, Get_Expression (Choice)); + (Instance, Get_Choice_Range (Choice)); Res := Is_In_Range (Expr, A_Range); end; return Res; @@ -4514,7 +4515,7 @@ package body Execution is while Assoc /= Null_Iir loop if not Get_Same_Alternative_Flag (Assoc) then - Stmt_Chain := Get_Associated (Assoc); + Stmt_Chain := Get_Associated_Chain (Assoc); end if; if Is_In_Choice (Instance, Assoc, Value) then diff --git a/simulate/grt_interface.ads b/simulate/grt_interface.ads index 109802447..05f7abb69 100644 --- a/simulate/grt_interface.ads +++ b/simulate/grt_interface.ads @@ -16,17 +16,10 @@ -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. -with System; -with Ada.Unchecked_Conversion; with Grt.Types; use Grt.Types; with Iir_Values; use Iir_Values; package Grt_Interface is - function To_Std_String_Basep is new Ada.Unchecked_Conversion - (System.Address, Std_String_Basep); - function To_Std_String_Boundp is new Ada.Unchecked_Conversion - (System.Address, Std_String_Boundp); - procedure Set_Std_String_From_Iir_Value (Str : Std_String; Val : Iir_Value_Literal_Acc); diff --git a/simulate/simulation.adb b/simulate/simulation.adb index d951324fc..3f3f8715b 100644 --- a/simulate/simulation.adb +++ b/simulate/simulation.adb @@ -1246,7 +1246,7 @@ package body Simulation is is pragma Unreferenced (Formal_Instance); Formal : constant Iir := Get_Formal (Assoc); - Inter : constant Iir := Get_Base_Name (Formal); + Inter : constant Iir := Get_Association_Interface (Assoc); begin if False and Trace_Elaboration then Put ("connect formal "); |