diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-05-27 09:54:48 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-05-27 09:54:48 +0200 |
commit | ea4c5aef3579b9257c2a018d002e13e7ea3b1fbc (patch) | |
tree | e4a2e35e0ca06e0d2efed05cb5c9152a3fe10e4c | |
parent | 09c757c3bcd7538582fa80a96b093c5a74e7ddaa (diff) | |
download | ghdl-ea4c5aef3579b9257c2a018d002e13e7ea3b1fbc.tar.gz ghdl-ea4c5aef3579b9257c2a018d002e13e7ea3b1fbc.tar.bz2 ghdl-ea4c5aef3579b9257c2a018d002e13e7ea3b1fbc.zip |
elab-vhdl_debug: handle records in disp_memtyp.
-rw-r--r-- | src/synth/elab-vhdl_debug.adb | 32 | ||||
-rw-r--r-- | src/synth/elab-vhdl_debug.ads | 4 |
2 files changed, 32 insertions, 4 deletions
diff --git a/src/synth/elab-vhdl_debug.adb b/src/synth/elab-vhdl_debug.adb index 2a8292225..0f28b42d6 100644 --- a/src/synth/elab-vhdl_debug.adb +++ b/src/synth/elab-vhdl_debug.adb @@ -15,7 +15,6 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <gnu.org/licenses>. -with Types; use Types; with Name_Table; use Name_Table; with Simple_IO; use Simple_IO; with Utils_IO; use Utils_IO; @@ -119,24 +118,49 @@ package body Elab.Vhdl_Debug is procedure Disp_Value_Array (Mem : Memtyp; A_Type: Node) is Stride : Size_Type; + Len : Uns32; begin if Mem.Typ.Alast then -- Last dimension Disp_Value_Vector (Mem, A_Type, Mem.Typ.Abound); else Stride := Mem.Typ.Arr_El.Sz; + Len := Mem.Typ.Abound.Len; Put ("("); - for I in 1 .. Mem.Typ.Abound.Len loop + for I in 1 .. Len loop if I /= 1 then Put (", "); end if; - Disp_Value_Array ((Mem.Typ, Mem.Mem + Stride), A_Type); + Disp_Value_Array ((Mem.Typ, + Mem.Mem + Size_Type (Len - I) * Stride), + A_Type); end loop; Put (")"); end if; end Disp_Value_Array; + procedure Disp_Value_Record (M : Memtyp; Vtype: Node) + is + El_List : Iir_Flist; + El : Node; + begin + Put ("("); + El_List := Get_Elements_Declaration_List (Vtype); + for I in M.Typ.Rec.E'Range loop + El := Get_Nth_Element (El_List, Natural (I - 1)); + if I /= 1 then + Put (", "); + end if; + Put (Image (Get_Identifier (El))); + Put (": "); + Disp_Memtyp ((M.Typ.Rec.E (I).Typ, + M.Mem + M.Typ.Rec.E (I).Offs.Mem_Off), + Get_Type (El)); + end loop; + Put (")"); + end Disp_Value_Record; + procedure Disp_Memtyp (M : Memtyp; Vtype : Node) is begin if M.Mem = null then @@ -160,7 +184,7 @@ package body Elab.Vhdl_Debug is when Type_File => Put ("*file*"); when Type_Record => - Put ("*record*"); + Disp_Value_Record (M, Vtype); when Type_Access => Put ("*access*"); when Type_Protected => diff --git a/src/synth/elab-vhdl_debug.ads b/src/synth/elab-vhdl_debug.ads index 3510af71a..bef5d9258 100644 --- a/src/synth/elab-vhdl_debug.ads +++ b/src/synth/elab-vhdl_debug.ads @@ -15,6 +15,8 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <gnu.org/licenses>. +with Types; use Types; + with Vhdl.Nodes; use Vhdl.Nodes; with Vhdl.Nodes_Walk; use Vhdl.Nodes_Walk; @@ -25,6 +27,8 @@ package Elab.Vhdl_Debug is procedure Disp_Memtyp (M : Memtyp; Vtype : Node); function Walk_Declarations (Cb : Walk_Cb) return Walk_Status; + procedure Disp_Discrete_Value (Val : Int64; Btype : Node); + procedure Disp_Declaration_Objects (Instance : Synth_Instance_Acc; Decl_Chain : Iir; Indent : Natural := 0); |