MicroGPU 1.0
Simple functional model of a GPU for educational purposes
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Thread Class Reference

Represents a GPU threadThe Thread class encapsulates the state and behavior of a GPU thread, including its ID, execution state, and register file. Each thread can be active or inactive, and it has a set of registers that can be read from and written to during instruction execution. More...

#include <thread.hh>

Collaboration diagram for Thread:
Collaboration graph

Public Member Functions

 Thread ()
 
 Thread (int threadId, ThreadState threadState)
 
int getId () const
 
ThreadState getState () const
 
int getRegisterValue (int index) const
 
void setId (int threadId)
 
void setState (ThreadState threadState)
 
void setRegisters (const RegisterFile &regs)
 
void setRegisterValue (int index, int value)
 

Private Attributes

int id
 
ThreadState state
 
RegisterFile registers
 

Detailed Description

Represents a GPU thread

The Thread class encapsulates the state and behavior of a GPU thread, including its ID, execution state, and register file. Each thread can be active or inactive, and it has a set of registers that can be read from and written to during instruction execution.

Constructor & Destructor Documentation

◆ Thread() [1/2]

Thread::Thread ( )

◆ Thread() [2/2]

Thread::Thread ( int  threadId,
ThreadState  threadState 
)

Member Function Documentation

◆ getId()

int Thread::getId ( ) const

◆ getRegisterValue()

int Thread::getRegisterValue ( int  index) const

◆ getState()

ThreadState Thread::getState ( ) const

◆ setId()

void Thread::setId ( int  threadId)

◆ setRegisters()

void Thread::setRegisters ( const RegisterFile regs)

◆ setRegisterValue()

void Thread::setRegisterValue ( int  index,
int  value 
)

◆ setState()

void Thread::setState ( ThreadState  threadState)

Member Data Documentation

◆ id

int Thread::id
private

◆ registers

RegisterFile Thread::registers
private

◆ state

ThreadState Thread::state
private

The documentation for this class was generated from the following files: