MicroGPU 1.0
Simple functional model of a GPU for educational purposes
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations
warp.hh File Reference
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <bitset>
#include "../thread/thread.hh"
Include dependency graph for warp.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Instruction
 Instruction structure. More...
 
struct  reconvergencePoint
 Represents a reconvergence point in a warp It has PC value and active mask to indicate which threads are active at the reconvergence point. Might need to be extend in the future to add some metadata to handle more complex reconvergence scenarios. More...
 
class  Warp
 Represents a GPU warpThe Warp class encapsulates the state and behavior of a GPU warp, including its ID, program counter, threads, active mask, and current instruction. A warp is a group of threads that execute instructions in lockstep. Each warp has 32 threads in this project. To be added: reconvergence stack to handle divergent control flow. More...
 

Macros

#define WARP_THREAD_COUNT   32
 

Typedefs

using ActiveMask = std::bitset< WARP_THREAD_COUNT >
 
using ThreadGroup = std::array< Thread, WARP_THREAD_COUNT >
 

Enumerations

enum  InstructionType {
  ADD , SUB , LOAD , STORE ,
  BRANCH
}
 Instruction types enumeration. More...
 
enum  WarpState { READY , RUNNING , STALLED }
 Warp states Not using this yet but can be useful in future iterations to manage the state of warps more effectively, especially when we implement more complex scheduling and execution logic. More...
 
enum  PipelineStage {
  NOT_STARTED , STAGE_0 , STAGE_1 , STAGE_2 ,
  STAGE_3 , DONE
}
 Pipeline stages for a warp. More...
 

Macro Definition Documentation

◆ WARP_THREAD_COUNT

#define WARP_THREAD_COUNT   32

Typedef Documentation

◆ ActiveMask

using ActiveMask = std::bitset<WARP_THREAD_COUNT>

◆ ThreadGroup

using ThreadGroup = std::array<Thread, WARP_THREAD_COUNT>

Enumeration Type Documentation

◆ InstructionType

Instruction types enumeration.

Enumerator
ADD 
SUB 
LOAD 
STORE 
BRANCH 

◆ PipelineStage

Pipeline stages for a warp.

Enumerator
NOT_STARTED 
STAGE_0 
STAGE_1 
STAGE_2 
STAGE_3 
DONE 

◆ WarpState

enum WarpState

Warp states Not using this yet but can be useful in future iterations to manage the state of warps more effectively, especially when we implement more complex scheduling and execution logic.

Enumerator
READY 
RUNNING 
STALLED