diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-13 18:56:28 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-13 18:56:28 +0100 |
commit | d75f92f6426d99d677d814cdf937c6fff23e9792 (patch) | |
tree | f802df465f1c6a1037a849b91380b654d2ab3cb8 | |
parent | db631c6a1110ce29fcb3e97e116b320578322662 (diff) | |
download | ghdl-d75f92f6426d99d677d814cdf937c6fff23e9792.tar.gz ghdl-d75f92f6426d99d677d814cdf937c6fff23e9792.tar.bz2 ghdl-d75f92f6426d99d677d814cdf937c6fff23e9792.zip |
netlists-cleanup: add comments.
-rw-r--r-- | src/synth/netlists-cleanup.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/synth/netlists-cleanup.adb b/src/synth/netlists-cleanup.adb index 21d6f94d1..54cb6300e 100644 --- a/src/synth/netlists-cleanup.adb +++ b/src/synth/netlists-cleanup.adb @@ -21,6 +21,9 @@ with Netlists.Utils; use Netlists.Utils; package body Netlists.Cleanup is + -- Return False iff INST has no outputs (and INST is not Id_Free). + -- Return True iff all outputs of INST are unconnected. + -- Return False otherwise. function Is_Unused_Instance (Inst : Instance) return Boolean is Nbr_Outputs : constant Port_Idx := Get_Nbr_Outputs (Inst); @@ -43,6 +46,7 @@ package body Netlists.Cleanup is return True; end Is_Unused_Instance; + -- Move INST on LIST iff INST is unused. procedure Extract_If_Unused (Inst : Instance; List : in out Instance) is begin if Is_Unused_Instance (Inst) then @@ -92,8 +96,10 @@ package body Netlists.Cleanup is Inp := Get_Input (Inst, K); Drv := Get_Driver (Inp); if Drv /= No_Net then - -- The input was already unconnected. + -- Disconnect the input. Disconnect (Inp); + -- Possibly consider the driver as unconnected if was + -- the last input connected. if Get_First_Sink (Drv) = No_Input then Inst2 := Get_Net_Parent (Drv); Extract_If_Unused (Inst2, List); |