import random
+""" dut is design under test """
+
@cocotb.test()
def pinmux_basic_test(dut):
"""Test for 5 + 10"""
yield Timer(2)
-
+ #mux selection lines, each input two bit wide
dut.mux_lines_cell0_mux_in = 1
dut.mux_lines_cell1_mux_in = 2
dut.mux_lines_cell2_mux_in = 0
yield Timer(2)
+ #enable input for mux
dut.EN_mux_lines_cell0_mux = 1
dut.EN_mux_lines_cell1_mux = 1
dut.EN_mux_lines_cell2_mux = 1
yield Timer(2)
# GPIO2-out test
+ # GPIO is inout peripheral
dut.peripheral_side_gpioa_a2_out_in = 0
dut.peripheral_side_gpioa_a2_outen_in = 1
yield Timer(2)
- if dut.iocell_side_io2_cell_out != 0:
+ if dut.iocell_side_io2_cell_out != 0: #output of iopad
raise TestFailure(
"gpioa_a2=0/mux=0/out=1 %s iocell_io2 != 0" %
str(dut.iocell_side_io2_cell_out))
yield Timer(2)
- if dut.iocell_side_io0_cell_out != 1:
+ if dut.iocell_side_io0_cell_out != 0:
raise TestFailure(
"uart_tx=1/mux=0/out=1 %s iocell_io0 != 1" %
str(dut.iocell_side_io0_cell_out))