Added some qsim support

git-svn-id: http://www.cdkersey.com/harp/harptool@77 0246edb2-e076-4747-b392-db732a341fa2
This commit is contained in:
chad
2012-03-11 16:47:02 +00:00
parent 59976a7e11
commit bd2c5724f8
8 changed files with 67 additions and 14 deletions

View File

@@ -4,6 +4,7 @@
#ifndef __ARCHDEF_H
#define __ARCHDEF_H
#include <iostream>
#include <string>
#include <sstream>
@@ -15,6 +16,7 @@ namespace Harp {
struct Undefined {};
ArchDef(const std::string &s) {
std::cout << "New archdef for \"" << s << "\"\n";
std::istringstream iss(s.c_str());
iss >> wordSize;
@@ -29,6 +31,8 @@ namespace Harp {
iss >> sep >> nThds;
if (!iss || sep != '/') { extent = EXT_PREGS; return; }
extent = EXT_THDS;
std::cout << nRegs << " regs, " << nPRegs << " pred regs.\n";
}
operator std::string () const {

View File

@@ -50,7 +50,7 @@ namespace Harp {
bool getSupervisorMode() const { return supervisorMode; }
#endif
private:
// private:
const ArchDef a;
Decoder &iDec;
MemoryUnit &mem;

View File

@@ -1,6 +1,10 @@
/*******************************************************************************
HARPtools by Chad D. Kersey, Summer 2011
*******************************************************************************/
#ifndef EMU_INSTRUMENTATION
#define EMU_INSTRUMENTATION
#endif
#ifndef __QSIM_HARP_H
#define __QSIM_HARP_H
@@ -131,7 +135,8 @@ namespace Harp {
class Cpu {
public:
Cpu(Harp::OSDomain &osd);
~Cpu() { delete dec; delete core; }
Cpu(): dec(NULL), core(NULL) {}
~Cpu() { if (dec) delete dec; if (core) delete core; }
bool idle() const { return false; }
int get_tid() const { return 0; }
@@ -140,9 +145,9 @@ namespace Harp {
void interrupt(int vec) { core->interrupt(vec); }
bool booted() const { return core->running(); }
Harp::OSDomain *osd;
Harp::Decoder *dec;
Harp::Core *core;
Harp::OSDomain *osd;
};
Harp::ArchDef arch;