I'm developing a I2S decoder in Verilog and I want to test it with
real I2S signals captured with my logic analyzer from my Raspberry Pi.
To do this, I want to simulate the verilog code in python using
cocotb: https://cocotb.readthedocs.io/en/latest/introduction.html and
use recorded signals in .sr file to drive the simulation. I found
pysigrok, but there is no instruction on how to use it, there is only
API documentation:
https://sigrok.org/api/libsigrok/unstable/bindings/python/index.html
and I don't know where to start because it doesn't give me any example
codes

I'm expecting the code will look like this:

import pysigrok
import cocotb
from cocotb.triggers import Timer

@cocotb.test()
def my_first_test(dut):
"""Try accessing the design."""

dut._log.info("Running test!")

with pysigrok.read("i2s.sr") as file:
    for sample in file.samples:
    dut.clk = 0
    yield Timer(1)
    dut.clk = 1
    dut.sd = sample.sd
    dut.ws = sample.ws
    dut.sck = sample.sck
    yield Timer(1)
    dut._log.info("Running test!")

If this works, I also want to try to compare decoded I2S data from my
verilog module and sigrok decoder, then maybe if its possible I want
to drive the simulation from the logic analyzer live


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to