aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-04-18 20:13:10 +0200
committerTristan Gingold <tgingold@free.fr>2019-04-18 20:13:10 +0200
commitc73726c65ed88037d26731352cd779bc66b09c68 (patch)
treef7c03a76ba3e51434db3d2b8cbae33e2efea21ff
parent7c7c8a24f20c62ff08399ddb1d7e18813c1f7fd2 (diff)
downloadghdl-c73726c65ed88037d26731352cd779bc66b09c68.tar.gz
ghdl-c73726c65ed88037d26731352cd779bc66b09c68.tar.bz2
ghdl-c73726c65ed88037d26731352cd779bc66b09c68.zip
[PATCH] synth: add comments.
-rw-r--r--src/synth/netlists-dump.adb14
-rw-r--r--src/synth/netlists.ads11
2 files changed, 19 insertions, 6 deletions
diff --git a/src/synth/netlists-dump.adb b/src/synth/netlists-dump.adb
index ad13b1ee8..dc72f80e5 100644
--- a/src/synth/netlists-dump.adb
+++ b/src/synth/netlists-dump.adb
@@ -310,12 +310,14 @@ package body Netlists.Dump is
case Get_Id (Inst) is
when Id_Signal
| Id_Output =>
+ -- Cut loops.
return False;
when others =>
- return not Is_Self_Instance (Inst)
- and then Get_Nbr_Outputs (Inst) = 1
- and then Has_One_Connection (Get_Output (Inst, 0));
+ null;
end case;
+ return not Is_Self_Instance (Inst)
+ and then Get_Nbr_Outputs (Inst) = 1
+ and then Has_One_Connection (Get_Output (Inst, 0));
end Can_Inline;
procedure Disp_Driver (Drv : Net)
@@ -490,7 +492,11 @@ package body Netlists.Dump is
Put_Indent (Indent + 1);
Dump_Name (Get_Output_Desc (M, Get_Port_Idx (I)).Name);
Put (" := ");
- Disp_Net_Name (Get_Driver (I));
+ if False then
+ Disp_Driver (Get_Driver (I));
+ else
+ Disp_Net_Name (Get_Driver (I));
+ end if;
New_Line;
end loop;
end if;
diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads
index 80a90e7b1..0909abfef 100644
--- a/src/synth/netlists.ads
+++ b/src/synth/netlists.ads
@@ -56,6 +56,8 @@ package Netlists is
function Get_Sname_Version (Name : Sname) return Uns32;
function Get_Sname_Num (Name : Sname) return Uns32;
+ -- TODO: procedure to free an Sname.
+
-- Module.
--
-- A module represent an uninstantiated netlist. It is composed of nets
@@ -216,6 +218,7 @@ package Netlists is
-- Mark INST as free, but keep it in the module.
-- Use Remove_Free_Instances for a cleanup.
+ -- TODO: Destroy instance in Remove_Free_Instances.
procedure Free_Instance (Inst : Instance);
function Is_Self_Instance (I : Instance) return Boolean;
@@ -256,6 +259,7 @@ package Netlists is
-- Reconnect all sinks of OLD to N.
procedure Redirect_Inputs (Old : Net; N : Net);
+
private
type Sname is new Uns32 range 0 .. 2**30 - 1;
No_Sname : constant Sname := 0;
@@ -328,8 +332,11 @@ private
First_Output : Net;
end record;
- -- Procedures to rewrite the instances of a module: first extract the chain
- -- of instances from module M, then add the ones to keep.
+ -- Procedures to rewrite the list of instances of a module:
+ -- * first extract the chain of instances from module M (and reset the
+ -- list of instances - so there is none),
+ -- * then add the ones to keep.
+ -- The list of instances is walked by using Get_Next_Instance.
procedure Extract_All_Instances (M : Module; First_Instance : out Instance);
procedure Append_Instance (M : Module; Inst : Instance);