FABulous.geometry_generator.port_geometry#

Port geometry definitions.

Classes#

class PortGeometry[source]#

A data structure representing the geometry of a Port.

name[source]#

Name of the port

Type:

str

sourceName[source]#

Name of the port source

Type:

str

destName[source]#

Name of the port destination

Type:

str

type[source]#

Type of the port

Type:

PortType

ioDirection[source]#

IO direction of the port

Type:

IO

sideOfTile[source]#

Side of the tile the ports wire is on

Type:

Side

offset[source]#

Offset to the connected port

Type:

int

wireDirection[source]#

Direction of the ports wire

Type:

Direction

groupId[source]#

Id of the port group

Type:

int

groupWires[source]#

Amount of wires of the port group

Type:

int

relX[source]#

X coordinate of the port, relative to its parent (bel, switch matrix)

Type:

int

relY[source]#

Y coordinate of the port, relative to its parent (bel, switch matrix)

Type:

int

Initialize a PortGeometry instance.
Sets all attributes to default values
Type:

None for names and directions,

zero for numeric values, and appropriate defaults for enumerated types.

Methods:

generateGeometry(name, sourceName, destName, portType, ioDirection, relX, relY)[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

Return type:

None

saveToCSV(writer)[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 writer object to use for output

Return type:

None

class PortType(*args, **kwds)[source]#

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: