piel.integration.amaranth_cocotb#

Functions#

create_cocotb_truth_table_verification_python_script(...)

Creates a cocotb test script for verifying logic defined by the truth table.

Module Contents#

create_cocotb_truth_table_verification_python_script(module: piel.types.PathTypes, truth_table: piel.types.digital.TruthTable, test_python_module_name: str = 'top_test')[source]#

Creates a cocotb test script for verifying logic defined by the truth table.

Parameters:
  • module (PathTypes) – The path to the module where the test script will be placed.

  • truth_table (TruthTable) – A dictionary representing the truth table.

  • test_python_module_name (str, optional) – The name of the test python module. Defaults to “top_test”.

Example

truth_table = {

“A”: [0, 0, 1, 1], “B”: [0, 1, 0, 1], “X”: [0, 1, 1, 0] # Expected output (for XOR logic, as an example)

} create_cocotb_truth_table_verification_python_script(truth_table)