FABulous.fabric_generator.gen_fabric.gen_switchmatrix¶
Switch matrix generation module for FABulous FPGA tiles.
This module generates RTL code for configurable switch matrices within FPGA tiles. Switch matrices handle the routing of signals between tile ports, BEL inputs/outputs, and jump wires. The module supports various configuration modes and multiplexer styles.
Key features: - CSV and list file parsing for switch matrix configurations - Support for custom and generic multiplexer implementations - Configuration bit calculation and management - Debug signal generation for switch matrix analysis - Multiple configuration modes (FlipFlop chain, Frame-based)
Classes¶
Functions¶
- genTileSwitchMatrix(writer, fabric, tile, switch_matrix_debug_signal)[source]¶
- Parameters:
writer (CodeGenerator)
fabric (Fabric)
tile (Tile)
switch_matrix_debug_signal (bool)
- Return type:
None
Generate the RTL code for the tile switch matrix.
The switch matrix generated will be based on the matrixDir attribute of the tile. If the given file format is .csv, it will be parsed as a switch matrix .csv file. If the given file format is .list, the tool will convert the .list file into a switch matrix with specific ordering first before progressing. If the given file format is Verilog or VHDL, then the function will not generate anything.
- param writer:
The code generator instance for RTL output
- type writer:
CodeGenerator
- param fabric:
The fabric object containing global configuration
- type fabric:
Fabric
- param tile:
The tile object containing BELs and port information
- type tile:
Tile
- param switch_matrix_debug_signal:
Whether to generate debug signals for the switch matrix.
- type switch_matrix_debug_signal:
bool
- raises InvalidFileType:
If matrixDir does not contain a valid file format.
- raises ValueError:
If any port in the switch matrix is not connected to anything.