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:
 
Returns:

Return type:

AbstractInstance

_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:

AbstractInstance

Notes

The difference in the inclusiveness of args low and high is intended to match the list indexing mechanism in Python.

hierarchy

Hierarchy of this instance in bottom-up order.

Type:Sequence [Instance ]
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 or HierarchicalPin]
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, or ModuleUtils._dereference instead.

_hierarchy
_pins_proxy
hierarchy

Hierarchy of this instance in bottom-up order.

Type:Sequence [Instance ]
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 or HierarchicalPin]
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:
  • parent (Module) – Parent module
  • model (Module) – Model of this instance
  • name (str) – Name of the instance
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
hierarchy

Hierarchy of this instance in bottom-up order.

Type:Sequence [Instance ]
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 or HierarchicalPin]
class prga.netlist.module.instance._InstancePinsProxy(instance)

Bases: collections.abc.Mapping

Helper class for AbstractInstance.pins property.

Parameters:instance (AbstractInstance) –
instance