This commit is contained in:
Blaise Tine 2019-11-23 14:29:34 -05:00
commit 8a68c0c99f
6 changed files with 166 additions and 162 deletions

View file

@ -237,8 +237,8 @@ static int head_end = (int) 0x20000000;
void * _sbrk (int nbytes)
{
//vx_print_str("Hello from _sbrk\n");
//vx_printf("nbytes: ", nbytes);
vx_print_str("Hello from _sbrk\n");
vx_printf("nbytes: ", nbytes);
//if (nbytes < 0) //vx_print_str("nbytes less than zero\n");
// printf("nBytes: %d\n", nbytes);
@ -248,19 +248,21 @@ void * _sbrk (int nbytes)
nbytes = nbytes * -1;
}
if (nbytes > 10240)
{
nbytes = 10240;
}
vx_printf("New nbytes: ", nbytes);
// if (nbytes > 10240)
// {
// nbytes = 10240;
// }
// if (((unsigned) head_end) > ((unsigned) (heap_ptr + nbytes)))
if (true)
{
int base = heap_start;
heap_start += nbytes;
////vx_print_str("_sbrk returning: ");
//vx_print_hex((unsigned) base);
////vx_print_str("\n");
vx_print_str("_sbrk returning: ");
vx_print_hex((unsigned) base);
vx_print_str("\n");
return (void *) base;
}
else
@ -303,7 +305,7 @@ int _open(const char *name, int flags, int mode)
void _kill()
{
vx_print_str("ERROR: _kill not yet implemented\n");
vx_tmc(0);
}
unsigned _getpid()
@ -320,7 +322,7 @@ static int curr_time = 0;
int _gettimeofday()
{
vx_print_str("ERROR: _gettimeofday not yet implemented\n");
// vx_print_str("ERROR: _gettimeofday not yet implemented\n");
return curr_time++;
}

View file

