Separated warp and core in preparation for wspawn support.
This commit is contained in:
@@ -67,9 +67,27 @@ namespace Harp {
|
||||
Word pc;
|
||||
};
|
||||
|
||||
class Warp;
|
||||
|
||||
class Core {
|
||||
public:
|
||||
Core(const ArchDef &a, Decoder &d, MemoryUnit &mem, Word id=0);
|
||||
|
||||
bool interrupt(Word r0);
|
||||
bool running() const;
|
||||
void step();
|
||||
|
||||
const ArchDef &a;
|
||||
Decoder &iDec;
|
||||
MemoryUnit &mem;
|
||||
|
||||
std::vector<Warp> w;
|
||||
};
|
||||
|
||||
class Warp {
|
||||
public:
|
||||
Warp(Core *c, Word id=0);
|
||||
|
||||
void step();
|
||||
bool interrupt(Word r0);
|
||||
bool running() const { return activeThreads; }
|
||||
@@ -78,9 +96,7 @@ namespace Harp {
|
||||
#endif
|
||||
|
||||
// private:
|
||||
const ArchDef a;
|
||||
Decoder &iDec;
|
||||
MemoryUnit &mem;
|
||||
Core *core;
|
||||
|
||||
Word pc, interruptEntry, shadowPc, id;
|
||||
Size activeThreads, shadowActiveThreads;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "types.h"
|
||||
|
||||
namespace Harp {
|
||||
class Core;
|
||||
class Warp;
|
||||
class Ref;
|
||||
|
||||
static const Size MAX_REG_SOURCES(3);
|
||||
@@ -53,7 +53,7 @@ namespace Harp {
|
||||
predicated(false), nRsrc(0), nPsrc(0), immsrcPresent(false),
|
||||
rdestPresent(false), pdestPresent(false), refLiteral(NULL) {}
|
||||
|
||||
void executeOn(Core &core);
|
||||
void executeOn(Warp &warp);
|
||||
friend std::ostream &operator<<(std::ostream &, Instruction &);
|
||||
|
||||
/* Setters used to "craft" the instruction. */
|
||||
|
||||
Reference in New Issue
Block a user