diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-23 07:18:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-23 07:18:00 +0100 |
commit | f62d39352714682081c1d91b5b0cbb746e1ce1ab (patch) | |
tree | a74474a5363e4bd88a8a572163db50e97824c8b4 /src/synth | |
parent | 495ac69c30e4fa0704cb3f6b7dc8f1cb9f654c67 (diff) | |
download | ghdl-f62d39352714682081c1d91b5b0cbb746e1ce1ab.tar.gz ghdl-f62d39352714682081c1d91b5b0cbb746e1ce1ab.tar.bz2 ghdl-f62d39352714682081c1d91b5b0cbb746e1ce1ab.zip |
synth-context: add source_scope (for debugger).
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-context.adb | 7 | ||||
-rw-r--r-- | src/synth/synth-context.ads | 10 | ||||
-rw-r--r-- | src/synth/synth-flags.ads | 4 |
3 files changed, 19 insertions, 2 deletions
diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb index 7786de669..e02059f9e 100644 --- a/src/synth/synth-context.adb +++ b/src/synth/synth-context.adb @@ -64,6 +64,7 @@ package body Synth.Context is Name => No_Sname, Block_Scope => Global_Info, Up_Block => null, + Source_Scope => Null_Node, Elab_Objects => 0, Objects => (others => null)); return Res; @@ -91,6 +92,7 @@ package body Synth.Context is Name => Name, Block_Scope => Scope, Up_Block => Parent, + Source_Scope => Blk, Elab_Objects => 0, Objects => (others => null)); return Res; @@ -130,6 +132,11 @@ package body Synth.Context is return Inst.Base.Cur_Module; end Get_Instance_Module; + function Get_Source_Scope (Inst : Synth_Instance_Acc) return Node is + begin + return Inst.Source_Scope; + end Get_Source_Scope; + function Get_Top_Module (Inst : Synth_Instance_Acc) return Module is begin return Inst.Base.Top_Module; diff --git a/src/synth/synth-context.ads b/src/synth/synth-context.ads index 630639083..f569a092e 100644 --- a/src/synth/synth-context.ads +++ b/src/synth/synth-context.ads @@ -72,6 +72,9 @@ package Synth.Context is function Get_Instance_Const (Inst : Synth_Instance_Acc) return Boolean; procedure Set_Instance_Const (Inst : Synth_Instance_Acc; Val : Boolean); + -- Get the corresponding source for the scope of the instance. + function Get_Source_Scope (Inst : Synth_Instance_Acc) return Node; + procedure Create_Object (Syn_Inst : Synth_Instance_Acc; Decl : Node; Val : Value_Acc); @@ -131,12 +134,15 @@ private -- Name prefix for declarations. Name : Sname; - -- The corresponding info for this instance. + -- The corresponding info for this instance. This is used for lookup. Block_Scope : Sim_Info_Acc; - -- Parent instance. + -- Instance of the parent scope. Up_Block : Synth_Instance_Acc; + -- Source construct corresponding to this instance/ + Source_Scope : Node; + Elab_Objects : Object_Slot_Type; -- Instance for synthesis. diff --git a/src/synth/synth-flags.ads b/src/synth/synth-flags.ads index c3ef0fda3..ac5f9d072 100644 --- a/src/synth/synth-flags.ads +++ b/src/synth/synth-flags.ads @@ -29,5 +29,9 @@ package Synth.Flags is Flag_Trace_Statements : Boolean := False; + -- True to start debugger at elaboration. Flag_Debug_Init : Boolean := False; + + -- True to start debugger on error. + Flag_Debug_Enable : Boolean := True; end Synth.Flags; |