0

I am using Cocotb to verify an RTL design. I have problem calling the multi() function in Python, see the code and the error I get below.....

Code:

@cocotb.test()
async def test(dut)
    for i in range(10):
        #something 
        for j i in range(10):
            #something
  
#------------------  
        
 output = multi()
 print(output)
 
 @cocotb.test()
 async def multi =(a=4 , b=7)
    await asyncio.sleep(0.1)
    result = a*b
    await RisingEdge(dut.clk_i)
    print("result",result)
    dut.value_a.value = a
    dut.value_b.value = b
    await RisingEdge(dut.clk_i)
    print("Dut : ",int(dut.final_value.value))

Error:

loop = events.get_running_loop()
                                                     RuntimeError: no running event loop

I tried to run the compile to get the multiplication result, but I get an error as the one you saw above.....

Neom5
  • 11
  • 2

1 Answers1

1

You have an obvious typo multi =( - remove the =.

Also, you most likely don't want to use asyncio.sleep but instead instruct the simulator to wait for a while using e.g. https://docs.cocotb.org/en/stable/triggers.html?highlight=timer#cocotb.triggers.Timer

cmarqu
  • 493
  • 3
  • 10