SPAWNW should pick never-before-spawned warps, not merely idle (possibly at a barrier) ones.
This commit is contained in:
@@ -36,6 +36,7 @@ Core::Core(const ArchDef &a, Decoder &d, MemoryUnit &mem, Word id):
|
|||||||
w.push_back(Warp(this));
|
w.push_back(Warp(this));
|
||||||
|
|
||||||
w[0].activeThreads = 1;
|
w[0].activeThreads = 1;
|
||||||
|
w[0].spawned = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Core::interrupt(Word r0) {
|
bool Core::interrupt(Word r0) {
|
||||||
@@ -61,7 +62,8 @@ bool Core::running() const {
|
|||||||
Warp::Warp(Core *c, Word id) :
|
Warp::Warp(Core *c, Word id) :
|
||||||
core(c), pc(0), interruptEnable(false),
|
core(c), pc(0), interruptEnable(false),
|
||||||
supervisorMode(true), activeThreads(0), reg(0), pred(0),
|
supervisorMode(true), activeThreads(0), reg(0), pred(0),
|
||||||
shadowReg(core->a.getNRegs()), shadowPReg(core->a.getNPRegs()), id(id)
|
shadowReg(core->a.getNRegs()), shadowPReg(core->a.getNPRegs()), id(id),
|
||||||
|
spawned(false)
|
||||||
{
|
{
|
||||||
/* Build the register file. */
|
/* Build the register file. */
|
||||||
Word regNum(0);
|
Word regNum(0);
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace Harp {
|
|||||||
std::vector<bool> shadowPReg;
|
std::vector<bool> shadowPReg;
|
||||||
|
|
||||||
bool interruptEnable, shadowInterruptEnable, supervisorMode,
|
bool interruptEnable, shadowInterruptEnable, supervisorMode,
|
||||||
shadowSupervisorMode;
|
shadowSupervisorMode, spawned;
|
||||||
|
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -349,11 +349,12 @@ void Instruction::executeOn(Warp &c) {
|
|||||||
D(0, "Spawning a new warp.");
|
D(0, "Spawning a new warp.");
|
||||||
for (unsigned i = 0; i < c.core->w.size(); ++i) {
|
for (unsigned i = 0; i < c.core->w.size(); ++i) {
|
||||||
Warp &newWarp(c.core->w[i]);
|
Warp &newWarp(c.core->w[i]);
|
||||||
if (newWarp.activeThreads == 0) {
|
if (newWarp.spawned == false) {
|
||||||
newWarp.pc = reg[rsrc[0]];
|
newWarp.pc = reg[rsrc[0]];
|
||||||
newWarp.reg[0][rdest] = reg[rsrc[1]];
|
newWarp.reg[0][rdest] = reg[rsrc[1]];
|
||||||
newWarp.activeThreads = 1;
|
newWarp.activeThreads = 1;
|
||||||
newWarp.supervisorMode = false;
|
newWarp.supervisorMode = false;
|
||||||
|
newWarp.spawned = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user