|
CIRCT 23.0.0git
|
#include <ModelInstance.h>

Public Member Functions | |
| ModelInstance ()=delete | |
| ModelInstance (const ArcRuntimeModelInfo *modelInfo, const char *args, ArcState *state) | |
| ~ModelInstance () | |
| const char * | getModelName () const |
| void | onInitialized (ArcState *mutableState) |
| void | onEval (ArcState *mutableState) |
| uint64_t * | swapTraceBuffer () |
Private Types | |
| enum class | TraceMode { DUMMY , VCD , FST } |
Private Member Functions | |
| void | parseArgs (const char *args) |
| Parse and initialize the instance settings from the given argument string. | |
| std::filesystem::path | getTraceFilePath (const std::string &suffix) |
| Get the path to the output trace file. | |
Private Attributes | |
| const uint64_t | instanceID |
| const ArcRuntimeModelInfo *const | modelInfo |
| const ArcState *const | state |
| std::map< std::string, std::optional< std::string > > | arguments |
| std::filesystem::path | workDir |
| The path to the instance's working directory. | |
| TraceMode | traceMode |
| std::unique_ptr< TraceEncoder > | traceEncoder |
| bool | verbose = false |
| uint64_t | stepCounter = 0 |
Static Private Attributes | |
| static const std::string | kArgKeyDebug = "debug" |
| Enable verbose debug output. | |
| static const std::string | kArgKeyFst = "fst" |
| Select FST trace mode. | |
| static const std::string | kArgKeyTraceFile = "traceFile" |
| Workdir-relative or absolute path to trace file. | |
| static const std::string | kArgKeyVcd = "vcd" |
| Select VCD trace mode. | |
| static const std::string | kArgKeyWorkDir = "workDir" |
| Instance's working directory. Absolute or relative to process workdir. | |
Definition at line 34 of file ModelInstance.h.
|
strongprivate |
| Enumerator | |
|---|---|
| DUMMY | |
| VCD | |
| FST | |
Definition at line 78 of file ModelInstance.h.
|
delete |
| circt::arc::runtime::impl::ModelInstance::ModelInstance | ( | const ArcRuntimeModelInfo * | modelInfo, |
| const char * | args, | ||
| ArcState * | state | ||
| ) |
Definition at line 35 of file ModelInstance.cpp.
References DUMMY, FST, getModelName(), getTraceFilePath(), instanceID, modelInfo, parseArgs(), traceEncoder, ArcRuntimeModelInfo::traceInfo, traceMode, VCD, and verbose.
| circt::arc::runtime::impl::ModelInstance::~ModelInstance | ( | ) |
Definition at line 92 of file ModelInstance.cpp.
References assert(), getModelName(), ArcState::impl, instanceID, state, stepCounter, traceEncoder, and verbose.
|
inline |
Definition at line 41 of file ModelInstance.h.
References modelInfo, and ArcRuntimeModelInfo::modelName.
Referenced by ModelInstance(), and ~ModelInstance().
|
private |
Get the path to the output trace file.
Creates a default file name with the given suffix within the working directory if not explicitly set by the runtime arguments.
Definition at line 106 of file ModelInstance.cpp.
References arguments, instanceID, kArgKeyTraceFile, modelInfo, ArcRuntimeModelInfo::modelName, and workDir.
Referenced by ModelInstance().
| void circt::arc::runtime::impl::ModelInstance::onEval | ( | ArcState * | mutableState | ) |
Definition at line 124 of file ModelInstance.cpp.
References assert(), state, stepCounter, and traceEncoder.
| void circt::arc::runtime::impl::ModelInstance::onInitialized | ( | ArcState * | mutableState | ) |
Definition at line 131 of file ModelInstance.cpp.
References assert(), instanceID, state, traceEncoder, and verbose.
|
private |
Parse and initialize the instance settings from the given argument string.
Definition at line 281 of file ModelInstance.cpp.
References arguments, FST, instanceID, kArgKeyDebug, kArgKeyFst, kArgKeyVcd, kArgKeyWorkDir, circt::arc::runtime::impl::parseArgsToMap(), traceMode, VCD, verbose, and workDir.
Referenced by ModelInstance().
| uint64_t * circt::arc::runtime::impl::ModelInstance::swapTraceBuffer | ( | ) |
Definition at line 143 of file ModelInstance.cpp.
References circt::arc::runtime::impl::fatalError(), instanceID, state, ArcState::traceBufferSize, traceEncoder, and verbose.
|
private |
Definition at line 72 of file ModelInstance.h.
Referenced by getTraceFilePath(), and parseArgs().
|
private |
Definition at line 69 of file ModelInstance.h.
Referenced by getTraceFilePath(), ModelInstance(), onInitialized(), parseArgs(), swapTraceBuffer(), and ~ModelInstance().
|
inlinestaticprivate |
Enable verbose debug output.
Definition at line 52 of file ModelInstance.h.
Referenced by parseArgs().
|
inlinestaticprivate |
|
inlinestaticprivate |
Workdir-relative or absolute path to trace file.
Definition at line 56 of file ModelInstance.h.
Referenced by getTraceFilePath().
|
inlinestaticprivate |
|
inlinestaticprivate |
Instance's working directory. Absolute or relative to process workdir.
Definition at line 60 of file ModelInstance.h.
Referenced by parseArgs().
|
private |
Definition at line 70 of file ModelInstance.h.
Referenced by getModelName(), getTraceFilePath(), and ModelInstance().
|
private |
Definition at line 71 of file ModelInstance.h.
Referenced by onEval(), onInitialized(), swapTraceBuffer(), and ~ModelInstance().
|
private |
Definition at line 82 of file ModelInstance.h.
Referenced by onEval(), and ~ModelInstance().
|
private |
Definition at line 80 of file ModelInstance.h.
Referenced by ModelInstance(), onEval(), onInitialized(), swapTraceBuffer(), and ~ModelInstance().
|
private |
Definition at line 79 of file ModelInstance.h.
Referenced by ModelInstance(), and parseArgs().
|
private |
Definition at line 81 of file ModelInstance.h.
Referenced by ModelInstance(), onInitialized(), parseArgs(), swapTraceBuffer(), and ~ModelInstance().
|
private |
The path to the instance's working directory.
Matches the process working directory if not provided by a runtime argument.
Definition at line 75 of file ModelInstance.h.
Referenced by getTraceFilePath(), and parseArgs().