aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-dump.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-28 05:56:40 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-28 05:57:08 +0100
commit0b6a37376975313f34efd161e60f53ef7b5763c1 (patch)
tree7d708fb212182ef0bf43a46c17a4783b0b4b1ac1 /src/synth/netlists-dump.adb
parentf156922d3362d7076da6f42f13804d11cc1b069a (diff)
downloadghdl-0b6a37376975313f34efd161e60f53ef7b5763c1.tar.gz
ghdl-0b6a37376975313f34efd161e60f53ef7b5763c1.tar.bz2
ghdl-0b6a37376975313f34efd161e60f53ef7b5763c1.zip
netlists: remove port API (make it easier to interface).
Diffstat (limited to 'src/synth/netlists-dump.adb')
-rw-r--r--src/synth/netlists-dump.adb33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/synth/netlists-dump.adb b/src/synth/netlists-dump.adb
index c008a1372..22069083a 100644
--- a/src/synth/netlists-dump.adb
+++ b/src/synth/netlists-dump.adb
@@ -212,6 +212,21 @@ package body Netlists.Dump is
end if;
end Disp_Width;
+ procedure Dump_Module_Port (Desc : Port_Desc; Dir : Port_Kind) is
+ begin
+ case Dir is
+ when Port_In =>
+ Put ("input");
+ when Port_Out =>
+ Put ("output");
+ end case;
+ Put (' ');
+ Dump_Name (Desc.Name);
+ Disp_Width (Desc.W);
+ Put (';');
+ New_Line;
+ end Dump_Module_Port;
+
procedure Dump_Module_Header (M : Module; Indent : Natural := 0) is
begin
-- Module id and name.
@@ -239,19 +254,13 @@ package body Netlists.Dump is
end loop;
-- Ports.
- for P of Ports_Desc (M) loop
+ for I in 1 .. Get_Nbr_Inputs (M) loop
Put_Indent (Indent + 1);
- case P.Dir is
- when Port_In =>
- Put ("input");
- when Port_Out =>
- Put ("output");
- end case;
- Put (' ');
- Dump_Name (P.Name);
- Disp_Width (P.W);
- Put (';');
- New_Line;
+ Dump_Module_Port (Get_Input_Desc (M, I - 1), Port_In);
+ end loop;
+ for I in 1 .. Get_Nbr_Outputs (M) loop
+ Put_Indent (Indent + 1);
+ Dump_Module_Port (Get_Output_Desc (M, I - 1), Port_Out);
end loop;
end Dump_Module_Header;