CIRCT 22.0.0git
Loading...
Searching...
No Matches
Macros | Functions
ArcRuntime.h File Reference
#include "circt/Dialect/Arc/Runtime/Common.h"
#include <assert.h>
Include dependency graph for ArcRuntime.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARC_RUNTIME_EXPORT   extern "C"
 

Functions

ARC_RUNTIME_EXPORT struct ArcStatearcRuntimeAllocateInstance (const struct ArcRuntimeModelInfo *model, const char *args)
 Allocate and initialize the state for a new instance of the given hardware model.
 
ARC_RUNTIME_EXPORT void arcRuntimeDeleteInstance (struct ArcState *instance)
 Destroy and deallocate the state of a model instance.
 
ARC_RUNTIME_EXPORT void arcRuntimeOnEval (struct ArcState *instance)
 Pre-Eval hook. Must be called by the driver once before every eval step.
 
ARC_RUNTIME_EXPORT uint64_t arcRuntimeGetAPIVersion ()
 Return the API version of the runtime library.
 
ARC_RUNTIME_EXPORT struct ArcStatearcRuntimeGetStateFromModelState (uint8_t *modelState, uint64_t offset)
 Project a pointer to the model state to its ArcState container.
 

Macro Definition Documentation

◆ ARC_RUNTIME_EXPORT

#define ARC_RUNTIME_EXPORT   extern "C"

Definition at line 35 of file ArcRuntime.h.

Function Documentation

◆ arcRuntimeAllocateInstance()

ARC_RUNTIME_EXPORT struct ArcState * arcRuntimeAllocateInstance ( const struct ArcRuntimeModelInfo model,
const char *  args 
)

Allocate and initialize the state for a new instance of the given hardware model.

After the end of simulation, the state must be deallocated by calling arcRuntimeDeleteInstance.

args is a zero terminated string containing implementation specific runtime options or null.

◆ arcRuntimeDeleteInstance()

ARC_RUNTIME_EXPORT void arcRuntimeDeleteInstance ( struct 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().

◆ arcRuntimeGetAPIVersion()

ARC_RUNTIME_EXPORT uint64_t arcRuntimeGetAPIVersion ( )

Return the API version of the runtime library.

Definition at line 67 of file ArcRuntime.cpp.

References ARC_RUNTIME_API_VERSION.

◆ arcRuntimeGetStateFromModelState()

ARC_RUNTIME_EXPORT struct 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().

◆ arcRuntimeOnEval()

ARC_RUNTIME_EXPORT void arcRuntimeOnEval ( struct 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().