port_geometryΒΆ
Port geometry definitions.
ClassesΒΆ
A data structure representing the geometry of a Port. |
|
Enumeration for different types of ports in the fabric geometry. |
Module ContentsΒΆ
PortGeometryΒΆ
- class PortGeometry[source]ΒΆ
A data structure representing the geometry of a Port.
Sets all attributes to default values: None for names and directions, zero for numeric values, and appropriate defaults for enumerated types.
- Variables:
name (str | None, optional) β Name of the port
sourceName (str | None, optional) β Name of the port source
destName (str | None, optional) β Name of the port destination
type (PortType | None, optional) β Type of the port
ioDirection (IO) β IO direction of the port.
sideOfTile (Side) β Side of the tile the portβs wire is on.
offset (int) β Offset to the connected port.
wireDirection (Direction | None, optional) β Direction of the ports wire
groupId (int) β ID of the port group.
groupWires (int) β Number of wires in the port group.
relX (int) β X coordinate of the port, relative to its parent (bel, switch matrix).
relY (int) β Y coordinate of the port, relative to its parent (bel, switch matrix).
nextId (int) β ID of the next port in the group.
MethodsΒΆ
- generateGeometry(name, sourceName, destName, portType, ioDirection, relX, relY) None[source]ΒΆ
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.
- Parameters:
name (str) β Name of the port
sourceName (str) β Name of the port source
destName (str) β Name of the port destination
portType (PortType) β Type of the port (SWITCH_MATRIX, JUMP, or BEL)
ioDirection (IO) β I/O direction of the port (INPUT, OUTPUT, or INOUT)
relX (int) β X coordinate relative to the parent component
relY (int) β Y coordinate relative to the parent component
- saveToCSV(writer) None[source]ΒΆ
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.
- Parameters:
writer (object) β The CSV
writerobject to use for output
PortTypeΒΆ
- class PortType(*args, **kwds)[source]ΒΆ
Bases:
EnumEnumeration 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