aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-01 18:21:17 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-01 18:21:17 +0200
commit5ee88f60d0052fc028cfc55e9182349343260e2f (patch)
treee1c369b82a5eca948f74333e4c47436cbb711f90 /src
parentc4f9821ee4d690443ade4e7a9685f98fce8aa86a (diff)
downloadghdl-5ee88f60d0052fc028cfc55e9182349343260e2f.tar.gz
ghdl-5ee88f60d0052fc028cfc55e9182349343260e2f.tar.bz2
ghdl-5ee88f60d0052fc028cfc55e9182349343260e2f.zip
netlists-dump: write const in hexa.
Diffstat (limited to 'src')
-rw-r--r--src/synth/netlists-dump.adb16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/synth/netlists-dump.adb b/src/synth/netlists-dump.adb
index d1e39b538..6ec87ced8 100644
--- a/src/synth/netlists-dump.adb
+++ b/src/synth/netlists-dump.adb
@@ -349,6 +349,9 @@ package body Netlists.Dump is
pragma Unreferenced (Debug_Net);
+ Xdigits : constant array (Uns32 range 0 ..15) of Character :=
+ "0123456789abcdef";
+
procedure Disp_Instance (Inst : Instance; With_Name : Boolean)
is
M : constant Module := Get_Module (Inst);
@@ -360,16 +363,15 @@ package body Netlists.Dump is
declare
W : constant Width := Get_Width (Get_Output (Inst, 0));
V : Uns32;
+ I : Natural;
begin
Put_Trim (Width'Image (W));
- Put ("'ub");
+ Put ("'uh");
V := Get_Param_Uns32 (Inst, 0);
- for I in reverse 0 .. W - 1 loop
- if (Shift_Right (V, Natural (I)) and 1) = 0 then
- Put ('0');
- else
- Put ('1');
- end if;
+ I := (Natural (W) + 3) / 4;
+ while I > 0 loop
+ I := I - 1;
+ Put (Xdigits (Shift_Right (V, I * 4) and 15));
end loop;
end;
return;