FABulous.geometry_generator.sm_geometry#
Switch matrix geometry definitions.
Classes#
- class SmGeometry[source]#
A data structure representing the geometry of a Switch Matrix.
- portGeoms[source]#
List of geometries of the ports of the switch matrix
- Type:
List[PortGeometry]
- 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