b_asic.utility_operations¶

B-ASIC Utility Operations Module.
Contains some operations that are not really operations, but needed for other reasons.
- class b_asic.utility_operations.ComplexToReal(in0: SignalSourceProvider | None = None, name: str = '')¶
Bases:
AbstractOperationSplit a complex signal into its real and imaginary parts.
Output 0 is the real part and output 1 is the imaginary part. Both outputs are real signals. Used at complex SFG interfaces by
complex_to_real()withsplit_io=False.- Parameters:
- in0
SignalSourceProvider, optional Complex input signal.
- name
Name, optional Operation name.
- in0
- evaluate(a, data_type=None) tuple[int | float | complex | DTypeLike | APyFixed | APyCFixed | APyFloat | APyCFloat, int | float | complex | DTypeLike | APyFixed | APyCFixed | APyFloat | APyCFloat]¶
Evaluate the operation and generate a list of output values.
- Parameters:
- *inputs
List of input values.
- data_type
DataType, optional Data type to use for quantization during evaluation.
- class b_asic.utility_operations.DontCare(name: str = '')¶
Bases:
AbstractOperationDont-care operation.
Used for ignoring the input to another operation and thus avoiding dangling input nodes.
- Parameters:
- name
Name, optional Operation name.
- name
- evaluate(data_type=None) float¶
Evaluate the operation and generate a list of output values.
- Parameters:
- *inputs
List of input values.
- data_type
DataType, optional Data type to use for quantization during evaluation.
- get_input_coordinates() tuple[tuple[float, float], ...]¶
Return coordinates for inputs.
These maps to the polygons and are corresponding to a start time of 0 and height 1.
See also
- get_output_coordinates() tuple[tuple[float, float], ...]¶
Return coordinates for outputs.
These maps to the polygons and are corresponding to a start time of 0 and height 1.
See also
- get_plot_coordinates() tuple[tuple[tuple[float, float], ...], tuple[tuple[float, float], ...]]¶
Return coordinates for the latency and execution time polygons.
This returns a tuple containing coordinates for the two polygons outlining the latency and execution time of the operation. The polygons are corresponding to a start time of 0 and are of height 1.
- is_linear = True¶
- class b_asic.utility_operations.RealToComplex(in0: SignalSourceProvider | None = None, in1: SignalSourceProvider | None = None, name: str = '')¶
Bases:
AbstractOperationJoin real and imaginary signals into a complex signal.
Both inputs must be real. Input 0 supplies the real part and input 1 the imaginary part. Used at complex SFG interfaces by
complex_to_real()withsplit_io=False.- Parameters:
- in0, in1
SignalSourceProvider, optional Real and imaginary input signals, respectively.
- name
Name, optional Operation name.
- in0, in1
- class b_asic.utility_operations.Sink(in0: SignalSourceProvider | str | None = None, name: str = '')¶
Bases:
AbstractOperationSink operation.
Used for ignoring the output from another operation to avoid dangling output nodes.
- Parameters:
- in0SignalSourceProvider, optional
Source of the unused output. A string is accepted as a positional name for compatibility with earlier versions.
- name
Name, optional Operation name.
- evaluate() None¶
Evaluate the operation and generate a list of output values.
- Parameters:
- *inputs
List of input values.
- data_type
DataType, optional Data type to use for quantization during evaluation.
- get_input_coordinates() tuple[tuple[float, float], ...]¶
Return coordinates for inputs.
These maps to the polygons and are corresponding to a start time of 0 and height 1.
See also
- get_output_coordinates() tuple[tuple[float, float], ...]¶
Return coordinates for outputs.
These maps to the polygons and are corresponding to a start time of 0 and height 1.
See also
- get_plot_coordinates() tuple[tuple[tuple[float, float], ...], tuple[tuple[float, float], ...]]¶
Return coordinates for the latency and execution time polygons.
This returns a tuple containing coordinates for the two polygons outlining the latency and execution time of the operation. The polygons are corresponding to a start time of 0 and are of height 1.
- is_linear = True¶