The way the input data has to be prepared can be solved on a case-to-case basis.
For TestBench, TestRunner i suggest the interfaces below.
Note that the Directory protocol is extended here to return the absolute path, such that the TestBenchRunner can set this as a working directory for the external call to the simulation tool.
class Directory(Protocol):
@property
def absolute_path(self) -> str: ...
def make_subdirectory(self) -> "Directory": ...
class TestBenchRunner(Protocol):
def prepare(self):
"""create directories and save design files based on `workdir`"""
pass
def run(self):
"""run the simulation and capture results"""
pass
def getReportedContent(self) -> list[str]:
"""Return the content that was captured during simulation.
This omits information that is generated by the simulation tool,
ie., this only returns a list of lines as passed to the `report`
operation in vhdl.
"""
pass
def getFullReport(self) -> list[dict]:
"""Returns a dictionary representing the distinct values parsed from the captured
simulation output. E.g., for ghdl this would include `"time"`, `"source"`,
`"line"`, etc.
"""
pass
def getRawReport(self) -> list[str]:
"""Returns the verbatim report line by line as returned by the simulation tool"""
pass
related to: #316 work on this already started on: #315
To help us automate tests that compare hw simulation results to software module results, I propose an approach as follows:
The way the input data has to be prepared can be solved on a case-to-case basis. For
TestBench
,TestRunner
i suggest the interfaces below. Note that theDirectory
protocol is extended here to return the absolute path, such that theTestBenchRunner
can set this as a working directory for the external call to the simulation tool.