Skip to content

Class simtix::Thread

ClassList > 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.

void simtix::Thread::AdvancePC () 

PC = PC + 4.


function LowerFunctPriority

Lower function priority of the thread.

void simtix::Thread::LowerFunctPriority () 

Check if thread function priority is equal to 0. If it is not, lower the function priority.


function LowerPriority

Lower priority of the thread.

void simtix::Thread::LowerPriority () 

Check if thread priority is equal to 0. If it is not, lower the priority.


function RaiseFunctPriority

Raise function priority of the thread.

void simtix::Thread::RaiseFunctPriority () 

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.

void simtix::Thread::RaisePriority () 

Check if thread priority is equal to <max_priority_level_ - 1>. If it is not, raise the priority.


function ReadCSR

Read thread CSRs.

int32_t simtix::Thread::ReadCSR (
    uint16_t addr,
    uint64_t * data
) 

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.

void simtix::Thread::Reset () 


function ResetPC

Reset program counter.

void simtix::Thread::ResetPC () 

PC = 0.


function ResetPriority

Reset priority.

void simtix::Thread::ResetPriority () 

Priority = 0.


function SetPriority

Set priority.

void simtix::Thread::SetPriority (
    uint32_t 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.

int32_t simtix::Thread::WriteCSR (
    uint16_t addr,
    uint64_t data
) 

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

inline uint32_t simtix::Thread::max_function_priority_level () const

function max_priority_level

inline uint32_t simtix::Thread::max_priority_level () const

function pc

inline uint64_t simtix::Thread::pc () const

function priority

inline uint32_t simtix::Thread::priority () const

function priority_f

inline uint32_t simtix::Thread::priority_f () const

function set_pc

inline void simtix::Thread::set_pc (
    uint64_t pc
) 

function set_xcllx

inline void simtix::Thread::set_xcllx (
    uint32_t lx
) 

function set_xclly

inline void simtix::Thread::set_xclly (
    uint32_t ly
) 

function set_xcllz

inline void simtix::Thread::set_xcllz (
    uint32_t lz
) 

function tid

inline uint32_t simtix::Thread::tid () const

function wid

uint32_t simtix::Thread::wid () const

Protected Attributes Documentation

variable hpmcounter3_

uint64_t simtix::Thread::hpmcounter3_;

variable mhartid_

uint64_t simtix::Thread::mhartid_;


The documentation for this class was generated from the following file projects/simtix/src/simtix/sm/thread.h