From 4803449d989b50284ac51b6190dc4bc0c594a498 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 16 May 2022 04:34:01 +0200 Subject: elab-vhdl_debug: factorize code, make Put_Dir public --- src/synth/elab-vhdl_debug.adb | 15 +++------------ src/synth/elab-vhdl_values-debug.ads | 3 +++ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/synth') diff --git a/src/synth/elab-vhdl_debug.adb b/src/synth/elab-vhdl_debug.adb index 7efe9a175..b8c8d39d3 100644 --- a/src/synth/elab-vhdl_debug.adb +++ b/src/synth/elab-vhdl_debug.adb @@ -24,6 +24,7 @@ with Libraries; with Elab.Debugger; with Elab.Memtype; use Elab.Memtype; with Elab.Vhdl_Values; use Elab.Vhdl_Values; +with Elab.Vhdl_Values.Debug; use Elab.Vhdl_Values.Debug; with Vhdl.Utils; use Vhdl.Utils; with Vhdl.Errors; @@ -203,21 +204,11 @@ package body Elab.Vhdl_Debug is end case; end Disp_Value; - procedure Disp_Direction (Dir : Direction_Type) is - begin - case Dir is - when Dir_To => - Put ("to"); - when Dir_Downto => - Put ("downto"); - end case; - end Disp_Direction; - procedure Disp_Bound_Type (Bound : Bound_Type) is begin Put_Int32 (Bound.Left); Put (' '); - Disp_Direction (Bound.Dir); + Put_Dir (Bound.Dir); Put (' '); Put_Int32 (Bound.Right); end Disp_Bound_Type; @@ -226,7 +217,7 @@ package body Elab.Vhdl_Debug is begin Disp_Discrete_Value (Rng.Left, Vtype); Put (' '); - Disp_Direction (Rng.Dir); + Put_Dir (Rng.Dir); Put (' '); Disp_Discrete_Value (Rng.Right, Vtype); end Disp_Discrete_Range; diff --git a/src/synth/elab-vhdl_values-debug.ads b/src/synth/elab-vhdl_values-debug.ads index 000cd59c5..026625c76 100644 --- a/src/synth/elab-vhdl_values-debug.ads +++ b/src/synth/elab-vhdl_values-debug.ads @@ -23,4 +23,7 @@ package Elab.Vhdl_Values.Debug is -- Short description, no newline. procedure Debug_Type_Short (T : Type_Acc); + + -- Display 'to' or 'downto'. + procedure Put_Dir (Dir : Direction_Type); end Elab.Vhdl_Values.Debug; -- cgit v1.2.3