fabric_automation¶
Functions for fabric automation, such as generating tile configurations and IOs.
Functions¶
|
Add a list of Bels as blackbox primitives to yosys prims file. |
|
Generate the IO BELs for a list of generative IOs. |
|
Generate a custom tile configuration. |
|
Generate a switch matrix list file for a given tile and its BELs. |
Module Contents¶
- addBelsToPrim(primsFile, bels, support_vectors=False)[source]¶
Add a list of Bels as blackbox primitives to yosys prims file.
- genIOBel(gen_ios, bel_path, overwrite=True, multiplexerStyle=MultiplexerStyle.CUSTOM)[source]¶
Generate the IO BELs for a list of generative IOs.
- Parameters:
gen_ios (list[Gen_IO]) – List of Generative IOs to generate the IO BEL.
bel_path (Path) – Name of the BEL to be generated.
overwrite (bool, optional) – Default is True Overwrite the existing BEL file if it exists, by default True. If False, it will read the existing BEL file and return the Bel object, without generating a new one.
multiplexerStyle (MultiplexerStyle, optional) – Default is MultiplexerStyle.CUSTOM Use generic or custom multiplexers.
- Returns:
The generated Bel object or None if no generative IOs are present.
- Return type:
Bel | None
- Raises:
InvalidFileType – If a wrong bel file suffix is specified.
InvalidPortType – If an invalid IO type is specified for generative IOs.
SpecMissMatch – If the multiplexer style is not supported for generative IOs.
ValueError – If the number of config access ports does not match the number of config bits.
- generateCustomTileConfig(tile_path)[source]¶
Generate a custom tile configuration.
A tile .csv file and a switch matrix .list file will be generated based on the given tile folder or the path to the BEL folder.
The provided path may contain BEL files, which will be included in the generated tile .csv file as well as the generated switch matrix .list file.
- Parameters:
tile_path (Path) – The path to the tile folder. If the path is a file, the parent directory will be used as the tile folder.
- Returns:
Path to the generated tile .csv file.
- Return type:
Path
- Raises:
ValueError – If the tile path is not a valid tile path or if the tile folder does not exist.
- generateSwitchmatrixList(tileName, bels, outFile, carryportsTile, localSharedPortsTile)[source]¶
Generate a switch matrix list file for a given tile and its BELs.
The list file is based on a dummy list file, derived from the LUT4AB switch matrix list file. It is also possible to automatically generate connections for carry chains between the BELs.
- Parameters:
tileName (str) – Name of the tile
bels (list[Bel]) – List of bels in the tile
outFile (Path) – Path to the switchmatrix list file output
carryportsTile (dict[str, dict[IO, str]]) – Dictionary of carry ports for the tile
localSharedPortsTile (dict[str, list[Port]]) – List of local shared ports for the tile, based on JUMP wire definitions
- Raises:
Carry port prefixes in tile config and bels do not match.
Bels have more than 32 Bel inputs.
Bels have more than 8 Bel outputs.
Invalid list formatting in file.
Number of carry ins and carry outs do not match.
- Return type:
None