fabric.py¶
- class fabric_generator.fabric.Bel(src: str, prefix: str, internal, external, configPort, sharedPort, configBit: int, belMap: Dict[str, dict], userCLK: bool)¶
Contains all the information about a single BEL. The information is parsed from the directory of the BEL in the CSV definition file. There are something to be noted.
The parsed name will contains the prefix of the bel.
The sharedPort attribute is a list of Tuples with name of the port and IO information which is not expanded out yet.
If a port is marked as both shared and external, the port is considered as shared. As a result signal like UserCLK will be in shared port list, but not in external port list.
- class fabric_generator.fabric.ConfigBitMode(value)¶
An enumeration.
- class fabric_generator.fabric.ConfigMem(frameName: str, frameIndex: int, bitsUsedInFrame: int, usedBitMask: str, configBitRanges: List[int] = <factory>)¶
Data structure to store the information about a config memory. Each structure represent a row of entry in the config memory csv file.
- class fabric_generator.fabric.Direction(value)¶
An enumeration.
- class fabric_generator.fabric.Fabric(tile: List[List[fabric_generator.fabric.Tile]] = <factory>, name: str = 'eFPGA', numberOfRows: int = 15, numberOfColumns: int = 15, configBitMode: fabric_generator.fabric.ConfigBitMode = ConfigBitMode.FRAME_BASED, frameBitsPerRow: int = 32, maxFramesPerCol: int = 20, package: str = 'use work.my_package.all', generateDelayInSwitchMatrix: int = 80, multiplexerStyle: fabric_generator.fabric.MultiplexerStyle = MultiplexerStyle.CUSTOM, frameSelectWidth: int = 5, rowSelectWidth: int = 5, desync_flag: int = 20, numberOfBRAMs: int = 10, superTileEnable: bool = True, tileDic: Dict[str, fabric_generator.fabric.Tile] = <factory>, superTileDic: Dict[str, fabric_generator.fabric.SuperTile] = <factory>, commonWirePair: List[Tuple[str, str]] = <factory>)¶
This class is for storing the information and hyper parameter of the fabric. All the information is parsed from the CSV file.
- configMitMode¶
The configuration bit mode of the fabric. Currently support frame based or ff chain
- Type
- multiplexerStyle¶
The style of the multiplexer used in the fabric. Currently support custom or generic
- Type
- tileDic¶
A dictionary of tiles used in the fabric. The key is the name of the tile and the value is the tile.
- superTileDic¶
A dictionary of super tiles used in the fabric. The key is the name of the super tile and the value is the super tile.
- class fabric_generator.fabric.IO(value)¶
An enumeration.
- class fabric_generator.fabric.MultiplexerStyle(value)¶
An enumeration.
- class fabric_generator.fabric.Port(wireDirection: fabric_generator.fabric.Direction, sourceName: str, xOffset: int, yOffset: int, destinationName: str, wireCount: int, name: str, inOut: fabric_generator.fabric.IO, sideOfTile: fabric_generator.fabric.Side)¶
The port data class contains all the port information from the CSV file. The name, inOut and sideOfTile are added attributes to aid the generation of the fabric. The name and inOut are related. If the inOut is “INPUT” then the name is the source name of the port on the tile. Otherwise the name is the destination name of the port on the tile. The sideOfTile is where the port physically located on the tile, since for a north direction wire, the input will be physical located on the south side of the tile. The sideOfTile will make determine where the port is located much easier.
- expandPortInfo(mode='SwitchMatrix') Tuple[List[str], List[str]] ¶
Expanding the port information to individual bit signal. If indexed is in the mode, then brackets are added to the signal name.
- Parameters
mode (str, optional) – mode for expansion. Defaults to “SwitchMatrix”. Possible modes are ‘all’, ‘allIndexed’, ‘Top’, ‘TopIndexed’, ‘AutoTop’, ‘AutoTopIndexed’, ‘SwitchMatrix’, ‘SwitchMatrixIndexed’, ‘AutoSwitchMatrix’, ‘AutoSwitchMatrixIndexed’
- Returns
A tuple of two lists. The first list contains the source names of the ports and the second list contains the destination names of the ports.
- Return type
- class fabric_generator.fabric.Side(value)¶
An enumeration.
- class fabric_generator.fabric.SuperTile(name: str, tiles: List[fabric_generator.fabric.Tile], tileMap: List[List[fabric_generator.fabric.Tile]], bels: List[fabric_generator.fabric.Bel] = <factory>, withUserCLK: bool = False)¶
This class is for storing the information about a super tile.
- getInternalConnections() List[Tuple[List[fabric_generator.fabric.Port], int, int]] ¶
Return all the internal connections of the super tile.
- getPortsAroundTile() Dict[str, List[List[fabric_generator.fabric.Port]]] ¶
Return all the ports that are around the super tile. The dictionary key is the location of where the tile located in the super tile map with the format of “X{x}Y{y}” where x is the x coordinate of the tile and y is the y coordinate of the tile. The top left tile will have key “00”.
- class fabric_generator.fabric.Tile(name: str, ports: List[fabric_generator.fabric.Port], bels: List[fabric_generator.fabric.Bel], matrixDir: str, userCLK: bool, configBit: int = 0)¶
This class is for storing the information about a tile.
- class fabric_generator.fabric.Wire(direction: fabric_generator.fabric.Direction, source: str, xOffset: int, yOffset: int, destination: str, sourceTile: str, destinationTile: str)¶
This class is for wire connection that span across multiple tiles. If working for connection between two adjacent tiles, the Port class should have all the required information. The main use of this class is to assist model generation, where information at individual wire level is needed.