Bugfix-- registers now appropriately truncated.
git-svn-id: http://www.cdkersey.com/harp/harptool@117 0246edb2-e076-4747-b392-db732a341fa2
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#ifndef __ARCHDEF_H
|
||||
#define __ARCHDEF_H
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
@@ -16,7 +15,6 @@ namespace Harp {
|
||||
struct Undefined {};
|
||||
|
||||
ArchDef(const std::string &s) {
|
||||
std::cout << "New archdef for \"" << s << "\"\n";
|
||||
std::istringstream iss(s.c_str());
|
||||
|
||||
iss >> wordSize;
|
||||
@@ -31,8 +29,6 @@ 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 {
|
||||
|
||||
@@ -24,8 +24,14 @@ namespace Harp {
|
||||
Reg(Word c, Word n): cpuId(c), regNum(n), val(0) {}
|
||||
|
||||
Reg &operator=(T r) { val = r; doWrite(); return *this; }
|
||||
|
||||
operator T() { doRead(); return val; }
|
||||
|
||||
void trunc(Size s) {
|
||||
Word mask((~0ull >> (sizeof(Word)-s)*8));
|
||||
val &= mask;
|
||||
}
|
||||
|
||||
private:
|
||||
Word cpuId, regNum;
|
||||
T val;
|
||||
|
||||
Reference in New Issue
Block a user