13 #ifndef CIRCT_DIALECT_LLHD_SIMULATOR_ENGINE_H
14 #define CIRCT_DIALECT_LLHD_SIMULATOR_ENGINE_H
20 #include "mlir/IR/BuiltinOps.h"
23 class ExecutionEngine;
41 llvm::function_ref<mlir::LogicalResult(mlir::ModuleOp)> mlirTransformer,
42 llvm::function_ref<llvm::Error(llvm::Module *)> llvmTransformer,
43 std::string
root,
TraceMode tm, ArrayRef<StringRef> sharedLibPaths);
50 int simulate(
int n, uint64_t maxTime);
70 llvm::raw_ostream &
out;
73 std::unique_ptr<mlir::ExecutionEngine>
engine;
void dumpStateLayout()
Dump the instance layout stored in the State.
void walkEntity(EntityOp entity, Instance &child)
const State * getState() const
Get the simulation state.
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.
const ModuleOp getModule() const
Get the MLIR module.
~Engine()
Default destructor.
void buildLayout(ModuleOp module)
Build the instance layout of the design.
std::unique_ptr< mlir::ExecutionEngine > engine
std::unique_ptr< State > state
int simulate(int n, uint64_t maxTime)
Run simulation up to n steps or maxTime picoseconds of simulation time.
void dumpStateSignalTriggers()
Dump the instances each signal triggers.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
The simulator internal representation of an instance.