prga.core.builder.box.sbox module

class prga.core.builder.box.sbox.SwitchBoxBuilder(context, module)

Bases: prga.core.builder.box.base.BaseRoutingBoxBuilder

Switch box builder.

Parameters:
  • context (Context) – The context of the builder
  • module (Module) – The module to be built
classmethod _add_cboxout(box, node)

Add and connect a cboxout input.

_connect_tracks(isgmt, iori, isec, idx, osgmt, oori, osec, odx, dont_create=False)
_fill_cycle_free(output_orientation, drive_at_crosspoints, crosspoints_only, exclude_input_orientations, dont_create)
_fill_span_limited(output_orientation, drive_at_crosspoints, crosspoints_only, exclude_input_orientations, dont_create, max_span)
_fill_subset(output_orientation, drive_at_crosspoints, crosspoints_only, exclude_input_orientations, dont_create)
_fill_turn_limited(output_orientation, drive_at_crosspoints, crosspoints_only, exclude_input_orientations, dont_create, max_turn)
_fill_universal(output_orientation, drive_at_crosspoints, crosspoints_only, exclude_input_orientations, dont_create)
_fill_wilton(output_orientation, drive_at_crosspoints, crosspoints_only, exclude_input_orientations, dont_create)
classmethod _sbox_key(corner, identifier=None)
classmethod _segment_relative_position(sbox_corner, segment, segment_ori, section=0)
fill(output_orientation, *, drive_at_crosspoints=False, crosspoints_only=False, exclude_input_orientations=(), dont_create=False, pattern=<prga.core.common.SwitchBoxPattern._span_limited object>)

Automatically generate connections implementing the specified pattern.

Parameters:

output_orientation (Orientation or str) –

Keyword Arguments:
 
  • drive_at_crosspoints (bool) – If set, outputs are generated driving non-zero sections of long segments
  • crosspoints_only (bool) – If set, outputs driving the first section of segments are not generated
  • exclude_input_orientations (Container [Orientation or str]) – Exclude segments in the given orientations
  • dont_create (bool) – If set, connections are made only between already created nodes
  • pattern (SwitchBoxPattern) – Switch box pattern
get_segment_input(segment, orientation, section=None, *, dont_create=False)

Get or create a segment input port in this switch 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, section=0, *, dont_create=False)

Get or create a segment output port in this switch 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(corner, *, identifier=None, name=None, **kwargs)

Create a new switch box.

Parameters:

corner (Corner or str) – On which corner of a tile is the switch box

Keyword Arguments:
 
  • identifier (str) – If different switches boxes are needed for the same corner of a tile, use identifier to differentiate them
  • name (str) – Name of the switch box. If not specified, the box is named "sbox_{corner}_{identifier}"
  • **kwargs – Additional attributes assigned to the switch 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.sbox._SwitchBoxKey

Bases: prga.core.builder.box.sbox._SwitchBoxKey

Switch box key.

Parameters:
  • corner (Corner) –
  • identifier (str) – Unique identifier to differentiate switch boxes for the same corner