CIRCT
19.0.0git
|
#include <Engine.h>
Public Member Functions | |
Engine (llvm::raw_ostream &out, ModuleOp module, llvm::function_ref< mlir::LogicalResult(mlir::ModuleOp)> mlirTransformer, llvm::function_ref< llvm::Error(llvm::Module *)> llvmTransformer, std::string root, TraceMode tm, ArrayRef< StringRef > sharedLibPaths) | |
Initialize an LLHD simulation engine. More... | |
~Engine () | |
Default destructor. More... | |
int | simulate (int n, uint64_t maxTime) |
Run simulation up to n steps or maxTime picoseconds of simulation time. More... | |
void | buildLayout (ModuleOp module) |
Build the instance layout of the design. More... | |
const ModuleOp | getModule () const |
Get the MLIR module. More... | |
const State * | getState () const |
Get the simulation state. More... | |
void | dumpStateLayout () |
Dump the instance layout stored in the State. More... | |
void | dumpStateSignalTriggers () |
Dump the instances each signal triggers. More... | |
Private Member Functions | |
void | walkEntity (EntityOp entity, Instance &child) |
Private Attributes | |
llvm::raw_ostream & | out |
std::string | root |
std::unique_ptr< State > | state |
std::unique_ptr< mlir::ExecutionEngine > | engine |
ModuleOp | module |
TraceMode | traceMode |
Engine::Engine | ( | llvm::raw_ostream & | out, |
ModuleOp | module, | ||
llvm::function_ref< mlir::LogicalResult(mlir::ModuleOp)> | mlirTransformer, | ||
llvm::function_ref< llvm::Error(llvm::Module *)> | llvmTransformer, | ||
std::string | root, | ||
TraceMode | tm, | ||
ArrayRef< StringRef > | sharedLibPaths | ||
) |
Initialize an LLHD simulation engine.
This initializes the state, as well as the mlir::ExecutionEngine with the given module.
Definition at line 23 of file Engine.cpp.
References assert(), buildLayout(), engine, module, root, and state.
|
default |
Default destructor.
void Engine::buildLayout | ( | ModuleOp | module | ) |
Build the instance layout of the design.
Definition at line 217 of file Engine.cpp.
References assert(), circt::llhd::sim::Instance::isEntity, module, circt::llhd::sim::Instance::path, root, state, circt::llhd::sim::Instance::unit, and walkEntity().
Referenced by Engine().
void Engine::dumpStateLayout | ( | ) |
Dump the instance layout stored in the State.
Definition at line 63 of file Engine.cpp.
References state.
void Engine::dumpStateSignalTriggers | ( | ) |
Dump the instances each signal triggers.
Definition at line 65 of file Engine.cpp.
References state.
|
inline |
|
inline |
int Engine::simulate | ( | int | n, |
uint64_t | maxTime | ||
) |
Run simulation up to n steps or maxTime picoseconds of simulation time.
n=0 and T=0 make the simulation run indefinitely.
Definition at line 67 of file Engine.cpp.
References circt::llhd::sim::Trace::addChange(), assert(), engine, circt::llhd::sim::Trace::flush(), circt::llhd::sim::None, out, state, and traceMode.
|
private |
Definition at line 245 of file Engine.cpp.
References assert(), circt::llhd::sim::Instance::isEntity, circt::llhd::sim::Instance::name, circt::llhd::sim::Instance::nArgs, circt::llhd::sim::Instance::path, circt::llhd::sim::Instance::sensitivityList, state, and circt::llhd::sim::Instance::unit.
Referenced by buildLayout().
|
private |
Definition at line 73 of file Engine.h.
Referenced by Engine(), and simulate().
|
private |
Definition at line 74 of file Engine.h.
Referenced by buildLayout(), hw.InstanceBuilder::create_default_value(), Engine(), getModule(), om.Evaluator::instantiate(), hw.InstanceBuilder::operand_names(), and hw.InstanceBuilder::result_names().
|
private |
Definition at line 70 of file Engine.h.
Referenced by simulate().
|
private |
Definition at line 71 of file Engine.h.
Referenced by buildLayout(), and Engine().
|
private |
Definition at line 72 of file Engine.h.
Referenced by buildLayout(), dumpStateLayout(), dumpStateSignalTriggers(), Engine(), getState(), simulate(), and walkEntity().
|
private |
Definition at line 75 of file Engine.h.
Referenced by simulate().