pysv icon indicating copy to clipboard operation
pysv copied to clipboard

pysv for python testcases

Open mpriestleyidex opened this issue 7 months ago • 2 comments

It's a fairly well trodden path to write testcases in C. The simulator calls the C testcase, which in turn interacts with the simulation via various DPI export callbacks. A trivial example is https://www.edaplayground.com/x/4D3t

But of course we'd like to do that in Python, and hide all the C away. pysv looks like it could make this happen, but:

  • How do I make a DPI import a context import?
  • How do I call my DPI exports from python?
    • Does pysv help with that, or is it sufficiently easy to use ctypes or pybind11 directly?
    • Either way, an example in the docs would be very helpful.

FWIW I've already achieved this using CFFI, but there's a lot of boilerplate and it wasn't easy to work out what to do.

mpriestleyidex avatar Jul 20 '24 09:07 mpriestleyidex