Convert the mixed-language example to use async/await
@@ -4,9 +4,9 @@ from cocotb.result import TestFailure
@cocotb.test()
-def mixed_language_test(dut):
+async def mixed_language_test(dut):
"""Try accessing handles and setting values in a mixed language environment."""
- yield Timer(100, units='ns')
+ await Timer(100, units='ns')
verilog = dut.i_swapper_sv
dut._log.info("Got: %s" % repr(verilog._name))
@@ -15,10 +15,10 @@ def mixed_language_test(dut):
dut._log.info("Got: %s" % repr(vhdl._name))
verilog.reset_n <= 1
- yield Timer(100, units='ns')
+ await Timer(100, units='ns')
vhdl.reset_n <= 1
- yield Timer(100, units='ns')
+ await Timer(100, units='ns')
if int(verilog.reset_n) == int(vhdl.reset_n):
dut._log.info("Both signals read as %d" % int(vhdl.reset_n))
