aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-10 08:40:06 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-11 20:29:09 +0100
commita9d4cba091789f10eb25ccbcbc4d832c8847cf67 (patch)
treebe82dc32441f8374e8df61fa2d7a58f39d884007
parent45032759fc845dddd2a150c13cb714927cdf98f4 (diff)
downloadghdl-a9d4cba091789f10eb25ccbcbc4d832c8847cf67.tar.gz
ghdl-a9d4cba091789f10eb25ccbcbc4d832c8847cf67.tar.bz2
ghdl-a9d4cba091789f10eb25ccbcbc4d832c8847cf67.zip
netlists-dump: display ports name.
-rw-r--r--src/synth/netlists-dump.adb38
-rw-r--r--src/synth/netlists.ads3
2 files changed, 29 insertions, 12 deletions
diff --git a/src/synth/netlists-dump.adb b/src/synth/netlists-dump.adb
index 3be27f3e4..279b98d2e 100644
--- a/src/synth/netlists-dump.adb
+++ b/src/synth/netlists-dump.adb
@@ -493,21 +493,35 @@ package body Netlists.Dump is
Dump_Name (Get_Instance_Name (Inst));
end if;
- if Get_Nbr_Inputs (Inst) > 0 then
- declare
- First : Boolean;
- Drv : Net;
- begin
- First := True;
+ declare
+ Nbr_Inputs : constant Port_Nbr := Get_Nbr_Inputs (Inst);
+ M : constant Module := Get_Module (Inst);
+ Nbr_Fixed_Inputs : constant Port_Nbr := Get_Nbr_Inputs (M);
+ Drv : Net;
+ I : Input;
+ Desc : Port_Desc;
+ begin
+ if Nbr_Inputs > 0 then
Put (" (");
- for I of Inputs (Inst) loop
- if not First then
- Put (",");
+ for Idx in 0 .. Nbr_Inputs - 1 loop
+ I := Get_Input (Inst, Idx);
+ if Idx > 0 then
+ Put (",");
end if;
- First := False;
New_Line;
Put_Indent (Indent);
+ -- Input name.
+ if Idx < Nbr_Fixed_Inputs then
+ Desc := Get_Input_Desc (M, Idx);
+ if Desc.Name /= No_Sname then
+ Put ('.');
+ Dump_Name (Desc.Name);
+ Put (": ");
+ end if;
+ end if;
+
+ -- Input value.
Drv := Get_Driver (I);
if Drv = No_Net then
@@ -518,8 +532,8 @@ package body Netlists.Dump is
end if;
end loop;
Put (')');
- end;
- end if;
+ end if;
+ end;
end Disp_Instance;
procedure Disp_Instance_Assign (Inst : Instance; Indent : Natural := 0) is
diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads
index 80140c92c..0b54c0a9e 100644
--- a/src/synth/netlists.ads
+++ b/src/synth/netlists.ads
@@ -210,6 +210,9 @@ package Netlists is
function Get_Module_Name (M : Module) return Sname;
function Get_Id (M : Module) return Module_Id;
+ -- Number of fixed inputs/outputs.
+ -- For gates with variable number of inputs (like Concatn), use the
+ -- functions from Netlists.Utils.
function Get_Nbr_Inputs (M : Module) return Port_Nbr;
function Get_Nbr_Outputs (M : Module) return Port_Nbr;