prga.core.builder.array.array module¶
-
class
prga.core.builder.array.array.
ArrayBuilder
(context, module)¶ Bases:
prga.core.builder.array.base.BaseArrayBuilder
Array builder.
Parameters: -
classmethod
_ArrayBuilder__expose_node
(pin)¶
-
classmethod
_connect_cboxout
(module, pin, *, create_port=False)¶
-
classmethod
_equiv_sbox_position
(position, from_corner, to_corner=None)¶
-
classmethod
_expose_node
(pin, *, create_port=False)¶ Recursively expose a hierarchical routing node.
Parameters: pin ( Pin
) – A (hierarchical) pin of a routing nodeKeyword Arguments: create_port ( bool
) – If set toTrue
, a port is create at the parent module ofpin
Returns: Return type: Pin
orPort
-
classmethod
_find_segment_drivers
(module, node, pos, ordering, corner_idx)¶ Find the best segment driver.
-
classmethod
_no_channel_for_switchbox
(module, position, corner, ori, output=False)¶
-
classmethod
_prepare_segment_driver_search
(drivee)¶
-
auto_connect
(*, is_top=None)¶ Automatically connect submodules.
Keyword Arguments: is_top ( bool
) – If set toTrue
, the array is treated as if it is the top-level array. This affects if unconnected routing nodes are exposed as ports. If not set, this method checks thecontext
to see if the module being built is the top-level arrayReturns: - Return
self
to support chaining, e.g., array = builder.fill().auto_connect().commit()
Return type: ArrayBuilder
- Return
-
fill
(sbox_pattern=<prga.core.common.SwitchBoxPattern._wilton object>, *, identifier=None, dont_create=False, dont_update=False, primaries=None, secondaries=None)¶ Automatically create switch box connections using switch box patterns.
Parameters: sbox_pattern (
SwitchBoxPattern
) –Keyword Arguments: - identifier (
str
) – Used to differentiate the switch boxes - dont_create (
bool
) – If set toTrue
, only existing switch box instances are to be filled. No new instances are created - dont_update (
bool
) – If set toTrue
, existing switch box instances are not updated
Returns: - Return
self
to support chaining, e.g., array = builder.fill().auto_connect().commit()
Return type: - identifier (
-
classmethod
get_hierarchical_root
(array, position, corner=None)¶ Get the hierarchical root instance occupying the given position.
Parameters: - position (
tuple
[int
,int
]) – Position of the tile - corner (
Corner
orstr
) – If specified, get the switch box instance
Returns: If
corner
is not specified, return a hierarhical instance of a tile; otherwise a switch boxReturn type: - position (
-
classmethod
hierarchical_position
(instance)¶
-
instantiate
(model, position, *, name=None, **kwargs)¶ Instantiate
model
at the specified position in the array.Parameters: - model (
Module
) – A tile, an array or a switch box - position (
tuple
[int
,int
]) – Root position for the tile/array, or exact position of the switch box
Keyword Arguments: - name (
str
) – Name of the instance. By default,"t_ix{x}y{y}"
is used for tile/array instances and"sb_ix{x}y{t}{corner}"
is used for switch box instances - **kwargs – Additional attributes assigned to the instance
Returns: Return type: - model (
-
classmethod
new
(name, width, height, *, edge=OrientationTuple(north=False, east=False, south=False, west=False), **kwargs)¶ Create a new array.
Parameters: - name (
str
) – Name of the array - width (
int
) – Width of the array - height (
int
) – Height of the array
Keyword Arguments: - edge (
OrientationTuple
[bool
]) – Marks this array to be on the specified edges of the top-level array. This affects segment instantiation. - **kwargs – Additional attributes assigned to the array
Returns: - name (
-
classmethod
-
class
prga.core.builder.array.array.
_ArrayInstancesMapping
(width, height)¶ Bases:
prga.util.Object
,collections.abc.MutableMapping
Helper class for
Array.instances
property.Parameters: - width (
int
) – Width of the tile/array - height (
int
) – Height of the tile/array
- Supported key types:
tuple
[int
,int
]: Root position of a tile. If a tile is larger than 1x1, the position of- its bottom-left corner is the root position
tuple
[tuple
[int
,int
],Corner
]: Position of a switch box. The first element- is the position, and the second element is the corner in that position
-
_ArrayInstancesMapping__validate_position
(x, y)¶
-
get_root
(position, corner=None)¶
-
sboxes
¶
-
tiles
¶
- width (