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¶
|
A data structure representing a stair-like collection of wires. |
|
Store information on where wires arrive at the border of a tile. |
|
A data structure representing the geometry of a wire within a tile. |
Module Contents¶
StairWires¶
- StairWires(name) :module:
A data structure representing a stair-like collection of wires.
- param name:
The name of the stair wire structure
- type name:
str
- ivar name:
Name of the structure
- vartype name:
str
- ivar refX:
Reference point x coord of the stair structure
- vartype refX:
int
- ivar refY:
Reference point y coord of the stair structure
- vartype refY:
int
- ivar offset:
Offset of the wires
- vartype offset:
int
- ivar direction:
Direction of the wires
- vartype direction:
Direction
- ivar groupWires:
Amount of wires of a single “strand”
- vartype groupWires:
int
- ivar tileWidth:
Width of the tile containing the wires
- vartype tileWidth:
int
- ivar tileHeight:
Height of the tile containing the wires
- vartype tileHeight:
int
- ivar wireGeoms:
List of the wires geometries
- vartype wireGeoms:
list[WireGeometry]
Notes
The (refX, refY) point refers to the following location(s) of the stair-like structure:
@ @ @ @@ @@ @@@ @ @ @@ @@ @@@ @ @ @@ @@ @@@ @ @ @@ @@ @@@ @ @ @@ @@ @@@ @ @@@@@@@@ @@@@@@@@ @@ @@@ @ @@ @ @@ @@@ @@@@@@@. @@ @ @@@@@@@@ @@@ @. @@ @ @@ @@–> @@@@@@.@ @. @@ @ @. .@@@@@@@@ <– (refX, refY).@ @. @@ @ @. .@.@ @. @@ @ @. .@.@ @. @@ @ @. .@.@ @. @@ @ @. .@.@ @@ @@ @ @. .@
Depending on the orientation of the structure, rotate right by 90° to get the image for the corresponding left-right stair-like 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).
- generateEastStairWires :module:
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.
- generateGeometryrefX, refY, offset, direction, groupWires, tileWidth, tileHeight :module:
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.
- param refX:
Reference X coordinate for the stair structure
- type refX:
int
- param refY:
Reference Y coordinate for the stair structure
- type refY:
int
- param offset:
Wire offset distance
- type offset:
int
- param direction:
Direction of the wire routing (NORTH, SOUTH, EAST, or WEST)
- type direction:
Direction
- param groupWires:
Number of wires in each group or strand
- type groupWires:
int
- param tileWidth:
Width of the containing tile
- type tileWidth:
int
- param tileHeight:
Height of the containing tile
- type tileHeight:
int
- raises InvalidPortType:
If the direction is invalid for stair wires.
- generateNorthStairWires :module:
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.
- generateSouthStairWires :module:
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.
- generateWestStairWires :module:
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.
- saveToCSVwriter :module:
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.
- param writer:
The CSV writer object to use for output
- type writer:
csvWriter
WireConstraints¶
- WireConstraints :module:
Store information on where wires arrive at the border of a tile.
- ivar northPositions:
Positions where wires arrive at the north border
- vartype northPositions:
list[int]
- ivar southPositions:
Positions where wires arrive at the south border
- vartype southPositions:
list[int]
- ivar eastPositions:
Positions where wires arrive at the east border
- vartype eastPositions:
list[int]
- ivar westPositions:
Positions where wires arrive at the west border
- vartype westPositions:
list[int]
- addConstraintsOfstairWires :module:
Add constraints from a stair wires structure.
- param stairWires:
The stair wires structure to extract constraints from
- type stairWires:
StairWires
WireGeometry¶
- WireGeometry(name) :module:
A data structure representing the geometry of a wire within a tile.
- ivar name:
Name of the wire
- vartype name:
str
- ivar path:
Path of the wire
- vartype path:
list[Location]
- param name:
Name of the wire
- type name:
str
- addPathLocpathLoc :module:
Add a location point to the wire path.
- param pathLoc:
The location point to add to the wire path
- type pathLoc:
Location
- saveToCSVwriter :module:
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.
- param writer:
The CSV writer object to use for output
- type writer:
csvWriter