Separated warp and core in preparation for wspawn support.

This commit is contained in:
cdkersey
2015-08-04 10:58:53 -06:00
parent e243c4c6d6
commit 3011e4e757
4 changed files with 68 additions and 28 deletions

View File

@@ -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;

View File

@@ -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. */