Files
2023-04-11 02:25:33 -04:00

29 lines
795 B
Python

'''
Wokwi TinyTapeout truth-table based auto test sequence.
SPDX-FileCopyrightText: © 2023 Pat Deegan, https://psychogenic.com
SPDX-License-Identifier: Apache2.0
'''
import os
import cocotb
import testutils.truthtable as truthtable
@cocotb.test()
async def truthTableCompare(parentDUT):
'''
truthTableCompare -- loads markdown truth table and, if load succeeded, actually performs the tests.
'''
usermodule = parentDUT.dut
i_bus = parentDUT.io_in
o_bus = parentDUT.io_out
tt = truthtable.loadMarkdownTruthTable('truthtable.md', usermodule._log)
if tt is None:
usermodule._log.info('No truth table loaded, no table compare test to run')
return
usermodule._log.debug(str(tt))
await tt.testAll(i_bus, o_bus, usermodule._log)