aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-18 18:38:57 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-18 18:38:57 +0200
commit7c8f4b6b20d42ba69d889f11c3da1f7aca877792 (patch)
tree8ceff3223f219c3d7c8456fe14b4c8146819ab01 /src/synth/netlists.adb
parente1ef6a6dee1c5b140022f191306931a40ff57cd6 (diff)
downloadghdl-7c8f4b6b20d42ba69d889f11c3da1f7aca877792.tar.gz
ghdl-7c8f4b6b20d42ba69d889f11c3da1f7aca877792.tar.bz2
ghdl-7c8f4b6b20d42ba69d889f11c3da1f7aca877792.zip
netlists: add disp_stats.
Diffstat (limited to 'src/synth/netlists.adb')
-rw-r--r--src/synth/netlists.adb30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/synth/netlists.adb b/src/synth/netlists.adb
index 840849162..09a01f841 100644
--- a/src/synth/netlists.adb
+++ b/src/synth/netlists.adb
@@ -20,6 +20,7 @@
with Std_Names;
with Tables;
+with Simple_IO;
with Netlists.Utils; use Netlists.Utils;
with Netlists.Gates;
@@ -998,6 +999,35 @@ package body Netlists is
Pval_Word_Table.Table (Pval_Rec.Zx_Idx + Off) := Val.Zx;
end if;
end Write_Pval;
+
+ procedure Disp_Stats
+ is
+ use Simple_IO;
+ Unused : Natural;
+ begin
+ Put_Line_Err ("Statistics for netlists:");
+ Put_Line_Err
+ (" snames: " & Sname'Image (Snames_Table.Last));
+ Put_Line_Err
+ (" modules: " & Module'Image (Modules_Table.Last));
+ Put_Line_Err
+ (" instances: " & Instance'Image (Instances_Table.Last));
+ Unused := 0;
+ for I in No_Instance + 1 .. Instances_Table.Last loop
+ if Get_Module (I) = Free_Module then
+ Unused := Unused + 1;
+ end if;
+ end loop;
+ Put_Line_Err
+ (" free instances: " & Natural'Image (Unused));
+ Put_Line_Err
+ (" nets: " & Net'Image (Nets_Table.Last));
+ Put_Line_Err
+ (" inputs: " & Input'Image (Inputs_Table.Last));
+ Put_Line_Err
+ (" params: " & Param_Idx'Image (Params_Table.Last));
+ end Disp_Stats;
+
begin
-- Initialize snames_table: create the first entry for No_Sname.
Snames_Table.Append ((Kind => Sname_Artificial,