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¶
- class StairWires(name)[source]¶
A data structure representing a stair-like collection of wires.
- Parameters:
name (str) – The name of the stair wire structure
- Variables:
name (str) – Name of the structure
refX (int) – Reference point x coord of the stair structure
refY (int) – Reference point y coord of the stair structure
offset (int) – Offset of the wires
direction (Direction) – Direction of the wires
groupWires (int) – Amount of wires of a single “strand”
tileWidth (int) – Width of the tile containing the wires
tileHeight (int) – Height of the tile containing the wires
wireGeoms (list[WireGeometry]) – List of the wires geometries
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).
Methods¶
- generateEastStairWires() None[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.
- generateGeometry(refX, refY, offset, direction, groupWires, tileWidth, tileHeight) None[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
- Raises:
InvalidPortType – If the direction is invalid for stair wires.
- generateNorthStairWires() None[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.
- generateSouthStairWires() None[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.
- generateWestStairWires() None[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.
WireConstraints¶
- class WireConstraints[source]¶
Store information on where wires arrive at the border of a tile.
- Variables:
northPositions (list[int]) – Positions where wires arrive at the north border
southPositions (list[int]) – Positions where wires arrive at the south border
eastPositions (list[int]) – Positions where wires arrive at the east border
westPositions (list[int]) – Positions where wires arrive at the west border
Methods¶
- addConstraintsOf(stairWires) None[source]¶
Add constraints from a stair wires structure.
- Parameters:
stairWires (StairWires) – The stair wires structure to extract constraints from
WireGeometry¶
- class WireGeometry(name)[source]¶
A data structure representing the geometry of a wire within a tile.
- Variables:
- Parameters:
name (str) – Name of the wire
Methods¶