From a7cf3bd793fdbd9f5f03bc496040d4ce91931186 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 17 Sep 2019 08:06:33 +0200 Subject: netlists-dump: add width on extract output. --- src/synth/netlists-dump.adb | 19 ++++++++++++++----- 1 file 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; -- cgit v1.2.3