Fixed some simX bugs

This commit is contained in:
fares
2019-11-21 20:28:02 -05:00
parent fd80fa14c7
commit d8d98d8ea7
17 changed files with 165568 additions and 593539 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -381,7 +381,15 @@ Instruction *WordDecoder::decode(const std::vector<Byte> &v, Size &idx) {
imeed = 0 | (bits_10_1 << 1) | (bit_11 << 11) | (bits_19_12 << 12) | (bit_20 << 20);
inst.setSrcImm(signExt(imeed, 20, j_immed_mask));
// cout << "Immediate src: " << hex << imeed << "\n";
// cout << "bit 20 = " << bit_20 << '\n';
// if (bit_20 == 1)
// {
// imeed = imeed * -1;
// }
inst.setSrcImm(signExt(imeed, 21, j_immed_mask));
usedImm = true;
break;
defualt:

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -53,32 +53,18 @@ namespace Harp {
};
class Core;
// class ConsoleMemDevice : public MemDevice {
// public:
// ConsoleMemDevice(Size wS, std::ostream &o, Core &core, bool batch = false);
// ~ConsoleMemDevice() {}
class ConsoleMemDevice : public MemDevice {
public:
ConsoleMemDevice(Size wS, std::ostream &o, Core &core, bool batch = false) {}
~ConsoleMemDevice() {}
// //virtual Size wordSize() const { return wordSize; }
// virtual Size size() const { return wordSize; }
// virtual Word read(Addr) { pthread_mutex_lock(&cBufLock);
// char c = cBuf.front();
// cBuf.pop();
// pthread_mutex_unlock(&cBufLock);
// return Word(c); }
// virtual void write(Addr a, Word w) { output << char(w); }
//virtual Size wordSize() const { return wordSize; }
virtual Size size() const { return 1; }
virtual Word read(Addr) { Word(5); }
virtual void write(Addr a, Word w) { }
// void poll();
// friend void *Harp::consoleInputThread(void *);
// private:
// std::ostream &output;
// Size wordSize;
// Core &core;
// std::queue<char> cBuf;
// pthread_mutex_t cBufLock;
// };
void poll() {}
};
class DiskControllerMemDevice : public MemDevice {
public:

View File

@@ -578,9 +578,15 @@ void Instruction::executeOn(Warp &c) {
reg[rdest] = ((immsrc << 12) & 0xfffff000) + (c.pc - 4);
break;
case JAL_INST:
//std::cout << "JAL_INST\n";
std::cout << "JAL_INST\n";
if (!pcSet) nextPc = (c.pc - 4) + immsrc;
if (!pcSet) {/*std::cout << "JAL... SETTING PC: " << nextPc << "\n"; */}
if (!pcSet)
{
std::cout << "JAL... immsrc: " << hex << immsrc << "\n";
std::cout << "JAL... pc base: " << hex << (c.pc - 4) << "\n";
std::cout << "JAL... SETTING PC: " << nextPc << "\n";
}
if (rdest != 0)
{
reg[rdest] = c.pc;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,6 @@
echo start > results.txt
# echo ../kernel/vortex_test.hex
./harptool -E -a rv32i --core ../runtime/mains/simple/vx_simple_main.hex -s -b 1> emulator.debug
# ./harptool -E -a rv32i --core ../runtime/mains/simple/vx_simple_main.hex -s -b 1> emulator.debug
./harptool -E -a rv32i --core ../benchmarks/opencl/sgemm/sgemm.hex -s -b 1> emulator.debug
# ./harptool -E -a rv32i --core ../runtime/mains/vector_test/vx_vector_main.hex -s -b 1> emulator.debug