Research functions¶
B-ASIC module for research purposes.
This module contains functions that are used in different research projects. They are typically not general enough to be part of the main library, but are packaged here for convenience, reproducibility, and that they may be useful for someone else as well.
The following module is currently available:
b_asic.research.interleaver
: generate matrix transposers and random interleavers.
research.interleaver module¶
Functions to generate memory-variable test data that are used for research.
- b_asic.research.interleaver.generate_matrix_transposer(rows: int, cols: int | None = None, min_lifetime: int = 0, cyclic: bool = True, parallelism: int = 1) ProcessCollection ¶
Generate a ProcessCollection for a matrix transposer.
The transposer is transposing a matrix of size rows \(\times\) cols. If cols is not provided, a square matrix of size rows \(\times\) rows is used.
- Parameters:
- rowsint
Number of rows in input matrix.
- colsint, optional
Number of columns in input matrix. If not provided assumed to be equal to rows, i.e., a square matrix.
- min_lifetimeint, default: 0
The minimum lifetime for a memory variable. Default is 0 meaning that at least one variable is passed from the input to the output directly.
- cyclicbool, default: True
If the interleaver should operate continuously in a cyclic manner. That is, start a new interleaving operation directly after the previous.
- parallelismint, default: 1
Number of values to input and output every cycle.
- Returns:
- ProcessCollection
- b_asic.research.interleaver.generate_random_interleaver(size: int, min_lifetime: int = 0, cyclic: bool = True, parallelism: int = 1) ProcessCollection ¶
Generate a ProcessCollection for a random interleaver.
- Parameters:
- sizeint
The size of the random interleaver sequence.
- min_lifetimeint, default: 0
The minimum lifetime for a memory variable. Default is 0 meaning that at least one variable is passed from the input to the output directly.
- cyclicbool, default: True
If the interleaver should operate continuously in a cyclic manner. That is, start a new interleaving operation directly after the previous.
- parallelismint, default: 1
Number of values to input and output every cycle.
- Returns:
- ProcessCollection