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
 
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 }
 
enum  PipelineStage {
  NOT_STARTED , STAGE_0 , STAGE_1 , STAGE_2 ,
  STAGE_3 , DONE
}
 

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

Enumerator
NOT_STARTED 
STAGE_0 
STAGE_1 
STAGE_2 
STAGE_3 
DONE 

◆ WarpState

enum WarpState
Enumerator
READY 
RUNNING 
STALLED