34 lines
634 B
Python
34 lines
634 B
Python
import cocotb
|
|
from cocotb.handle import Immediate
|
|
|
|
|
|
from cocotb.clock import Clock
|
|
from cocotb.triggers import Timer, RisingEdge
|
|
|
|
|
|
import logging
|
|
|
|
import random
|
|
|
|
|
|
logger = logging.getLogger()
|
|
|
|
logger.setLevel(logging.INFO)
|
|
|
|
CLK_PERIOD = 5
|
|
|
|
@cocotb.test
|
|
async def test_sanity(dut):
|
|
# Request a read from the cache, then request a write to the cache
|
|
cocotb.start_soon(Clock(dut.i_clk, CLK_PERIOD, unit="ns").start())
|
|
|
|
dut.i_cpu_we.value = 0
|
|
|
|
dut.i_rst.value = Immediate(1)
|
|
for _ in range(10):
|
|
await RisingEdge(dut.i_clk)
|
|
dut.i_rst.value = 0
|
|
|
|
await RisingEdge(dut.o_cpu_rdy)
|
|
|
|
await Timer(10, "us") |