prga.netlist.module.instance module¶
Netlist module instances, i.e. sub-modules.
-
class
prga.netlist.module.instance.
AbstractInstance
¶ Bases:
prga.util.Object
Abstract base class for instances.
-
_extend_hierarchy
(*, above=None, below=None)¶ Extend the hierarchy.
Keyword Arguments: - above (
AbstractInstance
ortuple
[Instance
]) – Append above the current hierarchy - below (
AbstractInstance
ortuple
[Instance
]) – Append below the current hierarchy
Returns: Return type: - above (
-
_shrink_hierarchy
(*, low=None, high=None)¶ Shrink the hierarchy.
Keyword Arguments: - low (
int
) – The lowest hierarchy (INCLUSIVE) to be kept - high (
int
) – The highest hierarchy (EXCLUSIVE) to be kept
Returns: Return type: Notes
The difference in the inclusiveness of args
low
andhigh
is intended to match the list indexing mechanism in Python.- low (
-
is_hierarchical
¶ Test if this is a hierarchical instance.
Type: bool
-
model
¶ The module instantiated. For a hierarchical instance, this is the model of the leaf instance.
Type: Module
-
parent
¶ Module which instance belongs to. For a hierarchical instance, this means the top-level module.
Type: Module
-
pins
¶ Pins of this instance.
Type: Mapping
[Hashable
,Pin
orHierarchicalPin
]
-
-
class
prga.netlist.module.instance.
HierarchicalInstance
(hierarchy)¶ Bases:
prga.netlist.module.instance.AbstractInstance
Hierarchical instance in a module.
Parameters: hierarchy ( tuple
[Instance
]) – Hierarchy in bottom-up order.Notes
Direct instantiation of this class is not recommended. Use
AbstractInstance._shrink_hierarchy
,AbstractInstance._extend_hierarchy
, orModuleUtils._dereference
instead.-
_hierarchy
¶
-
_pins_proxy
¶
-
is_hierarchical
¶ Test if this is a hierarchical instance.
Type: bool
-
model
¶ The module instantiated. For a hierarchical instance, this is the model of the leaf instance.
Type: Module
-
parent
¶ Module which instance belongs to. For a hierarchical instance, this means the top-level module.
Type: Module
-
pins
¶ Pins of this instance.
Type: Mapping
[Hashable
,Pin
orHierarchicalPin
]
-
-
class
prga.netlist.module.instance.
Instance
(parent, model, name, *, key=None, **kwargs)¶ Bases:
prga.netlist.module.instance.AbstractInstance
Direct sub-instance in a module.
Parameters: Keyword Arguments: - key (
Hashable
) – A hashable key used to index this instance in the instances mapping in the parent module. If not set (default argument:None
),name
is used by default - **kwargs – Custom attributes associated with this instance
-
_key
¶
-
_model
¶
-
_name
¶
-
_parent
¶
-
_pins
¶
-
_pins_proxy
¶
-
is_hierarchical
¶ Test if this is a hierarchical instance.
Type: bool
-
key
¶ A hashable key used to index this instance in the parent module’s isntance mapping.
Type: Hashable
-
model
¶ The module instantiated. For a hierarchical instance, this is the model of the leaf instance.
Type: Module
-
name
¶ Name of this instance.
Type: str
-
parent
¶ Module which instance belongs to. For a hierarchical instance, this means the top-level module.
Type: Module
-
pins
¶ Pins of this instance.
Type: Mapping
[Hashable
,Pin
orHierarchicalPin
]
- key (
-
class
prga.netlist.module.instance.
_InstancePinsProxy
(instance)¶ Bases:
collections.abc.Mapping
Helper class for
AbstractInstance.pins
property.Parameters: instance ( AbstractInstance
) –-
instance
¶
-