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:
  • context (Context) – The context of the builder
  • module (Module) – The module to be built
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 or float is given, this FC value applies to all ports of all blocks. If a tuple of two int`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
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 in
Keyword Arguments:
 dont_create (bool) – If set, return None when the requested block pin is not already created
Returns:
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:
Keyword Arguments:
 

dont_create (bool) – If set, return None when the requested segment input is not already created

Returns:

Return type:

Port

get_segment_output(segment, orientation, *, dont_create=False)

Get or create a segment output port in this connection box.

Parameters:
Keyword Arguments:
 

dont_create (bool) – If set, return None when the requested segment output is not already created

Returns:

Return type:

Port

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 or str) – 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:

Module

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
channel

The channel that is occupied by this connection box.

Type:tuple [Position, Dimension ]
position

Position of this connection box in the tile.

Type:Position