software updaet for new thread mask design

This commit is contained in:
Blaise Tine
2021-08-05 22:39:39 -04:00
parent e4d9fd8a00
commit d7948a1ce6
24 changed files with 8470 additions and 8430 deletions

View File

@@ -267,6 +267,9 @@ Word Core::get_csr(Addr addr, int tid, int wid) {
} else if (addr == CSR_GCID) {
// Processor coreID
return id_;
} else if (addr == CSR_TMASK) {
// Processor coreID
return warps_.at(wid)->getTmask();
} else if (addr == CSR_NT) {
// Number of threads per warp
return arch_.num_threads();

View File

@@ -817,10 +817,9 @@ void Warp::execute(const Instr &instr, Pipeline *pipeline) {
switch (func3) {
case 0: {
// TMC
int active_threads = std::min<int>(rsdata[0], num_threads);
tmask_.reset();
for (int i = 0; i < active_threads; ++i) {
tmask_[i] = true;
for (size_t i = 0; i < tmask_.size(); ++i) {
tmask_[i] = rsdata[0] & (1 << i);
}
active_ = tmask_.any();
pipeline->stall_warp = true;

View File

@@ -74,6 +74,12 @@ public:
active_ = tmask_.any();
}
Word getTmask() const {
if (active_)
return tmask_.to_ulong();
return 0;
}
Word getIRegValue(int reg) const {
return iRegFile_[0][reg];
}