GPUOcelot
|
A class implementing a multi-threaded variably sized call stack for the emulator device. More...
#include <EmulatorCallStack.h>
Public Member Functions | |
EmulatorCallStack (unsigned int threads=0, unsigned int initialArgumentSize=0, unsigned int initialFrameSize=0, unsigned int registers=0, unsigned int localSize=0, unsigned int globalLocalSize=0, unsigned int sharedSize=0) | |
Create a new call stack for a set number of threads. | |
void * | stackBase () |
Get a pointer to the base of the stack. | |
unsigned int | totalStackSize () const |
Get the total size of the stack. | |
void * | stackFramePointer (unsigned int thread) |
Get a pointer to the base of the current stack frame. | |
void * | previousStackFramePointer (unsigned int thread) |
Get a pointer to the stack frame at the saved offset. | |
void * | savedStackFramePointer (unsigned int thread) |
Get a pointer to the stack frame at the saved offset. | |
void * | callerFramePointer (unsigned int thread) |
Get a pointer to the previous stack frame. | |
unsigned int | offset () const |
Get the offset of the current stack frame, save it. | |
void | saveFrame () |
Save the offset of the current stack frame. | |
RegisterType * | registerFilePointer (unsigned int thread) |
Get a pointer to the register file for a given thread. | |
const RegisterType * | registerFilePointer (unsigned int thread) const |
Get a pointer to the register file for a given thread. | |
void * | localMemoryPointer (unsigned int thread) |
Get a pointer to local memory for a given thread. | |
void * | sharedMemoryPointer () |
Get a pointer to shared memory. | |
void * | globalLocalMemoryPointer (unsigned int thread) |
Get a pointer to global local memory. | |
unsigned int | registerCount () const |
Get the current register file size. | |
unsigned int | localMemorySize () const |
Get the current size of local memory. | |
unsigned int | sharedMemorySize () const |
Get the shared memory size. | |
unsigned int | globalLocalMemorySize () const |
Get the global local memory size. | |
unsigned int | stackFrameSize () const |
Get the size of the current frame. | |
unsigned int | previousFrameSize () const |
Get the size of the previous frame. | |
unsigned int | returnPC () const |
Get the return program counter. | |
unsigned int | callerOffset () const |
Get the offset of the caller frame. | |
unsigned int | callerFrameSize () const |
Get the offset of the caller frame. | |
bool | isTheCurrentFrameMain () const |
Is the only frame on the stack the entry point? | |
void | pushFrame (unsigned int stackSize, unsigned int registers, unsigned int localSize, unsigned int sharedSize, unsigned int callPC, unsigned int callerStackFrame, unsigned int callerStackSize) |
Push a new frame onto the stack. | |
void | popFrame () |
Pop the current frame. |
A class implementing a multi-threaded variably sized call stack for the emulator device.
executive::EmulatorCallStack::EmulatorCallStack | ( | unsigned int | threads = 0 , |
unsigned int | initialArgumentSize = 0 , |
||
unsigned int | initialFrameSize = 0 , |
||
unsigned int | registers = 0 , |
||
unsigned int | localSize = 0 , |
||
unsigned int | globalLocalSize = 0 , |
||
unsigned int | sharedSize = 0 |
||
) |
Create a new call stack for a set number of threads.
void * executive::EmulatorCallStack::callerFramePointer | ( | unsigned int | thread | ) |
Get a pointer to the previous stack frame.
unsigned int executive::EmulatorCallStack::callerFrameSize | ( | ) | const |
Get the offset of the caller frame.
unsigned int executive::EmulatorCallStack::callerOffset | ( | ) | const |
Get the offset of the caller frame.
void * executive::EmulatorCallStack::globalLocalMemoryPointer | ( | unsigned int | thread | ) |
Get a pointer to global local memory.
unsigned int executive::EmulatorCallStack::globalLocalMemorySize | ( | ) | const |
Get the global local memory size.
bool executive::EmulatorCallStack::isTheCurrentFrameMain | ( | ) | const |
Is the only frame on the stack the entry point?
void * executive::EmulatorCallStack::localMemoryPointer | ( | unsigned int | thread | ) |
Get a pointer to local memory for a given thread.
unsigned int executive::EmulatorCallStack::localMemorySize | ( | ) | const |
Get the current size of local memory.
unsigned int executive::EmulatorCallStack::offset | ( | ) | const |
Get the offset of the current stack frame, save it.
void executive::EmulatorCallStack::popFrame | ( | ) |
Pop the current frame.
unsigned int executive::EmulatorCallStack::previousFrameSize | ( | ) | const |
Get the size of the previous frame.
void * executive::EmulatorCallStack::previousStackFramePointer | ( | unsigned int | thread | ) |
Get a pointer to the stack frame at the saved offset.
void executive::EmulatorCallStack::pushFrame | ( | unsigned int | stackSize, |
unsigned int | registers, | ||
unsigned int | localSize, | ||
unsigned int | sharedSize, | ||
unsigned int | callPC, | ||
unsigned int | callerStackFrame, | ||
unsigned int | callerStackSize | ||
) |
Push a new frame onto the stack.
unsigned int executive::EmulatorCallStack::registerCount | ( | ) | const |
Get the current register file size.
EmulatorCallStack::RegisterType * executive::EmulatorCallStack::registerFilePointer | ( | unsigned int | thread | ) |
Get a pointer to the register file for a given thread.
const EmulatorCallStack::RegisterType * executive::EmulatorCallStack::registerFilePointer | ( | unsigned int | thread | ) | const |
Get a pointer to the register file for a given thread.
unsigned int executive::EmulatorCallStack::returnPC | ( | ) | const |
Get the return program counter.
void * executive::EmulatorCallStack::savedStackFramePointer | ( | unsigned int | thread | ) |
Get a pointer to the stack frame at the saved offset.
void executive::EmulatorCallStack::saveFrame | ( | ) |
Save the offset of the current stack frame.
void * executive::EmulatorCallStack::sharedMemoryPointer | ( | ) |
Get a pointer to shared memory.
unsigned int executive::EmulatorCallStack::sharedMemorySize | ( | ) | const |
Get the shared memory size.
void * executive::EmulatorCallStack::stackBase | ( | ) |
Get a pointer to the base of the stack.
void * executive::EmulatorCallStack::stackFramePointer | ( | unsigned int | thread | ) |
Get a pointer to the base of the current stack frame.
unsigned int executive::EmulatorCallStack::stackFrameSize | ( | ) | const |
Get the size of the current frame.
unsigned int executive::EmulatorCallStack::totalStackSize | ( | ) | const |
Get the total size of the stack.