aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-21 18:56:21 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-21 18:56:21 +0100
commit5fa2ef4740596fdacfc3370541548759df2ab98b (patch)
treea4ae0fed0fecc81eab7cb3404fac7aa19028e3c5
parent0077cb6ed63946940700bbfd60518b0d28bc3ce2 (diff)
downloadghdl-5fa2ef4740596fdacfc3370541548759df2ab98b.tar.gz
ghdl-5fa2ef4740596fdacfc3370541548759df2ab98b.tar.bz2
ghdl-5fa2ef4740596fdacfc3370541548759df2ab98b.zip
simul: Add ref in info to ease debugging.
-rw-r--r--src/vhdl/simulate/simul-annotations.adb23
-rw-r--r--src/vhdl/simulate/simul-environments.ads3
2 files changed, 26 insertions, 0 deletions
diff --git a/src/vhdl/simulate/simul-annotations.adb b/src/vhdl/simulate/simul-annotations.adb
index 7c19e3b35..f02f642b1 100644
--- a/src/vhdl/simulate/simul-annotations.adb
+++ b/src/vhdl/simulate/simul-annotations.adb
@@ -56,28 +56,34 @@ package body Simul.Annotations is
case Obj_Kind is
when Kind_Object =>
Info := new Sim_Info_Type'(Kind => Kind_Object,
+ Ref => Obj,
Obj_Scope => Block_Info,
Slot => Block_Info.Nbr_Objects);
when Kind_File =>
Info := new Sim_Info_Type'(Kind => Kind_File,
+ Ref => Obj,
Obj_Scope => Block_Info,
Slot => Block_Info.Nbr_Objects);
when Kind_Signal =>
Info := new Sim_Info_Type'(Kind => Kind_Signal,
+ Ref => Obj,
Obj_Scope => Block_Info,
Slot => Block_Info.Nbr_Objects);
-- Reserve one more slot for value, and initial driver value.
Block_Info.Nbr_Objects := Block_Info.Nbr_Objects + 2;
when Kind_Terminal =>
Info := new Sim_Info_Type'(Kind => Kind_Terminal,
+ Ref => Obj,
Obj_Scope => Block_Info,
Slot => Block_Info.Nbr_Objects);
when Kind_Quantity =>
Info := new Sim_Info_Type'(Kind => Kind_Quantity,
+ Ref => Obj,
Obj_Scope => Block_Info,
Slot => Block_Info.Nbr_Objects);
when Kind_PSL =>
Info := new Sim_Info_Type'(Kind => Kind_PSL,
+ Ref => Obj,
Obj_Scope => Block_Info,
Slot => Block_Info.Nbr_Objects);
when Kind_Block
@@ -228,6 +234,7 @@ package body Simul.Annotations is
-- package declaration that is shared, the instances will always get
-- Nbr_Objects as 0...
Prot_Info := new Sim_Info_Type'(Kind => Kind_Protected,
+ Ref => Prot,
Nbr_Objects => 0);
Set_Info (Prot, Prot_Info);
@@ -284,6 +291,7 @@ package body Simul.Annotations is
Mode := Iir_Value_E32;
end if;
Set_Info (Def, new Sim_Info_Type'(Kind => Kind_Scalar_Type,
+ Ref => Def,
Scalar_Mode => Mode));
Annotate_Range_Expression
(Block_Info, Get_Range_Constraint (Def));
@@ -318,16 +326,19 @@ package body Simul.Annotations is
when Iir_Kind_Integer_Type_Definition =>
Set_Info (Def,
new Sim_Info_Type'(Kind => Kind_Scalar_Type,
+ Ref => Def,
Scalar_Mode => Iir_Value_I64));
when Iir_Kind_Floating_Type_Definition =>
Set_Info (Def,
new Sim_Info_Type'(Kind => Kind_Scalar_Type,
+ Ref => Def,
Scalar_Mode => Iir_Value_F64));
when Iir_Kind_Physical_Type_Definition =>
Set_Info (Def,
new Sim_Info_Type'(Kind => Kind_Scalar_Type,
+ Ref => Def,
Scalar_Mode => Iir_Value_I64));
when Iir_Kind_Array_Type_Definition =>
@@ -391,6 +402,7 @@ package body Simul.Annotations is
end if;
Set_Info (Def,
new Sim_Info_Type'(Kind => Kind_File_Type,
+ Ref => Def,
File_Signature => Res));
end;
@@ -433,6 +445,7 @@ package body Simul.Annotations is
Block_Info.Nbr_Objects := Block_Info.Nbr_Objects + 1;
Package_Info := new Sim_Info_Type'
(Kind => Kind_Package,
+ Ref => Inter,
Nbr_Objects => 0,
Pkg_Slot => Block_Info.Nbr_Objects,
Pkg_Parent => Block_Info);
@@ -499,6 +512,7 @@ package body Simul.Annotations is
Interfaces : constant Iir := Get_Interface_Declaration_Chain (Subprg);
begin
Subprg_Info := new Sim_Info_Type'(Kind => Kind_Frame,
+ Ref => Subprg,
Nbr_Objects => 0);
Set_Info (Subprg, Subprg_Info);
@@ -531,6 +545,7 @@ package body Simul.Annotations is
Info : Sim_Info_Acc;
begin
Info := new Sim_Info_Type'(Kind => Kind_Block,
+ Ref => Comp,
Inst_Slot => Invalid_Instance_Slot,
Nbr_Objects => 0,
Nbr_Instances => 1); -- For the instance.
@@ -549,6 +564,7 @@ package body Simul.Annotations is
begin
Package_Info := new Sim_Info_Type'
(Kind => Kind_Package,
+ Ref => Decl,
Nbr_Objects => 0,
Pkg_Slot => Invalid_Object_Slot,
Pkg_Parent => null);
@@ -854,6 +870,7 @@ package body Simul.Annotations is
Guard : Iir;
begin
Info := new Sim_Info_Type'(Kind => Kind_Block,
+ Ref => Block,
Inst_Slot => Block_Info.Nbr_Instances,
Nbr_Objects => 0,
Nbr_Instances => 0);
@@ -881,6 +898,7 @@ package body Simul.Annotations is
Info : Sim_Info_Acc;
begin
Info := new Sim_Info_Type'(Kind => Kind_Block,
+ Ref => Bod,
Inst_Slot => Block_Info.Nbr_Instances,
Nbr_Objects => 0,
Nbr_Instances => 0);
@@ -940,6 +958,7 @@ package body Simul.Annotations is
begin
-- Add a slot just to put the instance.
Info := new Sim_Info_Type'(Kind => Kind_Block,
+ Ref => Stmt,
Inst_Slot => Block_Info.Nbr_Instances,
Nbr_Objects => 0,
Nbr_Instances => 1);
@@ -953,6 +972,7 @@ package body Simul.Annotations is
Info : Sim_Info_Acc;
begin
Info := new Sim_Info_Type'(Kind => Kind_Process,
+ Ref => Stmt,
Nbr_Objects => 0);
Set_Info (Stmt, Info);
@@ -1018,6 +1038,7 @@ package body Simul.Annotations is
begin
Entity_Info :=
new Sim_Info_Type'(Kind => Kind_Block,
+ Ref => Decl,
Inst_Slot => Invalid_Instance_Slot,
Nbr_Objects => 0,
Nbr_Instances => 0);
@@ -1097,6 +1118,7 @@ package body Simul.Annotations is
Block_Info.Nbr_Objects := Block_Info.Nbr_Objects + 1;
Config_Info := new Sim_Info_Type'
(Kind => Kind_Package,
+ Ref => Decl,
Nbr_Objects => 0,
Pkg_Slot => Block_Info.Nbr_Objects,
Pkg_Parent => Block_Info);
@@ -1145,6 +1167,7 @@ package body Simul.Annotations is
pragma Assert (Global_Info = null);
Global_Info :=
new Sim_Info_Type'(Kind => Kind_Block,
+ Ref => El,
Nbr_Objects => 0,
Inst_Slot => Invalid_Instance_Slot,
Nbr_Instances => 0);
diff --git a/src/vhdl/simulate/simul-environments.ads b/src/vhdl/simulate/simul-environments.ads
index bc2414be0..d5c20e104 100644
--- a/src/vhdl/simulate/simul-environments.ads
+++ b/src/vhdl/simulate/simul-environments.ads
@@ -245,6 +245,9 @@ package Simul.Environments is
-- 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