FABulous.geometry_generator.sm_geometry ======================================= .. py:module:: FABulous.geometry_generator.sm_geometry .. autoapi-nested-parse:: Switch matrix geometry definitions. Classes ------- .. py:class:: SmGeometry() A data structure representing the geometry of a Switch Matrix. .. attribute:: name Name of the switch matrix :type: str .. attribute:: src File path of the switch matrix HDL source file :type: str .. attribute:: csv File path of the switch matrix CSV file :type: str .. attribute:: width Width of the switch matrix :type: int .. attribute:: height Height of the switch matrix :type: int .. attribute:: relX X coordinate of the switch matrix, relative within the tile :type: int .. attribute:: relY Y coordinate of the switch matrix, relative within the tile :type: int .. attribute:: northPorts List of the ports of the switch matrix in north direction :type: List[Port] .. attribute:: southPorts List of the ports of the switch matrix in south direction :type: List[Port] .. attribute:: eastPorts List of the ports of the switch matrix in east direction :type: List[Port] .. attribute:: westPorts List of the ports of the switch matrix in west direction :type: List[Port] .. attribute:: jumpPorts List of the jump ports of the switch matrix :type: List[Port] .. attribute:: portGeoms List of geometries of the ports of the switch matrix :type: List[PortGeometry] .. attribute:: northWiresReservedWidth Reserved width for wires going north :type: int .. attribute:: southWiresReservedWidth Reserved width for wires going south :type: int .. attribute:: eastWiresReservedHeight Reserved height for wires going east :type: int .. attribute:: westWiresReservedHeight Reserved height for wires going west :type: int .. attribute:: southPortsTopY Top most y coord of any south port, reference for stair-wires :type: int .. attribute:: westPortsRightX Right most x coord of any west port, reference for stair-wires :type: int .. attribute:: Initialize a SmGeometry instance. .. attribute:: Sets all attributes to default values :type: None for names and paths, .. attribute:: zero for dimensions and coordinates, and empty lists for ports .. attribute:: and port geometries. **Methods:** .. py:method:: generateBelPorts(belGeomList) 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. :param belGeomList: List of BEL geometries to connect to the switch matrix :type belGeomList: list[BelGeometry] .. py:method:: generateGeometry(tile, tileBorder, belGeoms, padding) 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 :param tile: The tile object containing the switch matrix definition :type tile: Tile :param tileBorder: The border type of the tile within the fabric :type tileBorder: Border :param belGeoms: List of BEL geometries within the same tile :type belGeoms: list[BelGeometry] :param padding: The padding space to add around the switch matrix :type padding: int .. py:method:: generatePortsGeometry(padding) 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. :param padding: The padding space to add around ports :type padding: int .. py:method:: preprocessPorts(tileBorder) 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. .. py:method:: saveToCSV(writer) 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. :param writer: The CSV `writer` object to use for output