elasticai.creator.vhdl.ghdl_simulation#

Module Contents#

Classes#

GHDLSimulator

Run a simulation tool for a given top_design and save whatever is written to stdout for subsequent inspection.

API#

exception elasticai.creator.vhdl.ghdl_simulation.SimulationError[source]#

Bases: Exception

class elasticai.creator.vhdl.ghdl_simulation.GHDLSimulator(workdir, top_design_name)[source]#

Run a simulation tool for a given top_design and save whatever is written to stdout for subsequent inspection.

This runner uses the GHDL tool. The parsed content has the following keys: `(“source”, “line”, “column”, “time”, “type”, “content”)’

Will raise a SimulationError in case any of the calls to ghdl in the steps initialize or run fails. Args: workdir: typically the path to your build root, this is where we will look for vhd files

Initialization

add_generic(**kwargs)[source]#
initialize()[source]#

Call this function once before calling run() and on every file change.

run()[source]#

Runs the simulation and saves whatever the tool wrote to stdout. You’re supposed to call initialize once, before calling run.

getReportedContent() list[str][source]#

Strips any information that the simulation tool added automatically to the output to return only the information that was printed to stdout via VHDL/Verilog statements.

getFullReport() list[dict][source]#

Parses the output from the simulation tool, to provide a more structured representation. The exact content depends on the simulation tool.

getRawResult() str[source]#

Returns the raw stdout output as written by the simulation tool.