FABulous.geometry_generator.wire_geometry#

Wire geometry classes for FABulous FPGA routing structures.

This module provides classes for representing wire geometries within FPGA tiles, including simple wires and complex stair-like wire structures for multi-tile routing. It supports CSV serialization for integration with geometry files.

Classes#

class StairWires(name)[source]#

A data structure representing a stair-like collection of wires.

name[source]#

Name of the structure

Type:

str

refX[source]#

Reference point x coord of the stair structure

Type:

int

refY[source]#

Reference point y coord of the stair structure

Type:

int

offset[source]#

Offset of the wires

Type:

int

direction[source]#

Direction of the wires

Type:

Direction

groupWires[source]#

Amount of wires of a single “strand”

Type:

int

tileWidth[source]#

Width of the tile containing the wires

Type:

int

tileHeight[source]#

Height of the tile containing the wires

Type:

int

wireGeoms[source]#

List of the wires geometries

Type:

List[WireGeometry]

Structure#
---------
The(refX, refY) point refers to the following location(s)#
of the stair-like structure
.. asciiart::
@ @ @ @@ @@ @@
@ @ @ @@ @@ @@
@ @ @ @@ @@ @@
@ @ @ @@ @@ @@
@ @ @ @@ @@ @@
@ @ @@@@@@@@ @@@@@@@@ @@ @@
@ @ @@ @ @@ @@
@ @@@@@@@. @@ @ @@@@@@@@ @@
@ @. @@ @ @@ @@
–> @@@@@@.@ @. @@ @ @. .@@@@@@@@ <– (refX, refY)
.@ @. @@ @ @. .@
.@ @. @@ @ @. .@
.@ @. @@ @ @. .@
.@ @. @@ @ @. .@
.@ @@ @@ @ @. .@

Depending on the orientation of the structure. Rotate right by 90° to get the image for the corresponding left-right stair-ike wire structure. The right stair-like structure represents a north stair, the left one represents a south stair (These being the directions of the wires).

Initialize a StairWires instance.

Parameters:

name (str) – The name of the stair wire structure

Methods:

generateEastStairWires()[source]#

Generate stair-like wires for east direction routing.

Creates a series of L-shaped wire segments that form a stair-like pattern for routing connections eastward across multiple tiles. Each wire starts at the right edge, goes to a stair step, then continues to the left edge.

Return type:

None

generateGeometry(refX, refY, offset, direction, groupWires, tileWidth, tileHeight)[source]#

Generate the stair wire geometry based on parameters and direction.

Creates the complete stair-like wire structure by calling the appropriate directional generation method based on the specified direction.

Parameters:
  • refX (int) – Reference X coordinate for the stair structure

  • refY (int) – Reference Y coordinate for the stair structure

  • offset (int) – Wire offset distance

  • direction (Direction) – Direction of the wire routing (NORTH, SOUTH, EAST, or WEST)

  • groupWires (int) – Number of wires in each group or strand

  • tileWidth (int) – Width of the containing tile

  • tileHeight (int) – Height of the containing tile

Return type:

None

generateNorthStairWires()[source]#

Generate stair-like wires for north direction routing.

Creates a series of L-shaped wire segments that form a stair-like pattern for routing connections northward across multiple tiles. Each wire starts at the bottom edge, goes to a stair step, then continues to the top edge.

Return type:

None

generateSouthStairWires()[source]#

Generate stair-like wires for south direction routing.

Creates a series of L-shaped wire segments that form a stair-like pattern for routing connections southward across multiple tiles. Each wire starts at the bottom edge, goes to a stair step, then continues to the top edge.

Return type:

None

generateWestStairWires()[source]#

Generate stair-like wires for west direction routing.

Creates a series of L-shaped wire segments that form a stair-like pattern for routing connections westward across multiple tiles. Each wire starts at the right edge, goes to a stair step, then continues to the left edge.

Return type:

None

saveToCSV(writer)[source]#

Save all stair wire geometries to CSV format.

Writes all individual wire geometries in the stair structure to a CSV file using the provided writer.

Parameters:

writer (object) – The CSV writer object to use for output

Return type:

None

class WireGeometry(name)[source]#

A data structure representing the geometry of a wire within a tile.

Parameters:

name (str)

name[source]#

Name of the wire

Type:

str

path[source]#

Path of the wire

Type:

List[Location]

Initialize a `WireGeometry` instance.

Methods:

addPathLoc(pathLoc)[source]#

Add a location point to the wire path.

Parameters:

pathLoc (Location) – The location point to add to the wire path

Return type:

None

saveToCSV(writer)[source]#

Save wire geometry data to CSV format.

Writes the wire name and all path points with their coordinates to a CSV file using the provided writer.

Parameters:

writer (object) – The CSV writer object to use for output

Return type:

None