software updaet for new thread mask design
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user