aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-04-16 19:03:15 +0200
committerTristan Gingold <tgingold@free.fr>2019-04-16 19:03:15 +0200
commit9a2709515197bf90a545262025d943be978d2db4 (patch)
treea0671f0abcd211c07a07b77086710b4e324dab57 /src
parent5336f2f3fb7f43ec208f1357588195fc2d915637 (diff)
downloadghdl-9a2709515197bf90a545262025d943be978d2db4.tar.gz
ghdl-9a2709515197bf90a545262025d943be978d2db4.tar.bz2
ghdl-9a2709515197bf90a545262025d943be978d2db4.zip
synth: handle free instances in net iterator.
Diffstat (limited to 'src')
-rw-r--r--src/synth/netlists-iterators.adb13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/synth/netlists-iterators.adb b/src/synth/netlists-iterators.adb
index babf74eb8..2bb1c8c05 100644
--- a/src/synth/netlists-iterators.adb
+++ b/src/synth/netlists-iterators.adb
@@ -301,10 +301,12 @@ package body Netlists.Iterators is
pragma Unreferenced (It);
begin
if Cur.Num > 1 then
+ -- Next net for the instance.
return Nets_Cursor'(Inst => Cur.Inst,
N => Cur.N + 1,
Num => Cur.Num - 1);
else
+ -- Next instance.
declare
Inst : Instance;
Num : Port_Nbr;
@@ -314,10 +316,13 @@ package body Netlists.Iterators is
Inst := Get_Next_Instance (Inst);
exit when Inst = No_Instance;
Num := Get_Nbr_Outputs (Inst);
- pragma Assert (Num > 0);
- return Nets_Cursor'(Inst => Inst,
- N => Get_First_Output (Inst),
- Num => Num);
+ if Num = 0 then
+ pragma Assert (Get_Id (Get_Module (Inst)) = Id_Free);
+ else
+ return Nets_Cursor'(Inst => Inst,
+ N => Get_First_Output (Inst),
+ Num => Num);
+ end if;
end loop;
end;
return Nets_Cursor'(Inst => No_Instance,