sm_geometryยถ

Switch matrix geometry definitions.

Classesยถ

SmGeometry

A data structure representing the geometry of a Switch Matrix.

Module Contentsยถ

SmGeometryยถ

class SmGeometry[source]ยถ

A data structure representing the geometry of a Switch Matrix.

Sets all attributes to default values: None for names and paths, zero for dimensions and coordinates, and empty lists for ports and port geometries.

Variables:
  • name (str) โ€“ Name of the switch matrix

  • src (Path) โ€“ File path of the switch matrix HDL source file

  • csv (Path) โ€“ File path of the switch matrix CSV file

  • width (int) โ€“ Width of the switch matrix

  • height (int) โ€“ Height of the switch matrix

  • relX (int) โ€“ X coordinate of the switch matrix, relative within the tile

  • relY (int) โ€“ Y coordinate of the switch matrix, relative within the tile

  • northPorts (list[Port]) โ€“ List of the ports of the switch matrix in north direction

  • southPorts (list[Port]) โ€“ List of the ports of the switch matrix in south direction

  • eastPorts (list[Port]) โ€“ List of the ports of the switch matrix in east direction

  • westPorts (list[Port]) โ€“ List of the ports of the switch matrix in west direction

  • jumpPorts (list[Port]) โ€“ List of the jump ports of the switch matrix

  • portGeoms (list[PortGeometry]) โ€“ List of geometries of the ports of the switch matrix

  • northWiresReservedWidth (int) โ€“ Reserved width for wires going north

  • southWiresReservedWidth (int) โ€“ Reserved width for wires going south

  • eastWiresReservedHeight (int) โ€“ Reserved height for wires going east

  • westWiresReservedHeight (int) โ€“ Reserved height for wires going west

  • southPortsTopY (int) โ€“ Top most y coord of any south port, reference for stair-wires

  • westPortsRightX (int) โ€“ Right most x coord of any west port, reference for stair-wires

Methodsยถ

generateBelPorts(belGeomList) None[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

generateGeometry(tile, tileBorder, belGeoms, padding) None[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

generatePortsGeometry(padding) None[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

preprocessPorts(tileBorder) None[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.

saveToCSV(writer) None[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