aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/synth/netlists.adb4
-rw-r--r--src/synth/netlists.ads38
2 files changed, 27 insertions, 15 deletions
diff --git a/src/synth/netlists.adb b/src/synth/netlists.adb
index 58c00804d..840849162 100644
--- a/src/synth/netlists.adb
+++ b/src/synth/netlists.adb
@@ -402,10 +402,12 @@ package body Netlists is
Params_Table.Allocate (Natural (Nbr_Params));
begin
Instances_Table.Append ((Parent => Parent,
+ Flag3 | Flag4 => False,
Next_Instance => No_Instance,
Prev_Instance => No_Instance,
Klass => M,
Flag_Mark => False,
+ Flag5 | Flag6 => False,
Flag2 => False,
Name => Name,
First_Param => Params,
@@ -1035,9 +1037,11 @@ begin
pragma Assert (Modules_Table.Last = Free_Module);
Instances_Table.Append ((Parent => No_Module,
+ Flag3 | Flag4 => False,
Next_Instance => No_Instance,
Prev_Instance => No_Instance,
Klass => No_Module,
+ Flag5 | Flag6 => False,
Flag_Mark => False,
Flag2 => False,
Name => No_Sname,
diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads
index c478cd961..2801b8fb0 100644
--- a/src/synth/netlists.ads
+++ b/src/synth/netlists.ads
@@ -342,7 +342,7 @@ private
for Sname_Record'Size use 2*32;
pragma Warnings (On, "*convention*");
- type Module is new Uns32;
+ type Module is mod 2**30;
No_Module : constant Module := 0;
Free_Module : constant Module := 1;
@@ -361,18 +361,18 @@ private
No_Net : constant Net := 0;
type Module_Record is record
- Parent : Module;
- Name : Sname;
- Id : Module_Id;
- First_Port_Desc : Port_Desc_Idx;
- Nbr_Inputs : Port_Nbr;
- Nbr_Outputs : Port_Nbr;
+ Parent : Module;
+ Name : Sname;
+ Id : Module_Id;
+ First_Port_Desc : Port_Desc_Idx;
+ Nbr_Inputs : Port_Nbr;
+ Nbr_Outputs : Port_Nbr;
First_Param_Desc : Param_Desc_Idx;
- Nbr_Params : Param_Nbr;
+ Nbr_Params : Param_Nbr;
-- First sub-module child.
First_Sub_Module : Module;
- Last_Sub_Module : Module;
+ Last_Sub_Module : Module;
-- Sub-module brother.
Next_Sub_Module : Module;
@@ -381,7 +381,7 @@ private
-- The self instance is the first instance.
-- FIXME: use an array instead ?
First_Instance : Instance;
- Last_Instance : Instance;
+ Last_Instance : Instance;
end record;
function Get_First_Port_Desc (M : Module) return Port_Desc_Idx;
@@ -396,19 +396,24 @@ private
type Instance_Record is record
-- The instance is instantiated in Parent.
Parent : Module;
+ Flag3 : Boolean;
+ Flag4 : Boolean;
-- Instances are in a doubly-linked list.
Prev_Instance : Instance;
Next_Instance : Instance;
-- For a self-instance, Klass is equal to Parent, and Name is No_Sname.
- Klass : Module;
- Name : Sname;
+ Klass : Module;
+ Flag5 : Boolean;
+ Flag6 : Boolean;
+
+ Name : Sname;
Flag_Mark : Boolean;
- Flag2 : Boolean;
+ Flag2 : Boolean;
- First_Param : Param_Idx;
- First_Input : Input;
+ First_Param : Param_Idx;
+ First_Input : Input;
First_Output : Net;
end record;
pragma Pack (Instance_Record);
@@ -428,6 +433,9 @@ private
-- Extract INST from the list of instance of its module.
-- Will still be connected, but won't appear anymore in the list of
-- instances.
+ -- Once extracted, the instance is not in a consistent state anymore. So
+ -- it should be either fully disconnected and freed or re-inserted in the
+ -- parent module.
procedure Extract_Instance (Inst : Instance);
-- Remove and free the unconnected instance INST.