Bench: Permutation#
This module contains the documentation for the Permutation model and testbench.
Permutation Model#
permutation_model.py#
Library for the PermutationModel class.
It contains the Python model used to verify the Permutation module.
@author: Timothée Charrier
- class permutation_model.PermutationModel[source]#
Model for the Permutation module.
This class defines the model used to verify the Permutation module.
Methods
assert_output
(dut, inputs)Assert the output of the DUT and log the input and output values.
permutation
(i_round, i_state)Compute the output state based on the current input state.
rotate_right
(value, num_bits)Rotate the bits of a 64-bit integer to the right.
- assert_output(dut: HierarchyObject, inputs: dict[str, any]) None [source]#
Assert the output of the DUT and log the input and output values.
- Parameters:
dut (HierarchyObject) – The device under test (DUT).
inputs (dict, optional) – The input dictionary.
Test Permutation#
test_permutation.py#
Testbench for the permutation module.
This module tests the permutation module by comparing the output of the Python implementation with the verilog implementation.
@author: Timothée Charrier
- async test_permutation.permutation_test(dut: HierarchyObject) None [source]#
Test the DUT’s behavior during normal computation.
Verifies that the output is correctly computed.
- Parameters:
dut (HierarchyObject) – The device under test (DUT).
- Raises:
RuntimeError – If the DUT fails to compute the correct output.