prga.core.builder.box.cbox module¶
-
class
prga.core.builder.box.cbox.
ConnectionBoxBuilder
(context, module)¶ Bases:
prga.core.builder.box.base.BaseRoutingBoxBuilder
Connection box builder.
Parameters: -
classmethod
_cbox_key
(tile, orientation, offset=None)¶
-
classmethod
_segment_relative_position
(cbox_ori, segment, segment_ori, section=0)¶
-
fill
(default_fc, *, fc_override=None, dont_create=False)¶ Automatically create port-segment connections using FC values.
Parameters: default_fc – Default FC value for all blocks whose FC value is not defined. If one single
int
orfloat
is given, this FC value applies to all ports of all blocks. If atuple
of twoint`s or :obj:`float`s are given, the first one applies to all input ports while the second one applies to all output ports. Use `BlockFCValue
for more custom options.Keyword Arguments: - fc_override (
Mapping
) – Override the FC settings for specific blocks. Indexed by block key. - dont_create (
bool
) – If set, connections are made only between already created nodes
- fc_override (
-
get_blockpin
(pin, *, dont_create=False)¶ Get or create a blockpin input/output port in this connection box.
Parameters: pin ( Pin
) – Pin of a block instance in the tile that this connection box is inKeyword Arguments: dont_create ( bool
) – If set, returnNone
when the requested block pin is not already createdReturns: Return type: Port
-
get_segment_input
(segment, orientation, section=0, *, dont_create=False)¶ Get or create a segment input port in this connection box.
Parameters: - segment (
prga.core.common.Segment
) – Prototype of the segment - orientation (
Orientation
orstr
) – Orientation of the segment - section (
int
) – Section of the segment
Keyword Arguments: dont_create (
bool
) – If set, returnNone
when the requested segment input is not already createdReturns: Return type: - segment (
-
get_segment_output
(segment, orientation, *, dont_create=False)¶ Get or create a segment output port in this connection box.
Parameters: - segment (
prga.core.common.Segment
) – Prototype of the segment - orientation (
Orientation
orstr
) – Orientation of the segment
Keyword Arguments: dont_create (
bool
) – If set, returnNone
when the requested segment output is not already createdReturns: Return type: - segment (
-
classmethod
new
(tile, orientation, offset=None, *, name=None, **kwargs)¶ Create a new connection box in abstract view at a specific location in
tile
.Parameters: - tile (
Module
) – The tile that this connection box is in - orientation (
Orientation
orstr
) – On which side of the tile is the connection box - offset (
int
) – Offset of the connection box in the specified orientation
Keyword Arguments: - name (
str
) – Name of the connection box. If not specified, the box is named"cbox_{tile.name}_{orientation}{offset}"
- **kwargs – Additional attributes assigned to the connection box. Beware that these
attributes are NOT carried over to the design view automatically generated by
Translation
Returns: Return type: - tile (
-
classmethod
-
class
prga.core.builder.box.cbox.
_ConnectionBoxKey
¶ Bases:
prga.core.builder.box.cbox._ConnectionBoxKey
Connection box key.
Parameters: - tile (
Module
) – The tile which this connection box is in - orientation (
Orientation
) – On which side of the tile is the connection box - offset (
int
) – Offset of the connection box on the specified edge
- tile (