deepjit/sim: keep to element in r6 / print current pc at exec
[calu.git] / 3b_sim / ccpu.cpp
index 3c0049bc9ca1a4684816f7d85be5cd0b221abf8b..d314b5ef8b2c19961e2670492401f8aaf82f141f 100644 (file)
@@ -40,6 +40,16 @@ void CCpu::applyToExtensions(const vector<string>& in)
        }
 }
 
+void CCpu::breakNext()
+{
+       m_breakNext = true;
+}
+
+bool CCpu::shouldBreak()
+{
+       return m_breakNext;
+}
+
 void CCpu::tick()
 {
        // signal extensions
@@ -58,7 +68,7 @@ void CCpu::tick()
        }
 
        if(this->conditionMet(instr->getCondition())) {
-               cout << color(green,black) << "Executing: " << color(white,black) << colorifyInstr(instr->toString()) << endl;
+               cout << color(green,black) << "Executing: " << color(white,black) << colorifyInstr(instr->toString()) << " (0x" << std::hex << m_pc << std::dec << ")" << endl;
                instr->execInstr();
                this->incPerfBy(instr->getClockCount());
        }
@@ -273,7 +283,7 @@ void CCpu::incPerfBy(short inc)
 }
 
 
-CCpu::CCpu(int regs, int ram, int prog) : m_Z(false), m_S(false), m_C(false), m_O(false), m_pc(0), m_pc_next(0), m_perf(0), m_reg(regs), m_ram(ram), m_prog(prog), m_exts(0), m_stack(0)
+CCpu::CCpu(int regs, int ram, int prog) : m_Z(false), m_S(false), m_C(false), m_O(false), m_breakNext(0), m_pc(0), m_pc_next(0), m_perf(0), m_reg(regs), m_ram(ram), m_prog(prog), m_exts(0), m_stack(0)
 {
 }