15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/Support/raw_ostream.h"
27 assert(state &&
"alloc_signal: state not found");
28 std::string sOwner(owner);
45 assert(state &&
"alloc_proc: state not found");
46 std::string sOwner(owner);
51 assert(state &&
"alloc_entity: state not found");
53 (*it).entityState = entityState;
57 uint64_t
width,
int time,
int delta,
int eps) {
58 assert(state &&
"drive_signal: state not found");
60 auto globalIndex =
detail->globalIndex;
61 auto offset =
detail->offset;
64 (
detail->value - state->
signals[globalIndex].getValue()) * 8 + offset;
74 if (time || delta || eps) {
75 Time sTime(time, delta, eps);
assert(baseType &&"element must be base type")
MlirType uint64_t numElements
The simulator's internal representation of time.
void insertOrUpdate(Time time, int index, int bitOffset, uint8_t *bytes, unsigned width)
Check wheter a slot for the given time already exists.
void addSigArrayElements(State *state, unsigned index, unsigned size, unsigned numElements)
Add offset and size information for the elements of an array signal.
void llhdSuspend(State *state, ProcState *procState, int time, int delta, int eps)
Suspend a process.
void driveSignal(State *state, SignalDetail *detail, uint8_t *value, uint64_t width, int time, int delta, int eps)
Drive a value onto a signal.
void addSigStructElement(State *state, unsigned index, unsigned offset, unsigned size)
Add offset and size information for one element of a struct signal.
void allocEntity(State *state, char *owner, uint8_t *entityState)
Add allocated entity state to the given instance.
int allocSignal(State *state, int index, char *owner, uint8_t *value, int64_t size)
Allocate a new signal.
void allocProc(State *state, char *owner, ProcState *procState)
Add allocated constructs to a process instance.
State structure for process persistence across suspension.
Detail structure that can be easily accessed by the lowered code.
void pushQueue(Time time, unsigned inst)
Push a new scheduled wakeup event in the event queue.
llvm::SmallVector< Signal, 0 > signals
void addProcPtr(std::string name, ProcState *procStatePtr)
Add a pointer to the process persistence state to a process instance.
llvm::SmallVectorTemplateCommon< Instance >::iterator getInstanceIterator(std::string instName)
Find an instance in the instances list by name and return an iterator for it.
int addSignalData(int index, std::string owner, uint8_t *value, uint64_t size)
void addSignalElement(unsigned, unsigned, unsigned)