@ -46,6 +46,7 @@
trace_inst.vd = -1; \
trace_inst.is_lw = false; \
trace_inst.is_sw = false; \
if (trace_inst.mem_addresses != NULL) free(trace_inst.mem_addresses); \
trace_inst.mem_addresses = (unsigned *) malloc(32 * sizeof(unsigned)); \
for (int tid = 0; tid < a.getNThds(); tid++) trace_inst.mem_addresses[tid] = 0xdeadbeef; \
trace_inst.mem_stall_cycles = 0; \
@ -79,19 +80,19 @@ using namespace std;
void printTrace(trace_inst_t * trace, const char * stage_name)
{
cout << "********************************** " << stage_name << " *********************************\n";
cout << "valid: " << trace->valid_inst << '\n';
cout << "PC: " << hex << trace->pc << dec << '\n';
cout << "wid: " << trace->wid << '\n';
cout << "rd: " << trace->rd << "\trs1: " << trace->rs1 << "\trs2: " << trace->rs2 << '\n';
cout << "is_lw: " << trace->is_lw << '\n';
cout << "is_sw: " << trace->is_sw << '\n';
cout << "fetch_stall_cycles: " << trace->fetch_stall_cycles << '\n';
cout << "mem_stall_cycles: " << trace->mem_stall_cycles << '\n';
D(3, "********************************** " << stage_name << " *********************************");
D(3, "valid: " << trace->valid_inst);
D(3, "PC: " << hex << trace->pc << dec);
D(3, "wid: " << trace->wid);
D(3, "rd: " << trace->rd << "\trs1: " << trace->rs1 << "\trs2: " << trace->rs2);
D(3, "is_lw: " << trace->is_lw);
D(3, "is_sw: " << trace->is_sw);
D(3, "fetch_stall_cycles: " << trace->fetch_stall_cycles);
D(3, "mem_stall_cycles: " << trace->mem_stall_cycles);
cout << "stall_warp: " << trace->stall_warp << '\n';
cout << "wspawn: " << trace->wspawn << '\n';
cout << "stalled: " << trace->stalled << '\n';
D(3, "stall_warp: " << trace->stall_warp);
D(3, "wspawn: " << trace->wspawn);
D(3, "stalled: " << trace->stalled);
}
#ifdef EMU_INSTRUMENTATION
@ -133,9 +134,9 @@ Core::Core(const ArchDef &a, Decoder &d, MemoryUnit &mem, Word id):
cache_simulator = new Vcache_simX;
m_trace = new VerilatedVcdC;
cache_simulator->trace(m_trace, 99);
m_trace->open("simXtrace.vcd");
// m_trace = new VerilatedVcdC;
// cache_simulator->trace(m_trace, 99);
// m_trace->open("simXtrace.vcd");
cache_simulator->reset = 1;
cache_simulator->clk = 0;
@ -166,36 +167,35 @@ void Core::step()
D(3, "Started core::step" << flush);
steps++;
cout << "CYCLE: " << steps << '\n';
D(3, "CYCLE: " << steps);
cout << "Stalled Warps:\n";
D(3, "Stalled Warps:");
for (int widd = 0; widd < a.getNWarps(); widd++)
{
cout << stallWarp[widd] << " ";
D(3, stallWarp[widd] << " ");
}
cout << '\n';
// cout << "Rename table\n";
// for (int regii = 0; regii < 32; regii++)
// {
// cout << regii << ": " << renameTable[0][regii] << '\n';
// }
cout << '\n' << flush;
// cout << '\n' << flush;
cout << "About to call writeback" << endl;
// cout << "About to call writeback" << endl;
this->writeback();
cout << "About to call load_store" << endl;
// cout << "About to call load_store" << endl;
this->load_store();
cout << "About to call execute_unit" << endl;
// cout << "About to call execute_unit" << endl;
this->execute_unit();
cout << "About to call scheduler" << endl;
// cout << "About to call scheduler" << endl;
this->scheduler();
cout << "About to call decode" << endl;
// cout << "About to call decode" << endl;
this->decode();
D(3, "About to call fetch" << flush);
// D(3, "About to call fetch" << flush);
this->fetch();
D(3, "Finished fetch" << flush);
// D(3, "Finished fetch" << flush);
if (release_warp)
{
@ -250,7 +250,7 @@ void Core::getCacheDelays(trace_inst_t * trace_inst)
cache_simulator->clk = 1;
cache_simulator->eval();
m_trace->dump(2*curr_cycle);
// m_trace->dump(2*curr_cycle);
cache_simulator->in_icache_pc_addr = trace_inst->pc;
cache_simulator->in_icache_valid_pc_addr = 1;
@ -266,7 +266,7 @@ void Core::getCacheDelays(trace_inst_t * trace_inst)
// DCache end
cache_simulator->clk = 0;
cache_simulator->eval();
m_trace->dump(2*curr_cycle+1);
// m_trace->dump(2*curr_cycle+1);
curr_cycle++;
@ -308,7 +308,7 @@ void Core::getCacheDelays(trace_inst_t * trace_inst)
cache_simulator->clk = 1;
cache_simulator->eval();
m_trace->dump(2*curr_cycle);
// m_trace->dump(2*curr_cycle);
//////// Feed input
if (cache_simulator->out_icache_stall)
@ -343,7 +343,7 @@ void Core::getCacheDelays(trace_inst_t * trace_inst)
cache_simulator->clk = 0;
cache_simulator->eval();
m_trace->dump(2*curr_cycle+1);
// m_trace->dump(2*curr_cycle+1);
curr_cycle++;
@ -390,9 +390,9 @@ void Core::warpScheduler()
void Core::fetch()
{
#ifdef PRINT_ACTIVE_THREADS
cout << endl << "Threads:";
#endif
// #ifdef PRINT_ACTIVE_THREADS
D(3, "Threads:");
// #endif
// D(-1, "Found schedule: " << foundSchedule);
@ -436,8 +436,14 @@ void Core::fetch()
// #ifdef PRINT_ACTIVE_THREADS
D(3, "About to print active threads" << flush << "\n");
for (unsigned j = 0; j < w[schedule_w].tmask.size(); ++j) {
if (w[schedule_w].activeThreads > j && w[schedule_w].tmask[j]) cout << " 1";
else cout << " 0";
if (w[schedule_w].activeThreads > j && w[schedule_w].tmask[j])
{
D(3, " 1");
}
else
{
D(3, " 0");
}
if (j != w[schedule_w].tmask.size()-1 || schedule_w != w.size()-1) cout << ',';
}
D(3, "\nPrinted active threads" << flush);
@ -446,7 +452,6 @@ void Core::fetch()
// #ifdef PRINT_ACTIVE_THREADS
cout << endl;
// #endif
}
@ -542,7 +547,7 @@ void Core::load_store()
void Core::execute_unit()
{
cout << "$$$$$$$$$$$$$$$$$$$ EXE START\n" << flush;
D(3, "$$$$$$$$$$$$$$$$$$$ EXE START\n" << flush);
bool do_nothing = false;
// EXEC is always not busy
if (inst_in_scheduler.is_lw || inst_in_scheduler.is_sw)
@ -566,7 +571,7 @@ void Core::execute_unit()
// cout << "Rename RS2: " << inst_in_scheduler.rs1 << " is " << renameTable[inst_in_scheduler.wid][inst_in_scheduler.rs2] << " wid: " << inst_in_scheduler.wid << '\n';
}
cout << "About to check vs*\n" << flush;
// cout << "About to check vs*\n" << flush;
if(inst_in_scheduler.vs1 > 0)
{
scheduler_srcs_ready = scheduler_srcs_ready && vecRenameTable[inst_in_scheduler.vs1];
@ -575,7 +580,7 @@ void Core::execute_unit()
{
scheduler_srcs_ready = scheduler_srcs_ready && vecRenameTable[inst_in_scheduler.vs2];
}
cout << "Finished sources\n" << flush;
// cout << "Finished sources\n" << flush;
if (scheduler_srcs_ready)
{
@ -584,14 +589,14 @@ void Core::execute_unit()
renameTable[inst_in_scheduler.wid][inst_in_scheduler.rd] = false;
}
cout << "About to check vector wb: " << inst_in_scheduler.vd << "\n" << flush;
// cout << "About to check vector wb: " << inst_in_scheduler.vd << "\n" << flush;
if(inst_in_scheduler.vd != -1) {
vecRenameTable[inst_in_scheduler.vd] = false;
}
cout << "Finished wb checking" << "\n" << flush;
// cout << "Finished wb checking" << "\n" << flush;
CPY_TRACE(inst_in_exe, inst_in_scheduler);
INIT_TRACE(inst_in_scheduler);
cout << "Finished trace copying and clearning" << "\n" << flush;
// cout << "Finished trace copying and clearning" << "\n" << flush;
}
else
{
@ -650,7 +655,7 @@ void Core::writeback()
{
if (serviced_exe)
{
cout << "$$$$$$$$$$$$$$$$$$$$ Stalling LSU because EXE is being used\n";
D(3, "$$$$$$$$$$$$$$$$$$$$ Stalling LSU because EXE is being used");
inst_in_lsu.stalled = true;
}
else
@ -679,7 +684,7 @@ bool Core::running() const {
for (unsigned i = 0; i < w.size(); ++i)
if (w[i].running())
{
cout << "Warp ID " << i << " is running\n";
D(3, "Warp ID " << i << " is running");
return true;
}
return false;
@ -692,7 +697,7 @@ void Core::printStats() const {
cerr << "Total steps: " << steps << endl;
for (unsigned i = 0; i < w.size(); ++i) {
cout << "=== Warp " << i << " ===" << endl;
// cout << "=== Warp " << i << " ===" << endl;
w[i].printStats();
}
}
@ -742,7 +747,7 @@ void Warp::step(trace_inst_t * trace_inst) {
// ++steps;
D(3, "in step pc=0x" << hex << pc);
cout << "help: in PC: " << hex << pc << dec << '\n';
D(3, "help: in PC: " << hex << pc << dec);
// std::cout << "pc: " << hex << pc << "\n";

View file

@ -104,7 +104,8 @@ Instruction *WordDecoder::decode(const std::vector<Byte> &v, Size &idx, trace_in
bool predicated = false;
if (predicated) { inst.setPred((code>>(inst_s-p-1))&pMask); }
printf("CUrrent CODE: %x\n", code);
// printf("CUrrent CODE: %x\n", code);
D(3, "Curr Code: " << hex << code << dec);
Opcode op = (Opcode)((code>>shift_opcode)&opcode_mask);
// std::cout << "opcode: " << op << "\n";
@ -234,17 +235,17 @@ Instruction *WordDecoder::decode(const std::vector<Byte> &v, Size &idx, trace_in
break;
case InstType::V_TYPE:
cout << "Entered here: instr type = vector" << op << endl;
D(3, "Entered here: instr type = vector" << op);
switch(op) {
case Opcode::VSET_ARITH: //TODO: arithmetic ops
inst.setDestReg((code>>shift_rd) & reg_mask);
inst.setSrcReg((code>>shift_rs1) & reg_mask);
func3 = (code>>shift_func3) & func3_mask;
inst.setFunc3 (func3);
cout << "Entered here: instr type = vector" << endl;
D(3, "Entered here: instr type = vector");
if(func3 == 7) {
cout << "Entered here: imm instr";
D(3, "Entered here: imm instr");
inst.setVsetImm(!(code>>shift_vset));
@ -318,9 +319,9 @@ Instruction *WordDecoder::decode(const std::vector<Byte> &v, Size &idx, trace_in
Ref *srcRef = refMap[idx-n/8];
/* Create a new ref tied to this instruction. */
Ref *r = new SimpleRef(srcRef->name, *(Addr*)inst.setSrcImm(),
inst.hasRelImm());
inst.setImmRef(*r);
// Ref *r = new SimpleRef(srcRef->name, *(Addr*)inst.setSrcImm(),
// inst.hasRelImm());
// inst.setImmRef(*r);
}
D(2, "Decoded 0x" << hex << code << " into: " << inst << '\n');

View file

@ -5,7 +5,7 @@
#define __DEBUG_H
// #define USE_DEBUG 9
#define USE_DEBUG 3
// #define USE_DEBUG 3
#ifdef USE_DEBUG
#include <iostream>
@ -21,10 +21,11 @@
#define D_RAW(x) do { \
std::cout << x; \
} while (0)
#else
#define D(lvl, x) do {} while(0)
#define D_RAW(x) do {} while(0)
#endif
#endif

View file

@ -45,9 +45,8 @@ ostream &Harp::operator<<(ostream& os, Instruction &inst) {
// else os << "#0x" << hex << inst.immsrc;
// }
os << instTable[inst.op].opString;
D(3, instTable[inst.op].opString << ';\n');
os << ';';
return os;
}
@ -353,7 +352,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
/* If I try to execute a privileged instruction in user mode, throw an
exception 3. */
if (instTable[op].privileged && !c.supervisorMode) {
std::cout << "INTERRUPT SUPERVISOR\n";
D(3, "INTERRUPT SUPERVISOR\n");
c.interrupt(3);
return;
}
@ -717,8 +716,8 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
//std::cout << "S_INST\n";
++c.stores;
memAddr = reg[rsrc[0]] + immsrc;
std::cout << "STORE MEM ADDRESS: " << std::hex << reg[rsrc[0]] << " + " << immsrc << "\n";
std::cout << "STORE MEM ADDRESS: " << std::hex << memAddr;
D(3, "STORE MEM ADDRESS: " << std::hex << reg[rsrc[0]] << " + " << immsrc << "\n");
D(3, "STORE MEM ADDRESS: " << std::hex << memAddr);
trace_inst->is_sw = true;
trace_inst->mem_addresses[t] = memAddr;
// //std::cout << "FUNC3: " << func3 << "\n";
@ -755,7 +754,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
case B_INST:
//std::cout << "B_INST\n";
trace_inst->stall_warp = true;
cout << "func3:" << func3 << endl;
D(3,"func3:" << func3 << endl);
switch (func3)
{
case 0:
@ -768,7 +767,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
break;
case 1:
// BNE
cout << "rsrc0: " << reg[rsrc[0]] << " rsrc1 : " << reg[rsrc[1]] << endl;
D(3, "rsrc0: " << reg[rsrc[0]] << " rsrc1 : " << reg[rsrc[1]] << endl);
if (int(reg[rsrc[0]]) != int(reg[rsrc[1]]))
{
if (!pcSet) nextPc = (c.pc - 4) + immsrc;
@ -829,7 +828,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
pcSet = true;
break;
case JALR_INST:
std::cout << "JALR_INST\n";
D(3, "JALR_INST\n");
trace_inst->stall_warp = true;
if (!pcSet) nextPc = reg[rsrc[0]] + immsrc;
if (!pcSet) {/*std::cout << "JALR... SETTING PC: " << nextPc << "\n";*/ }
@ -945,7 +944,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
{
case 1:
// WSPAWN
std::cout << "WSPAWN\n";
D(3, "WSPAWN\n");
trace_inst->wspawn = true;
if (sjOnce)
{
@ -993,15 +992,14 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
{
sjOnce = false;
if (checkUnanimous(pred, c.reg, c.tmask)) {
std::cout << "Unanimous pred: " << pred << " val: " << reg[pred] << "\n";
D(3, "Unanimous pred: " << pred << " val: " << reg[pred] << "\n");
DomStackEntry e(c.tmask);
e.uni = true;
c.domStack.push(e);
break;
}
cout << "Split: Original TM: ";
for (auto y : c.tmask) cout << y << " ";
cout << "\n";
D(3, "Split: Original TM: ");
for (auto y : c.tmask) D(3, y << " ");
DomStackEntry e(pred, c.reg, c.tmask, c.pc);
c.domStack.push(c.tmask);
@ -1012,12 +1010,10 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
}
cout << "Split: New TM\n";
for (auto y : c.tmask) cout << y << " ";
cout << "\n";
cout << "Split: Pushed TM PC: " << hex << e.pc << dec << "\n";
for (auto y : e.tmask) cout << y << " ";
cout << "\n";
D(3, "Split: New TM");
for (auto y : c.tmask) D(3, y << " ");
D(3, "Split: Pushed TM PC: " << hex << e.pc << dec << "\n");
for (auto y : e.tmask) D(3, y << " ");
}
break;
}
@ -1038,19 +1034,18 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
if (!c.domStack.top().fallThrough) {
if (!pcSet) {
nextPc = c.domStack.top().pc;
cout << "join: NOT FALLTHROUGH PC: " << hex << nextPc << dec << '\n';
D(3, "join: NOT FALLTHROUGH PC: " << hex << nextPc << dec);
}
pcSet = true;
}
cout << "Join: Old TM: ";
for (auto y : c.tmask) cout << y << " ";
D(3, "Join: Old TM: ");
for (auto y : c.tmask) D(3, y << " ");
cout << "\n";
c.tmask = c.domStack.top().tmask;
cout << "Join: New TM: " << '\n';
for (auto y : c.tmask) cout << y << " ";
cout << "\n";
D(3, "Join: New TM: ");
for (auto y : c.tmask) D(3, y << " ");
c.domStack.pop();
}
@ -1120,7 +1115,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t * first_ptr = (uint8_t *) vr1[i].val;
uint8_t * second_ptr = (uint8_t *) vr2[i].val;
uint8_t result = *first_ptr + *second_ptr;
cout << "Adding " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Adding " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1139,7 +1134,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t * first_ptr = (uint16_t *) vr1[i].val;
uint16_t * second_ptr = (uint16_t *) vr2[i].val;
uint16_t result = *first_ptr + *second_ptr;
cout << "Adding " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Adding " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1148,7 +1143,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
}
} else if (c.vtype.vsew == 32)
{
cout << "Doing 32 bit vector addition\n";
D(3, "Doing 32 bit vector addition");
for (Word i = 0; i < c.vl; i++)
{
int *mask_ptr = (int*) mask[i].val;
@ -1157,7 +1152,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int * first_ptr = (int *) vr1[i].val;
int * second_ptr = (int *) vr2[i].val;
int result = *first_ptr + *second_ptr;
cout << "Adding " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Adding " << *first_ptr << " + " << *second_ptr << " = " << result);
int * result_ptr = (int *) vd[i].val;
*result_ptr = result;
@ -1174,15 +1169,15 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
if (c.vtype.vsew == 8)
{
uint8_t * ptr_val = (uint8_t *) c.vreg[i][j].val;
std::cout << "reg[" << i << "][" << j << "] = " << *ptr_val << std::endl;
D(3, "reg[" << i << "][" << j << "] = " << *ptr_val);
} else if (c.vtype.vsew == 16)
{
uint16_t * ptr_val = (uint16_t *) c.vreg[i][j].val;
std::cout << "reg[" << i << "][" << j << "] = " << *ptr_val << std::endl;
D(3, "reg[" << i << "][" << j << "] = " << *ptr_val);
} else if (c.vtype.vsew == 32)
{
uint32_t * ptr_val = (uint32_t *) c.vreg[i][j].val;
std::cout << "reg[" << i << "][" << j << "] = " << *ptr_val << std::endl;
D(3, "reg[" << i << "][" << j << "] = " << *ptr_val);
}
}
}
@ -1200,7 +1195,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t *first_ptr = (uint8_t *)vr1[i].val;
uint8_t *second_ptr = (uint8_t *)vr2[i].val;
uint8_t result = (*first_ptr == *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1211,7 +1206,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t *first_ptr = (uint16_t *)vr1[i].val;
uint16_t *second_ptr = (uint16_t *)vr2[i].val;
uint16_t result = (*first_ptr == *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1222,7 +1217,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t *first_ptr = (uint32_t *)vr1[i].val;
uint32_t *second_ptr = (uint32_t *)vr2[i].val;
uint32_t result = (*first_ptr == *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1241,7 +1236,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t *first_ptr = (uint8_t *)vr1[i].val;
uint8_t *second_ptr = (uint8_t *)vr2[i].val;
uint8_t result = (*first_ptr != *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1252,7 +1247,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t *first_ptr = (uint16_t *)vr1[i].val;
uint16_t *second_ptr = (uint16_t *)vr2[i].val;
uint16_t result = (*first_ptr != *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1263,7 +1258,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t *first_ptr = (uint32_t *)vr1[i].val;
uint32_t *second_ptr = (uint32_t *)vr2[i].val;
uint32_t result = (*first_ptr != *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1282,7 +1277,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t *first_ptr = (uint8_t *)vr1[i].val;
uint8_t *second_ptr = (uint8_t *)vr2[i].val;
uint8_t result = (*first_ptr < *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1293,7 +1288,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t *first_ptr = (uint16_t *)vr1[i].val;
uint16_t *second_ptr = (uint16_t *)vr2[i].val;
uint16_t result = (*first_ptr < *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1304,7 +1299,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t *first_ptr = (uint32_t *)vr1[i].val;
uint32_t *second_ptr = (uint32_t *)vr2[i].val;
uint32_t result = (*first_ptr < *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1323,7 +1318,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int8_t *first_ptr = (int8_t *)vr1[i].val;
int8_t *second_ptr = (int8_t *)vr2[i].val;
int8_t result = (*first_ptr < *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int8_t * result_ptr = (int8_t *) vd[i].val;
*result_ptr = result;
@ -1334,7 +1329,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int16_t *first_ptr = (int16_t *)vr1[i].val;
int16_t *second_ptr = (int16_t *)vr2[i].val;
int16_t result = (*first_ptr < *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int16_t * result_ptr = (int16_t *) vd[i].val;
*result_ptr = result;
@ -1345,7 +1340,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int32_t *first_ptr = (int32_t *)vr1[i].val;
int32_t *second_ptr = (int32_t *)vr2[i].val;
int32_t result = (*first_ptr < *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int32_t * result_ptr = (int32_t *) vd[i].val;
*result_ptr = result;
@ -1363,7 +1358,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t *first_ptr = (uint8_t *)vr1[i].val;
uint8_t *second_ptr = (uint8_t *)vr2[i].val;
uint8_t result = (*first_ptr <= *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1374,7 +1369,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t *first_ptr = (uint16_t *)vr1[i].val;
uint16_t *second_ptr = (uint16_t *)vr2[i].val;
uint16_t result = (*first_ptr <= *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1385,7 +1380,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t *first_ptr = (uint32_t *)vr1[i].val;
uint32_t *second_ptr = (uint32_t *)vr2[i].val;
uint32_t result = (*first_ptr <= *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1403,7 +1398,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int8_t *first_ptr = (int8_t *)vr1[i].val;
int8_t *second_ptr = (int8_t *)vr2[i].val;
int8_t result = (*first_ptr <= *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int8_t * result_ptr = (int8_t *) vd[i].val;
*result_ptr = result;
@ -1414,7 +1409,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int16_t *first_ptr = (int16_t *)vr1[i].val;
int16_t *second_ptr = (int16_t *)vr2[i].val;
int16_t result = (*first_ptr <= *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int16_t * result_ptr = (int16_t *) vd[i].val;
*result_ptr = result;
@ -1425,7 +1420,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int32_t *first_ptr = (int32_t *)vr1[i].val;
int32_t *second_ptr = (int32_t *)vr2[i].val;
int32_t result = (*first_ptr <= *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int32_t * result_ptr = (int32_t *) vd[i].val;
*result_ptr = result;
@ -1443,7 +1438,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t *first_ptr = (uint8_t *)vr1[i].val;
uint8_t *second_ptr = (uint8_t *)vr2[i].val;
uint8_t result = (*first_ptr > *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1454,7 +1449,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t *first_ptr = (uint16_t *)vr1[i].val;
uint16_t *second_ptr = (uint16_t *)vr2[i].val;
uint16_t result = (*first_ptr > *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1465,7 +1460,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t *first_ptr = (uint32_t *)vr1[i].val;
uint32_t *second_ptr = (uint32_t *)vr2[i].val;
uint32_t result = (*first_ptr > *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1483,7 +1478,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int8_t *first_ptr = (int8_t *)vr1[i].val;
int8_t *second_ptr = (int8_t *)vr2[i].val;
int8_t result = (*first_ptr > *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int8_t * result_ptr = (int8_t *) vd[i].val;
*result_ptr = result;
@ -1494,7 +1489,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int16_t *first_ptr = (int16_t *)vr1[i].val;
int16_t *second_ptr = (int16_t *)vr2[i].val;
int16_t result = (*first_ptr > *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int16_t * result_ptr = (int16_t *) vd[i].val;
*result_ptr = result;
@ -1505,7 +1500,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
int32_t *first_ptr = (int32_t *)vr1[i].val;
int32_t *second_ptr = (int32_t *)vr2[i].val;
int32_t result = (*first_ptr > *second_ptr) ? 1 : 0;
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
int32_t * result_ptr = (int32_t *) vd[i].val;
*result_ptr = result;
@ -1536,7 +1531,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = (first_value & !second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1554,7 +1549,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = (first_value & !second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1572,7 +1567,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = (first_value & !second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1598,7 +1593,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = (first_value & second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1615,7 +1610,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = (first_value & second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1633,7 +1628,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = (first_value & second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1659,7 +1654,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = (first_value | second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1677,7 +1672,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = (first_value | second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1694,12 +1689,12 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = (first_value | second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
}
cout << "VLMAX: " << VLMAX << endl;
D(3, "VLMAX: " << VLMAX);
for(Word i = c.vl; i < VLMAX; i++){
result_ptr = (uint32_t *) vd[i].val;
*result_ptr = 0;
@ -1721,7 +1716,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = (first_value ^ second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
}
@ -1737,7 +1732,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = (first_value ^ second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1756,7 +1751,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = (first_value ^ second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1781,7 +1776,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = (first_value | !second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1797,7 +1792,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = (first_value | !second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1814,7 +1809,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = (first_value | !second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1839,7 +1834,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = !(first_value & second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint8_t * result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1856,7 +1851,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = !(first_value & second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1874,7 +1869,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = !(first_value & second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1903,7 +1898,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = !(first_value | second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1919,7 +1914,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = !(first_value | second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint16_t * result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -1937,7 +1932,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = !(first_value | second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
uint32_t * result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -1965,7 +1960,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t first_value = (*first_ptr & 0x1);
uint8_t second_value = (*second_ptr & 0x1);
uint8_t result = !(first_value ^ second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint8_t *) vd[i].val;
*result_ptr = result;
@ -1983,7 +1978,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t first_value = (*first_ptr & 0x1);
uint16_t second_value = (*second_ptr & 0x1);
uint16_t result = !(first_value ^ second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint16_t *) vd[i].val;
*result_ptr = result;
@ -2002,7 +1997,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t first_value = (*first_ptr & 0x1);
uint32_t second_value = (*second_ptr & 0x1);
uint32_t result = !(first_value ^ second_value);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3, "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint32_t *) vd[i].val;
*result_ptr = result;
@ -2028,7 +2023,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint8_t *first_ptr = (uint8_t *)vr1[i].val;
uint8_t *second_ptr = (uint8_t *)vr2[i].val;
uint8_t result = (*first_ptr * *second_ptr);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint8_t *) vd[i].val;
*result_ptr += result;
@ -2044,7 +2039,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint16_t *first_ptr = (uint16_t *)vr1[i].val;
uint16_t *second_ptr = (uint16_t *)vr2[i].val;
uint16_t result = (*first_ptr * *second_ptr);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint16_t *) vd[i].val;
*result_ptr += result;
@ -2061,7 +2056,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
uint32_t *first_ptr = (uint32_t *)vr1[i].val;
uint32_t *second_ptr = (uint32_t *)vr2[i].val;
uint32_t result = (*first_ptr * *second_ptr);
cout << "Comparing " << *first_ptr << " + " << *second_ptr << " = " << result << '\n';
D(3,"Comparing " << *first_ptr << " + " << *second_ptr << " = " << result);
result_ptr = (uint32_t *) vd[i].val;
*result_ptr += result;
@ -2092,7 +2087,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
}
else if(reg[rsrc[0]] < 2*VLMAX) {
c.vl = (int)ceil((reg[rsrc[0]]*1.0)/2.0);
cout << "Length:" << c.vl << ceil(reg[rsrc[0]]/2) << endl;
D(3, "Length:" << c.vl << ceil(reg[rsrc[0]]/2));
}
else if(reg[rsrc[0]] >= (2*VLMAX)) {
c.vl = VLMAX;
@ -2176,9 +2171,9 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
// }
// }
cout << "Finished loop" << endl;
// cout << "Finished loop" << endl;
}
cout << "aaaaaaaaaaaaaaaaaaaaaa" << endl;
// cout << "aaaaaaaaaaaaaaaaaaaaaa" << endl;
break;
default:
{
@ -2194,10 +2189,10 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
VLMAX = (c.vtype.vlmul * c.VLEN)/c.vtype.vsew;
for(Word i = 0; i < c.vl; i++)
{
cout << "iter" << endl;
// cout << "iter" << endl;
++c.stores;
memAddr = reg[rsrc[0]] + (i*c.vtype.vsew/8);
std::cout << "STORE MEM ADDRESS *** : " << std::hex << memAddr << "\n";
// std::cout << "STORE MEM ADDRESS *** : " << std::hex << memAddr << "\n";
trace_inst->is_sw = true;
@ -2217,11 +2212,11 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
cout << "ERROR: UNSUPPORTED S INST\n" << flush;
exit(1);
}
cout << "Loop finished" << endl;
// cout << "Loop finished" << endl;
// c.memAccesses.push_back(Warp::MemAccess(true, memAddr));
}
cout << "After for loop" << endl;
// cout << "After for loop" << endl;
break;
default:
cout << "pc: " << hex << (c.pc-4) << "\n";
@ -2234,7 +2229,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
}
std::cout << "finished instruction" << endl << flush;
// std::cout << "finished instruction" << endl << flush;
D(3, "End instruction execute." << flush);
@ -2259,7 +2254,7 @@ void Instruction::executeOn(Warp &c, trace_inst_t * trace_inst) {
if (pcSet)
{
c.pc = nextPc;
cout << "Next PC: " << hex << nextPc << dec << "\n";
D(3,"Next PC: " << hex << nextPc << dec);
}
if (nextActiveThreads > c.reg.size()) {

View file

@ -3,4 +3,4 @@ echo start > results.txt
# echo ../kernel/vortex_test.hex
make
printf "Fasten your seatbelts ladies and gentelmen!!\n\n\n\n"
cd obj_dir && ./Vcache_simX -E -a rv32i --core ../../runtime/mains/vector_test/vx_vector_main.hex -s -b 1> emulator.debug
cd obj_dir && ./Vcache_simX -E -a rv32i --core ../../runtime/mains/simple/vx_simple_main.hex -s -b 1> emulator.debug