aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-dump.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-17 08:06:33 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-17 08:06:33 +0200
commita7cf3bd793fdbd9f5f03bc496040d4ce91931186 (patch)
tree59f73cb1b4719ab125d29ee3f6fb14eec39a7372 /src/synth/netlists-dump.adb
parent2019f1903faf77efdcc03c927aa353b9e3307d5d (diff)
downloadghdl-a7cf3bd793fdbd9f5f03bc496040d4ce91931186.tar.gz
ghdl-a7cf3bd793fdbd9f5f03bc496040d4ce91931186.tar.bz2
ghdl-a7cf3bd793fdbd9f5f03bc496040d4ce91931186.zip
netlists-dump: add width on extract output.
Diffstat (limited to 'src/synth/netlists-dump.adb')
-rw-r--r--src/synth/netlists-dump.adb19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/synth/netlists-dump.adb b/src/synth/netlists-dump.adb
index 5d33cc664..8e1550dc9 100644
--- a/src/synth/netlists-dump.adb
+++ b/src/synth/netlists-dump.adb
@@ -379,11 +379,20 @@ package body Netlists.Dump is
return;
when Id_Extract =>
- Disp_Driver (Get_Input_Net (Inst, 0));
- Put ('[');
- Put_Trim (Uns32'Image (Get_Param_Uns32 (Inst, 0)));
- Put (']');
- return;
+ declare
+ W : constant Width := Get_Width (Get_Output (Inst, 0));
+ Off : constant Uns32 := Get_Param_Uns32 (Inst, 0);
+ begin
+ Disp_Driver (Get_Input_Net (Inst, 0));
+ Put ('[');
+ if W > 1 then
+ Put_Trim (Uns32'Image (Off + W - 1));
+ Put (':');
+ end if;
+ Put_Trim (Uns32'Image (Off));
+ Put (']');
+ return;
+ end;
when others =>
null;