FABulous.FABulous_API#
FABulous API module for fabric and geometry generation.
This module provides the main API class for managing FPGA fabric generation, including parsing fabric definitions, generating HDL code, creating geometries, and handling various fabric-related operations.
Classes#
- class FABulous_API(writer, fabricCSV='')[source]#
Class for managing fabric and geometry generation.
This class parses fabric data from ‘fabric.csv’, generates fabric layouts, geometries, models for nextpnr, as well as other fabric-related functions.
- Parameters:
writer (FABulous.fabric_generator.code_generator.CodeGenerator)
fabricCSV (str)
- Initialise FABulous object.
- If 'fabricCSV' is provided, parses fabric data and initialises
- 'fabricGenerator' and 'geometryGenerator' with parsed data.
- If using VHDL, changes the extension from '.v' to'.vhdl'.
Methods:
- addList2Matrix(listFile, matrix)[source]#
Convert list into CSV matrix and save it.
Using ‘list2CSV’ defined in ‘fabric_gen.py’.
- bootstrapSwitchMatrix(tileName, outputDir)[source]#
Bootstrap the switch matrix for the specified tile.
Using ‘bootstrapSwitchMatrix’ defined in ‘fabric_gen.py’.
- genBitStreamSpec()[source]#
Generate the bitstream specification object.
- Returns:
Bitstream specification object generated by ‘fabricGenerator’.
- Return type:
Object
- genFabric()[source]#
Generate the entire fabric layout.
Via ‘generatreFabric’ defined in ‘fabric_gen.py’.
- Return type:
None
- genFabricIOBels()[source]#
Generate the IO BELs for the generative IOs of the fabric.
- Return type:
None
- genGeometry(geomPadding=8)[source]#
Generate geometry based on the fabric data and save it to CSV.
- Parameters:
geomPadding (int, optional) – Padding value for geometry generation, by default 8.
- Return type:
None
- genIOBelForTile(tile_name)[source]#
Generate the IO BELs for the generative IOs of a tile.
Config Access Generative IOs will be a separate Bel. Updates the tileDic with the generated IO BELs.
- Parameters:
tile_name (str) – Name of the tile to generate IO Bels.
- Returns:
bels – The bel object representing the generative IOs.
- Return type:
List[Bel]
- Raises:
ValueError – If tile not found in fabric. In case of an invalid IO type for generative IOs. If the number of config access ports does not match the number of config bits.
- genRoutingModel()[source]#
Generate model for Nextpnr based on fabric data.
- Returns:
Model generated by ‘model_gen_npnr.genNextpnrModel’.
- Return type:
Object
- genSuperTile(tileName)[source]#
Generate a super tile based on its name.
Using ‘generateSuperTile’ defined in ‘fabric_gen.py’.
- Parameters:
tileName (str) – Name of the super tile generated.
- Return type:
None
- genSwitchMatrix(tileName)[source]#
Generate switch matrix for specified tile.
Using ‘genTileSwitchMatrix’ defined in ‘fabric_gen.py’.
- Parameters:
tileName (str) – Name of the tile for which the switch matrix will be generated.
- Return type:
None
- genTile(tileName)[source]#
Generate a tile based on its name.
Using ‘generateTile’ defined in ‘fabric_gen.py’.
- Parameters:
tileName (str) – Name of the tile generated.
- Return type:
None
- genTopWrapper()[source]#
Generate the top wrapper for the fabric.
Using ‘generateTopWrapper’ defined in ‘fabric_gen.py’.
- Return type:
None
- generateUserDesignTopWrapper(userDesign, topWrapper)[source]#
Generate the top wrapper for the user design.
- Parameters:
userDesign (Path) – Path to the user design file.
topWrapper (Path) – Path to the output top wrapper file.
- Return type:
None
- getBels()[source]#
Return all unique Bels within a fabric.
- Returns:
Bel object based on bel name.
- Return type:
- getSuperTiles()[source]#
Return all SuperTiles within a fabric.
- Returns:
SuperTile object based on tile name.
- Return type:
- getTiles()[source]#
Return all Tiles within a fabric.
- Returns:
Tile object based on tile name.
- Return type:
- loadFabric(fabric_dir)[source]#
Load fabric data from ‘fabric.csv’.
- Parameters:
- Raises:
ValueError – If ‘dir’ does not end with ‘.csv’
- Return type:
None