FABulous.fabric_definition.Fabric
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
-
class Fabric[source]
Store the configuration of a fabric.
All the information is parsed from the CSV file.
-
tile[source]
The tile map of the fabric
- Type:
list[list[Tile]]
-
name[source]
The name of the fabric
- Type:
str
-
numberOfRows[source]
The number of rows of the fabric
- Type:
int
-
numberOfColumns[source]
The number of columns of the fabric
- Type:
int
-
configBitMode[source]
The configuration bit mode of the fabric.
Currently supports frame based or ff chain
- Type:
ConfigBitMode
-
frameBitsPerRow[source]
The number of frame bits per row of the fabric
- Type:
int
-
maxFramesPerCol[source]
The maximum number of frames per column of the fabric
- Type:
int
-
package[source]
The extra package used by the fabric. Only useful for VHDL output.
- Type:
str
-
generateDelayInSwitchMatrix[source]
The amount of delay in a switch matrix.
- Type:
int
-
multiplexerStyle[source]
The style of the multiplexer used in the fabric.
Currently supports custom or generic
- Type:
MultiplexerStyle
-
frameSelectWidth[source]
The width of the frame select signal.
- Type:
int
-
rowSelectWidth[source]
The width of the row select signal.
- Type:
int
-
desync_flag[source]
The flag indicating desynchronization status,
used to manage timing issues within the fabric.
- Type:
int
-
numberOfBRAMs[source]
The number of BRAMs in the fabric.
- Type:
int
-
superTileEnable[source]
Whether the fabric has super tile.
- Type:
bool
-
tileDic[source]
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]
-
superTileDic[source]
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]
-
unusedTileDic[source]
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]
-
unusedSuperTileDic[source]
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]
-
commonWirePair[source]
A list of common wire pairs in the fabric.
- Type:
list[tuple[str, str]]
Methods:
-
determine_border_side(x, y)[source]
Determine which border side a tile position is on, if any.
- Parameters:
-
- 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.
- Return type:
Side | None
-
find_tile_positions(tile)[source]
Find all positions where a tile or supertile appears in the fabric grid.
- Parameters:
tile (Tile | SuperTile) – The tile or supertile to search for
- Returns:
List of (x, y) positions where the tile/supertile appears,
or None if not found
- Return type:
list[tuple[int, int]] | None
-
getAllUniqueBels()[source]
Get all unique BELs from all tiles in the fabric.
- Returns:
A list of all unique BELs across all tiles.
- Return type:
list[Bel]
-
getBelsByTileXY(x, y)[source]
Get all the Bels of a tile.
- Parameters:
-
- Returns:
A list of Bels in the tile.
- Return type:
list[Bel]
- Raises:
ValueError – Tile coordinates are out of range.
-
getSuperTileByName(name)[source]
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.
- Parameters:
name (str) – The name of the supertile to retrieve.
- Returns:
The super tile object if found.
- Return type:
SuperTile
- Raises:
KeyError – If the super tile name is not found in either used or unused super tiles.
-
getTileByName(name)[source]
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.
- Parameters:
name (str) – The name of the tile to retrieve.
- Returns:
The tile or supertile object if found.
- Return type:
Tile | SuperTile
- Raises:
KeyError – If the tile name is not found in either used or unused tiles.
-
get_tile_row_column_indices(tile_name)[source]
Get all row and column indices where a tile type appears.
- Parameters:
tile_name (str) – Name of the tile type to search for
- Returns:
(row_indices, column_indices) where the tile type appears
- Return type:
tuple[set[int], set[int]]
-
get_unique_tile_types()[source]
Get list of unique tile types used in the fabric.
- Returns:
List of unique tile types (one instance per type name)
- Return type:
list[Tile]