|
CIRCT 22.0.0git
|
#include "circt/Dialect/Arc/Runtime/ArcRuntime.h"#include "circt/Dialect/Arc/Runtime/Common.h"#include "circt/Dialect/Arc/Runtime/IRInterface.h"#include "circt/Dialect/Arc/Runtime/ModelInstance.h"#include <cassert>#include <cstdlib>#include <iostream>
Go to the source code of this file.
Macros | |
| #define | ARC_RUNTIME_ENABLE_EXPORT |
Functions | |
| static void | internalError (const char *message) |
| static ModelInstance * | getModelInstance (ArcState *instance) |
| ArcState * | arcRuntimeAllocateInstance (const ArcRuntimeModelInfo *model, const char *args) |
| void | arcRuntimeDeleteInstance (ArcState *instance) |
| Destroy and deallocate the state of a model instance. | |
| uint64_t | arcRuntimeGetAPIVersion () |
| Return the API version of the runtime library. | |
| void | arcRuntimeOnEval (ArcState *instance) |
Pre-Eval hook. Must be called by the driver once before every eval step. | |
| ArcState * | arcRuntimeGetStateFromModelState (uint8_t *modelState, uint64_t offset) |
| Project a pointer to the model state to its ArcState container. | |
| uint8_t * | arcRuntimeIR_allocInstance (const ArcRuntimeModelInfo *model, const char *args) |
| Allocate and initialize the state for a new instance of the given hardware model. | |
| void | arcRuntimeIR_onEval (uint8_t *modelState) |
| Pre-Eval hook of the runtime library. | |
| void | arcRuntimeIR_deleteInstance (uint8_t *modelState) |
| Destroy and deallocate the state of a model instance. | |
| #define ARC_RUNTIME_ENABLE_EXPORT |
Definition at line 14 of file ArcRuntime.cpp.
| ArcState * arcRuntimeAllocateInstance | ( | const ArcRuntimeModelInfo * | model, |
| const char * | args | ||
| ) |
Definition at line 43 of file ArcRuntime.cpp.
References ArcRuntimeModelInfo::apiVersion, ARC_RUNTIME_API_VERSION, ARC_RUNTIME_MAGIC, assert(), internalError(), and ArcRuntimeModelInfo::numStateBytes.
Referenced by arcRuntimeIR_allocInstance().
| void arcRuntimeDeleteInstance | ( | ArcState * | instance | ) |
Destroy and deallocate the state of a model instance.
Definition at line 61 of file ArcRuntime.cpp.
References ArcState::impl.
Referenced by arcRuntimeIR_deleteInstance().
| uint64_t arcRuntimeGetAPIVersion | ( | ) |
Return the API version of the runtime library.
Definition at line 67 of file ArcRuntime.cpp.
References ARC_RUNTIME_API_VERSION.
| ArcState * arcRuntimeGetStateFromModelState | ( | uint8_t * | modelState, |
| uint64_t | offset | ||
| ) |
Project a pointer to the model state to its ArcState container.
offset is the byte offset of the given pointer within the model state.
Definition at line 73 of file ArcRuntime.cpp.
References ARC_RUNTIME_MAGIC, internalError(), and ArcState::magic.
Referenced by arcRuntimeIR_deleteInstance(), and arcRuntimeIR_onEval().
| uint8_t * arcRuntimeIR_allocInstance | ( | const ArcRuntimeModelInfo * | model, |
| const char * | args | ||
| ) |
Allocate and initialize the state for a new instance of the given hardware model.
This function must allocate an ArcState struct with at least model->numStateBytes bytes provided for the modelState array. It must return the pointer to the zero initialized model state which is required to be 16-byte-aligned.
args is a zero terminated string containing implementation specific options for the new instance or null.
Definition at line 86 of file ArcRuntime.cpp.
References arcRuntimeAllocateInstance(), and ArcState::modelState.
| void arcRuntimeIR_deleteInstance | ( | uint8_t * | modelState | ) |
Destroy and deallocate the state of a model instance.
This function is responsible for releasing all resources that previously have been allocated by arcRuntimeIR_allocInstance.
Definition at line 96 of file ArcRuntime.cpp.
References arcRuntimeDeleteInstance(), and arcRuntimeGetStateFromModelState().
| void arcRuntimeIR_onEval | ( | uint8_t * | modelState | ) |
Pre-Eval hook of the runtime library.
Simulation drivers must call this once before every invocation of the model's eval function.
Definition at line 92 of file ArcRuntime.cpp.
References arcRuntimeGetStateFromModelState(), and arcRuntimeOnEval().
| void arcRuntimeOnEval | ( | ArcState * | instance | ) |
Pre-Eval hook. Must be called by the driver once before every eval step.
Definition at line 69 of file ArcRuntime.cpp.
References getModelInstance(), and circt::arc::runtime::ModelInstance::onEval().
Referenced by arcRuntimeIR_onEval().
|
inlinestatic |
Definition at line 38 of file ArcRuntime.cpp.
References assert(), and ArcState::impl.
Referenced by arcRuntimeOnEval().
|
static |
Definition at line 32 of file ArcRuntime.cpp.
References assert().
Referenced by arcRuntimeAllocateInstance(), and arcRuntimeGetStateFromModelState().