FABulous.geometry_generator.sm_geometry#

Switch matrix geometry definitions.

Classes#

class SmGeometry[source]#

A data structure representing the geometry of a Switch Matrix.

name[source]#

Name of the switch matrix

Type:

str

src[source]#

File path of the switch matrix HDL source file

Type:

str

csv[source]#

File path of the switch matrix CSV file

Type:

str

width[source]#

Width of the switch matrix

Type:

int

height[source]#

Height of the switch matrix

Type:

int

relX[source]#

X coordinate of the switch matrix, relative within the tile

Type:

int

relY[source]#

Y coordinate of the switch matrix, relative within the tile

Type:

int

northPorts[source]#

List of the ports of the switch matrix in north direction

Type:

List[Port]

southPorts[source]#

List of the ports of the switch matrix in south direction

Type:

List[Port]

eastPorts[source]#

List of the ports of the switch matrix in east direction

Type:

List[Port]

westPorts[source]#

List of the ports of the switch matrix in west direction

Type:

List[Port]

jumpPorts[source]#

List of the jump ports of the switch matrix

Type:

List[Port]

portGeoms[source]#

List of geometries of the ports of the switch matrix

Type:

List[PortGeometry]

northWiresReservedWidth[source]#

Reserved width for wires going north

Type:

int

southWiresReservedWidth[source]#

Reserved width for wires going south

Type:

int

eastWiresReservedHeight[source]#

Reserved height for wires going east

Type:

int

westWiresReservedHeight[source]#

Reserved height for wires going west

Type:

int

southPortsTopY[source]#

Top most y coord of any south port, reference for stair-wires

Type:

int

westPortsRightX[source]#

Right most x coord of any west port, reference for stair-wires

Type:

int

Initialize a SmGeometry instance.
Sets all attributes to default values
Type:

None for names and paths,

zero for dimensions and coordinates, and empty lists for ports
and port geometries.

Methods:

generateBelPorts(belGeomList)[source]#

Generate port geometries for BEL connections to the switch matrix.

Creates PortGeometry objects for connecting BEL internal ports to the switch matrix. These ports facilitate routing between BELs and the switch matrix interconnect network.

Parameters:

belGeomList (list[BelGeometry]) – List of BEL geometries to connect to the switch matrix

Return type:

None

generateGeometry(tile, tileBorder, belGeoms, padding)[source]#

Generate the geometry for a switch matrix.

Creates the geometric representation of a switch matrix including its dimensions, port arrangements, and spatial relationships. Calculates the required space for routing wires and positions the switch matrix within the tile. the required space for routing wires and positions for the switch matrix

Parameters:
  • tile (Tile) – The tile object containing the switch matrix definition

  • tileBorder (Border) – The border type of the tile within the fabric

  • belGeoms (list[BelGeometry]) – List of BEL geometries within the same tile

  • padding (int) – The padding space to add around the switch matrix

Return type:

None

generatePortsGeometry(padding)[source]#

Generate the geometry for all ports of the switch matrix.

Creates PortGeometry objects for all jump, north, south, east, and west ports of the switch matrix. Positions each port according to its type and assigns appropriate coordinates and grouping information.

Parameters:

padding (int) – The padding space to add around ports

Return type:

None

preprocessPorts(tileBorder)[source]#

Order the ports for downstream drawing.

Ensure that ports are ordered correctly, merge connected jump ports and augment ports for term tiles. This step augments ports in border tiles. This is needed, as these are not contained in the (north…west)SidePorts in FABulous.

Parameters:

tileBorder (Border)

Return type:

None

saveToCSV(writer)[source]#

Save switch matrix geometry data to CSV format.

Writes the switch matrix geometry information including name, source and CSV file paths, position, dimensions, and all port geometries to a CSV file using the provided writer.

Parameters:

writer (object) – The CSV writer object to use for output

Return type:

None