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: -
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
orstr
) –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
orstr
]) – Exclude segments in the given orientations - dont_create (
bool
) – If set, connections are made only between already created nodes - pattern (
SwitchBoxPattern
) – Switch box pattern
- drive_at_crosspoints (
-
get_segment_input
(segment, orientation, section=None, *, dont_create=False)¶ Get or create a segment input port in this switch 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, section=0, *, dont_create=False)¶ Get or create a segment output port in this switch 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 output is not already createdReturns: Return type: - segment (
-
classmethod
new
(corner, *, identifier=None, name=None, **kwargs)¶ Create a new switch box.
Parameters: corner (
Corner
orstr
) – On which corner of a tile is the switch boxKeyword 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: - identifier (
-
classmethod
-
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
- corner (