| |||
| Home > RVISS Reference > Memory model interface > armul_ReadCycles | |||
The read_cycles entry in the ARMul_MemInterface structure
is a pointer to an armul_ReadCycles() function.
This function must calculate the total cycle count since the simulation
model reset.
You must implement this function, even if the implementation is very simple. You define the function name yourself.
const ARMul_Cycles *armul_ReadCycles(void *handle)
where:
handleis the value of interf->handle set
in MemInit.
RVISS calls this function each time RealView Debugger reads
the counters. It must calculate the total cycle count and returns
a pointer to the ARMul_Cycles structure
that contains the cycle counts. The ARMul_Cycles structure
is defined in armul_mem.h.
A model can keep count of the accesses made to it by RVISS
by providing this function. The value of the CoreCycles field
in ARMul_Cycles is provided by RVISS, not
by the memory model. When you write this function, you must calculate
the Total field, because this is the value returned
when ARMul_Time() is called. See Event scheduling functions for a description
of ARMul_Time().