Class simtix::Thread
Class for thread. More...
#include <thread.h>
Public Functions
Type | Name |
---|---|
void | AdvancePC () Increase program counter. |
void | LowerFunctPriority () Lower function priority of the thread. |
void | LowerPriority () Lower priority of the thread. |
void | RaiseFunctPriority () Raise function priority of the thread. |
void | RaisePriority () Raise priority of the thread. |
int32_t | ReadCSR (uint16_t addr, uint64_t * data) Read thread CSRs. |
void | Reset () Reset pc, priority and regfile to 0. |
void | ResetPC () Reset program counter. |
void | ResetPriority () Reset priority. |
void | SetPriority (uint32_t set_priority) Set priority. |
Thread (Warp * warp, uint32_t tid, const ArchParam & p=kDefaultArchParam) Constructor of Thread . |
|
int32_t | WriteCSR (uint16_t addr, uint64_t data) Write thread CSRs. |
uint32_t | max_function_priority_level () const |
uint32_t | max_priority_level () const |
uint64_t | pc () const |
uint32_t | priority () const |
uint32_t | priority_f () const |
void | set_pc (uint64_t pc) |
void | set_xcllx (uint32_t lx) |
void | set_xclly (uint32_t ly) |
void | set_xcllz (uint32_t lz) |
uint32_t | tid () const |
uint32_t | wid () const |
Protected Attributes
Type | Name |
---|---|
uint64_t | hpmcounter3_ = 0 |
uint64_t | mhartid_ |
Detailed Description
Thread class manages thread properties and execution, including program counters, priorities, and registers, and provides methods for reading, writing, and adjusting these attributes.
Public Functions Documentation
function AdvancePC
Increase program counter.
PC = PC + 4.
function LowerFunctPriority
Lower function priority of the thread.
Check if thread function priority is equal to 0. If it is not, lower the function priority.
function LowerPriority
Lower priority of the thread.
Check if thread priority is equal to 0. If it is not, lower the priority.
function RaiseFunctPriority
Raise function priority of the thread.
Check if thread function priority is equal to <max_priority_f_level_ - 1>. If it is not, raise the function priority.
function RaisePriority
Raise priority of the thread.
Check if thread priority is equal to <max_priority_level_ - 1>. If it is not, raise the priority.
function ReadCSR
Read thread CSRs.
Parameters:
addr
Address of CSR.data
Pointer to store the data.
Returns:
0 on success, -1 on fail, the CSR is undefined in thread level and other levels.
function Reset
Reset pc, priority and regfile to 0.
function ResetPC
Reset program counter.
PC = 0.
function ResetPriority
Reset priority.
Priority = 0.
function SetPriority
Set priority.
Set priority to a specific value.
function Thread
Constructor of Thread .
explicit simtix::Thread::Thread (
Warp * warp,
uint32_t tid,
const ArchParam & p=kDefaultArchParam
)
Parameters:
warp
The warp which thread belongs to.tid
Thread id.p
Architecture parameter.
function WriteCSR
Write thread CSRs.
Parameters:
addr
Address of CSR.data
Data to write in.
Returns:
0 on success, -1 on fail, the CSR is undefined or cannot write read-only CSR.
function max_function_priority_level
function max_priority_level
function pc
function priority
function priority_f
function set_pc
function set_xcllx
function set_xclly
function set_xcllz
function tid
function wid
Protected Attributes Documentation
variable hpmcounter3_
variable mhartid_
The documentation for this class was generated from the following file projects/simtix/src/simtix/sm/thread.h