switch_matrix

Switch matrix construct for the FABulous fabric model.

A tile’s switch matrix is the programmable interconnect: which sources may drive each destination inside the tile. The connectivity is declared in the tile’s matrix file (a .csv adjacency matrix or a .list of pairs) and parsed by :mod:fabulous.fabric_generator.parser.parse_switchmatrix. This light dataclass gives that switch matrix a first-class home in the fabric model so callers work with a SwitchMatrix object instead of re-deriving the file dispatch and parsing at every site.

Classes

SwitchMatrix

A tile's switch matrix: its programmable interconnect connectivity.

Module Contents

SwitchMatrix

class SwitchMatrix[source]

A tile’s switch matrix: its programmable interconnect connectivity.

Variables:
  • name (str) – Tile name. Must match the top-left header cell of a .csv matrix.

  • matrix_dir (Path) – Path to the matrix file, either a .csv adjacency matrix or a .list of connection pairs.

  • config_bits (int) – Number of configuration bits the switch matrix occupies, by default 0.

Methods

pips() list[tuple[str, str]][source]

Return the switch-matrix connection pairs as (source, sink) tuples.

Both file formats are normalized to the same list of pairs, in the order the file declares them.

Returns:

One (source, sink) tuple per programmable connection.

Raises:

InvalidFileType – If the matrix file is neither a .csv nor a .list file.