From ef0164a6e0bb466c29bf6d9abba0d315b0ae9fd3 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 23 May 2020 17:48:54 +0200 Subject: netlists: complete support of attributes. For #1318 --- src/synth/netlists.ads | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/synth/netlists.ads') diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads index a425575ab..5ef74a77d 100644 --- a/src/synth/netlists.ads +++ b/src/synth/netlists.ads @@ -210,6 +210,9 @@ package Netlists is type Pval is private; No_Pval : constant Pval; + -- Attribute of an instance. + type Attribute is private; + -- Subprograms for modules. function New_Design (Name : Sname) return Module; function New_User_Module (Parent : Module; @@ -331,6 +334,17 @@ package Netlists is procedure Set_Attribute (Inst : Instance; Id : Name_Id; Ptype : Param_Type; Pv : Pval); + -- Return the first attribute for INST. Returns No_Attribute if none. + function Get_First_Attribute (Inst : Instance) return Attribute; + + -- Get name/type/value of an attribute. + function Get_Attribute_Name (Attr : Attribute) return Name_Id; + function Get_Attribute_Type (Attr : Attribute) return Param_Type; + function Get_Attribute_Pval (Attr : Attribute) return Pval; + + -- Get the next attribute for the same instance. + function Get_Attribute_Next (Attr : Attribute) return Attribute; + -- Display some usage stats on the standard error. procedure Disp_Stats; private @@ -425,13 +439,15 @@ private function Get_First_Output (Inst : Instance) return Net; function Get_Port_Desc (Idx : Port_Desc_Idx) return Port_Desc; + function Get_Attributes (M : Module) return Attribute_Map_Acc; + function Is_Valid (I : Instance) return Boolean; type Instance_Record is record -- The instance is instantiated in Parent. - Parent : Module; - Flag3 : Boolean; - Flag4 : Boolean; + Parent : Module; + Has_Attr : Boolean; -- Set when there is at least one attribute. + Flag4 : Boolean; -- Instances are in a doubly-linked list. Prev_Instance : Instance; -- cgit v1.2.3