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

Go to the source code of this file.

Namespaces

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 
namespace  circt::arc
 
namespace  circt::arc::runtime
 

Macros

#define ARC_IR_EXPORT   extern "C" __attribute__((visibility("default")))
 

Functions

ARC_IR_EXPORT uint8_t * arcRuntimeIR_allocInstance (const ArcRuntimeModelInfo *model, const char *args)
 Allocate and initialize the state for a new instance of the given hardware model.
 
ARC_IR_EXPORT void arcRuntimeIR_deleteInstance (uint8_t *modelState)
 Destroy and deallocate the state of a model instance.
 
ARC_IR_EXPORT void arcRuntimeIR_onEval (uint8_t *modelState)
 Pre-Eval hook of the runtime library.
 
ARC_IR_EXPORT void arcRuntimeIR_format (const circt::arc::runtime::FmtDescriptor *fmt,...)
 Prints a formatted string to stdout.
 
ARC_IR_EXPORT uint64_t * arcRuntimeIR_swapTraceBuffer (const uint8_t *modelState)
 Release the active trace buffer and request an empty new buffer.
 

Macro Definition Documentation

◆ ARC_IR_EXPORT

#define ARC_IR_EXPORT   extern "C" __attribute__((visibility("default")))

Definition at line 31 of file IRInterface.h.

Function Documentation

◆ arcRuntimeIR_allocInstance()

ARC_IR_EXPORT 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 92 of file ArcRuntime.cpp.

References arcRuntimeAllocateInstance(), and ArcState::modelState.

◆ arcRuntimeIR_deleteInstance()

ARC_IR_EXPORT 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 106 of file ArcRuntime.cpp.

References arcRuntimeDeleteInstance(), and arcRuntimeGetStateFromModelState().

◆ arcRuntimeIR_format()

ARC_IR_EXPORT void arcRuntimeIR_format ( const circt::arc::runtime::FmtDescriptor fmt,
  ... 
)

◆ arcRuntimeIR_onEval()

ARC_IR_EXPORT 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 98 of file ArcRuntime.cpp.

References arcRuntimeGetStateFromModelState(), and arcRuntimeOnEval().

◆ arcRuntimeIR_swapTraceBuffer()

ARC_IR_EXPORT uint64_t * arcRuntimeIR_swapTraceBuffer ( const uint8_t *  modelState)

Release the active trace buffer and request an empty new buffer.

Invoked by the model to signal that the currently active trace buffer, referenced by modelState->traceBuffer is ready for processing and contains modelState->traceBufferSize valid uint64_t words.

The runtime must return a pointer to a valid storage of at least traceBufferCapacity x uint64_t size, which will become the new active trace buffer.

Definition at line 195 of file ArcRuntime.cpp.

References ARC_RUNTIME_MAGIC, and getModelInstance().