Class simtix::Warp
Class for warp. More...
#include <warp.h>
Public Types
Type | Name |
---|---|
enum | Status |
Public Functions
Type | Name |
---|---|
std::string | ActiveThreadMaskPattern (uint32_t sswid) Get the active thread mask pattern as a binary string. |
void | ArbitratePC () Thread Arbitration function. |
bool | CompactActiveThreads (uint32_t sswid) Active Threads Compaction. |
void | ComputeRTV () Building ready thread vector for each thread. |
bool | HasPendingCommit () Check if there is any pending commit. |
bool | HasUnissuedTSW (uint32_t sswid) Check if there is any unissued tsw. |
bool | HasUnresolvedBranch () Query program counter scoreboard busy status. |
void | Initialize (uint32_t num_valid_threads, uint64_t pc, const std::vector< std::vector< uint32_t > > & local_id) Initialize the warp for work-group execution. |
void | NotifyCommit (const Instr & instr) Handles warp state update upon instruction commit. |
void | NotifyIssue (std::optional< uint32_t > ssw) Updates warp state after an instruction is issued. |
int32_t | ReadCSR (uint16_t addr, uint64_t * data) Read CSRs. |
bool | RegisterAvailable (uint8_t index, uint32_t sswid) Query register scoreboard busy status. |
void | ReleasePC () Clear program counter scoreboard busy. |
void | ReleaseRegister (uint8_t index, uint8_t tswid, uint32_t sswid) Clear register scoreboard busy. |
void | ReservePC () Set program counter scoreboard busy. |
void | ReserveRegister (uint8_t index, uint8_t tswid, uint32_t sswid) Set register scoreboard busy. |
void | Reset () After work-group is completed, reset the warp status. |
void | ResetScoreboard () Clear all fields (to non-busy) in scoreboard. |
bool | ScoreboardClean () const |
Warp (BaseSMImpl * sm, uint32_t wid, const ArchParam & p=kDefaultArchParam) Constructor of Warp . |
|
const std::vector< bool > & | active_thread_mask (uint32_t sswid) |
const std::vector< Thread * > & | active_threads (uint32_t sswid) |
BaseArbitrator * | arbitrator () |
uint8_t | bid () const |
bool | is_diverged () const |
bool | is_last_tsw (uint32_t sswid) |
const uint8_t & | issue_tswid (uint32_t sswid) |
BaseLoadStoreUnit * | lsu () |
uint64_t | minstret () const |
uint32_t | num_threads () const |
uint32_t | num_tsws (uint32_t sswid) |
uint32_t | num_valid_threads () const |
const std::vector< std::vector< std::vector< bool > > > & | rtv () const |
void | set_active_thread_mask (uint32_t sswid, uint32_t tid, bool is_active) |
void | set_bid (uint8_t bid) |
void | set_mcause (uint64_t mcause) |
void | set_mepc (uint64_t mepc) |
void | set_mtval (uint64_t mtval) |
void | set_num_active_tsws (uint32_t num_active_tsws) |
void | set_status (Status status) |
void | set_wc (uint8_t wc) |
uint64_t | sswpc () const |
Status | status () const |
void | swap_active_thread_mask () |
Thread * | thread (uint32_t tid) const |
const std::vector< Thread * > & | tsw_active_threads (uint32_t sswid, uint8_t * tswid) |
uint8_t | wc () const |
uint32_t | wid () const |
uint64_t | wpc () const |
~Warp () = default |
Protected Attributes
Type | Name |
---|---|
uint8_t | bid_ = 0 |
uint8_t | wc_ = 0 |
Protected Functions
Type | Name |
---|---|
void | ResetActiveThreadMask () |
void | UpdateCommittedInstrStat (const Instr & instr) |
Detailed Description
Warp holds multiple architectural states of a group of threads and provides functionalities such as PC arbitration and CSR read/write.
Public Types Documentation
enum Status
Public Functions Documentation
function ActiveThreadMaskPattern
Get the active thread mask pattern as a binary string.
Parameters:
sswid
The sub-warp ID to retrieve the mask from.
Returns:
A string representing the active thread mask ('1' for active, '0' for inactive).
function ArbitratePC
Thread Arbitration function.
Arbitrates the next program counter (PC) to execute for the warp group based on thread priorities and handles control-flow divergence by selecting active thread masks for primary and secondary PC groups.
function CompactActiveThreads
Active Threads Compaction.
Parameters:
sswid
The sub-warp ID (0 for primary PC group, 1 for secondary).
Returns:
True if there is at least one active thread; false otherwise.
Compacts the active threads of the specified sub-warp (sswid) by gathering active threads from the current warp and its peer warps, ensuring each lane has at most one active thread for execution.
function ComputeRTV
Building ready thread vector for each thread.
function HasPendingCommit
Check if there is any pending commit.
Returns:
true if there is at least one pending commit, false otherwise.
function HasUnissuedTSW
Check if there is any unissued tsw.
Returns:
true if there is at least one thread subgroup (tsw) that has not been issued, false otherwise.
function HasUnresolvedBranch
Query program counter scoreboard busy status.
function Initialize
Initialize the warp for work-group execution.
void simtix::Warp::Initialize (
uint32_t num_valid_threads,
uint64_t pc,
const std::vector< std::vector< uint32_t > > & local_id
)
Parameters:
num_valid_threads
Number of threads that are active and valid in the warp.pc
Initial program counter (PC) to assign to all valid threads.local_id
A vector of 3D local IDs (x, y, z) for each thread.
Initializes valid threads in the warp with the given program counter (PC) and 3D local IDs, and sets the warp status to ready.
function NotifyCommit
Handles warp state update upon instruction commit.
Parameters:
instr
The instruction being committed, used to determine control flow, barrier, and exception handling behavior.
After an instruction commits, it should call this method to update the warp's status.
function NotifyIssue
Updates warp state after an instruction is issued.
Parameters:
ssw
Optional sub-warp ID (0 for primary, 1 for secondary); defaults to 0.
Notifies the warp that an instruction has been issued from the specified sub-warp (ssw), updates the PC if needed, tracks pending commits, and updates issue statistics.
function ReadCSR
Read CSRs.
Parameters:
addr
Address of CSR.data
Pointer to store the data.
Returns:
0 on success, -1 on fail, the CSR is undefined.
function RegisterAvailable
Query register scoreboard busy status.
function ReleasePC
Clear program counter scoreboard busy.
function ReleaseRegister
Clear register scoreboard busy.
Parameters:
index
Index of register.tswid
Thread sub-warp id.sswid
Spatial sub-warp id.
function ReservePC
Set program counter scoreboard busy.
function ReserveRegister
Set register scoreboard busy.
Parameters:
index
Index of register.tswid
Thread sub-warp id.sswid
Spatial sub-warp id.
function Reset
After work-group is completed, reset the warp status.
function ResetScoreboard
Clear all fields (to non-busy) in scoreboard.
function ScoreboardClean
function Warp
Constructor of Warp .
Parameters:
sm
Type of sm (atomic or pipeline).wid
Warp id.p
Architecture parameter.
function active_thread_mask
function active_threads
function arbitrator
function bid
function is_diverged
function is_last_tsw
function issue_tswid
function lsu
function minstret
function num_threads
function num_tsws
function num_valid_threads
function rtv
function set_active_thread_mask
function set_bid
function set_mcause
function set_mepc
function set_mtval
function set_num_active_tsws
function set_status
function set_wc
function sswpc
function status
function swap_active_thread_mask
function thread
function tsw_active_threads
const std::vector< Thread * > & simtix::Warp::tsw_active_threads (
uint32_t sswid,
uint8_t * tswid
)
function wc
function wid
function wpc
function ~Warp
Protected Attributes Documentation
variable bid_
variable wc_
Protected Functions Documentation
function ResetActiveThreadMask
function UpdateCommittedInstrStat
The documentation for this class was generated from the following file projects/simtix/src/simtix/sm/warp.h