FABulous.geometry_generator.port_geometry ========================================= .. py:module:: FABulous.geometry_generator.port_geometry .. autoapi-nested-parse:: Port geometry definitions. Classes ------- .. py:class:: PortGeometry() A data structure representing the geometry of a Port. .. attribute:: name Name of the port :type: str .. attribute:: sourceName Name of the port source :type: str .. attribute:: destName Name of the port destination :type: str .. attribute:: type Type of the port :type: PortType .. attribute:: ioDirection IO direction of the port :type: IO .. attribute:: sideOfTile Side of the tile the ports wire is on :type: Side .. attribute:: offset Offset to the connected port :type: int .. attribute:: wireDirection Direction of the ports wire :type: Direction .. attribute:: groupId Id of the port group :type: int .. attribute:: groupWires Amount of wires of the port group :type: int .. attribute:: relX X coordinate of the port, relative to its parent (bel, switch matrix) :type: int .. attribute:: relY Y coordinate of the port, relative to its parent (bel, switch matrix) :type: int .. attribute:: Initialize a PortGeometry instance. .. attribute:: Sets all attributes to default values :type: None for names and directions, .. attribute:: zero for numeric values, and appropriate defaults for enumerated types. **Methods:** .. py:method:: generateGeometry(name, sourceName, destName, portType, ioDirection, relX, relY) Generate the geometry for a port. Sets the basic geometric and connection properties of the port, including its name, source/destination connections, type, I/O direction, and relative position within its parent component. :param name: Name of the port :type name: str :param sourceName: Name of the port source :type sourceName: str :param destName: Name of the port destination :type destName: str :param portType: Type of the port (SWITCH_MATRIX, JUMP, or BEL) :type portType: PortType :param ioDirection: I/O direction of the port (INPUT, OUTPUT, or INOUT) :type ioDirection: IO :param relX: X coordinate relative to the parent component :type relX: int :param relY: Y coordinate relative to the parent component :type relY: int .. py:method:: saveToCSV(writer) Save port geometry data to CSV format. Writes the port geometry information including type, name, source/destination connections, I/O direction, and relative position to a CSV file using the provided writer. :param writer: The CSV `writer` object to use for output .. py:class:: PortType(*args, **kwds) **Bases:** Enumeration for different types of ports in the fabric geometry. Defines the various categories of ports that can exist within the fabric: - SWITCH_MATRIX: Ports connected to switch matrices - JUMP: Jump ports for long-distance connections - BEL: Ports connected to Basic Elements of Logic **Methods:**