FABulous.geometry_generator.wire_geometry ========================================= .. py:module:: FABulous.geometry_generator.wire_geometry .. autoapi-nested-parse:: 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 ------- .. py:class:: StairWires(name) A data structure representing a stair-like collection of wires. .. attribute:: name Name of the structure :type: str .. attribute:: refX Reference point x coord of the stair structure :type: int .. attribute:: refY Reference point y coord of the stair structure :type: int .. attribute:: offset Offset of the wires :type: int .. attribute:: direction Direction of the wires :type: Direction .. attribute:: groupWires Amount of wires of a single "strand" :type: int .. attribute:: tileWidth Width of the tile containing the wires :type: int .. attribute:: tileHeight Height of the tile containing the wires :type: int .. attribute:: wireGeoms List of the wires geometries :type: List[WireGeometry] .. attribute:: Structure .. attribute:: --------- .. attribute:: The (refX,refY) point refers to the following location(s) .. attribute:: of the stair-like structure .. attribute:: .. 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. :param name: The name of the stair wire structure :type name: str **Methods:** .. py:method:: generateEastStairWires() 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. .. py:method:: generateGeometry(refX, refY, offset, direction, groupWires, tileWidth, tileHeight) 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 .. py:method:: generateNorthStairWires() 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. .. py:method:: generateSouthStairWires() 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. .. py:method:: generateWestStairWires() 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. .. py:method:: saveToCSV(writer) 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 .. py:class:: WireGeometry(name) A data structure representing the geometry of a wire within a tile. .. attribute:: name Name of the wire :type: str .. attribute:: path Path of the wire :type: List[Location] .. attribute:: Initialize a `WireGeometry` instance. .. attribute:: :type: param name: The name of the wire .. attribute:: :type: type name: str **Methods:** .. py:method:: addPathLoc(pathLoc) Add a location point to the wire path. :param pathLoc: The location point to add to the wire path :type pathLoc: Location .. py:method:: saveToCSV(writer) 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