cocotb_wrapper.testbench.Testbench#

class cocotb_wrapper.testbench.Testbench(name, clk=None, rst=None, reset_active_level=1)[source]#

A cocotb testbench.

Parameters:
  • name (str) –

  • clk (str | None) –

  • rst (str | None) –

  • reset_active_level (int) –

__init__(name, clk=None, rst=None, reset_active_level=1)[source]#

Initialize an instance.

Parameters:
  • name (str) – The name of the device under test

  • clk (str | None) – The clock signal of the device under test

  • rst (str | None) – The reset signal of the device under test

  • reset_active_level (int) – 1 if the reset is active high, else active low

Methods

register_setup()

Make the decorated function the setup function.

register_teardown()

Make the decorated function the teardown function.

register_test([timeout_time, timeout_unit, ...])

Decorate a function to register the function as a test.

reset(dut, time, units)

Reset the DUT.

start_clk(dut, period, units)

Start the clock.

Attributes

name

Get the name of the device under test.