FABulous.fabric_definition.Fabric ================================= .. py:module:: FABulous.fabric_definition.Fabric .. autoapi-nested-parse:: FPGA fabric definition module. This module contains the Fabric class which represents the complete FPGA fabric including tile layout, configuration parameters, and connectivity information. The fabric is the top-level container for all tiles, BELs, and routing resources. Classes ------- .. py:class:: Fabric() Store the configuration of a fabric. All the information is parsed from the CSV file. .. attribute:: tile The tile map of the fabric :type: list[list[Tile]] .. attribute:: name The name of the fabric :type: str .. attribute:: numberOfRows The number of rows of the fabric :type: int .. attribute:: numberOfColumns The number of columns of the fabric :type: int .. attribute:: configBitMode The configuration bit mode of the fabric. Currently supports frame based or ff chain :type: ConfigBitMode .. attribute:: frameBitsPerRow The number of frame bits per row of the fabric :type: int .. attribute:: maxFramesPerCol The maximum number of frames per column of the fabric :type: int .. attribute:: package The extra package used by the fabric. Only useful for VHDL output. :type: str .. attribute:: generateDelayInSwitchMatrix The amount of delay in a switch matrix. :type: int .. attribute:: multiplexerStyle The style of the multiplexer used in the fabric. Currently supports custom or generic :type: MultiplexerStyle .. attribute:: frameSelectWidth The width of the frame select signal. :type: int .. attribute:: rowSelectWidth The width of the row select signal. :type: int .. attribute:: desync_flag The flag indicating desynchronization status, used to manage timing issues within the fabric. :type: int .. attribute:: numberOfBRAMs The number of BRAMs in the fabric. :type: int .. attribute:: superTileEnable Whether the fabric has super tile. :type: bool .. attribute:: tileDic A dictionary of tiles used in the fabric. The key is the name of the tile and the value is the tile. :type: dict[str, Tile] .. attribute:: superTileDic A dictionary of super tiles used in the fabric. The key is the name of the supertile and the value is the supertile. :type: dict[str, SuperTile] .. attribute:: unusedTileDic A dictionary of tiles that are not used in the fabric, but defined in the fabric.csv. The key is the name of the tile and the value is the tile. :type: dict[str, Tile] .. attribute:: unusedSuperTileDic A dictionary of super tiles that are not used in the fabric, but defined in the fabric.csv. The key is the name of the tile and the value is the tile. :type: dict[str, SuperTile] .. attribute:: commonWirePair A list of common wire pairs in the fabric. :type: list[tuple[str, str]] **Methods:** .. py:method:: determine_border_side(x, y) Determine which border side a tile position is on, if any. :param x: X coordinate in the fabric grid :type x: int :param y: Y coordinate in the fabric grid :type y: int :returns: The border side (NORTH, SOUTH, EAST, or WEST) if the position is on a border, None otherwise. If on a corner, returns the vertical side (NORTH or SOUTH) as priority. :rtype: Side | None .. py:method:: find_tile_positions(tile) Find all positions where a tile or supertile appears in the fabric grid. :param tile: The tile or supertile to search for :type tile: Tile | SuperTile :returns: List of (x, y) positions where the tile/supertile appears, or None if not found :rtype: list[tuple[int, int]] | None .. py:method:: getAllUniqueBels() Get all unique BELs from all tiles in the fabric. :returns: A list of all unique BELs across all tiles. :rtype: list[Bel] .. py:method:: getBelsByTileXY(x, y) Get all the Bels of a tile. :param x: The x coordinate of / column the tile. :type x: int :param y: The y coordinate / row of the tile. :type y: int :returns: A list of Bels in the tile. :rtype: list[Bel] :raises ValueError: Tile coordinates are out of range. .. py:method:: getSuperTileByName(name) Get a supertile by its name from the fabric. Searches for the supertile first in the used supertiles dictionary, then in the unused supertiles dictionary if not found. :param name: The name of the supertile to retrieve. :type name: str :returns: The super tile object if found. :rtype: SuperTile :raises KeyError: If the super tile name is not found in either used or unused super tiles. .. py:method:: getTileByName(name) Get a tile by its name from the fabric. Search for the tile first in the used tiles dictionary, then in the unused tiles dictionary then in the supertiles if not found. :param name: The name of the tile to retrieve. :type name: str :returns: The tile or supertile object if found. :rtype: Tile | SuperTile :raises KeyError: If the tile name is not found in either used or unused tiles. .. py:method:: get_tile_row_column_indices(tile_name) Get all row and column indices where a tile type appears. :param tile_name: Name of the tile type to search for :type tile_name: str :returns: (row_indices, column_indices) where the tile type appears :rtype: tuple[set[int], set[int]] .. py:method:: get_unique_tile_types() Get list of unique tile types used in the fabric. :returns: List of unique tile types (one instance per type name) :rtype: list[Tile]