Fix spike interactive (-d) mode
authorAndrew Waterman <waterman@cs.berkeley.edu>
Fri, 26 Aug 2016 03:24:14 +0000 (20:24 -0700)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Fri, 26 Aug 2016 03:24:14 +0000 (20:24 -0700)
riscv/execute.cc
riscv/insns/dret.h
riscv/processor.cc
riscv/processor.h

index 3d5625f49d82a33becab95c35fdfaf73bfaf3bb4..0cb70e584e3d9b64635cf48104d27b38e99059e0 100644 (file)
@@ -51,11 +51,9 @@ static reg_t execute_insn(processor_t* p, reg_t pc, insn_fetch_t fetch)
   return npc;
 }
 
-void processor_t::update_slow_path()
+bool processor_t::slow_path()
 {
-  slow_path = debug || state.single_step != state.STEP_NONE || state.dcsr.cause;
-  if (slow_path)
-    return;
+  return debug || state.single_step != state.STEP_NONE || state.dcsr.cause;
 }
 
 // fetch/decode/execute loop
@@ -97,7 +95,7 @@ void processor_t::step(size_t n)
     {
       take_interrupt();
 
-      if (unlikely(slow_path))
+      if (unlikely(slow_path()))
       {
         while (instret < n)
         {
index 51eaa17ad7b8aa67c472daa41926453fe349292d..35c19cb8a29090b774ff8c7a1fa091aa36428e21 100644 (file)
@@ -7,5 +7,3 @@ STATE.dcsr.cause = 0;
 
 if (STATE.dcsr.step)
   STATE.single_step = STATE.STEP_STEPPING;
-
-p->update_slow_path();
index 51f40610c02f9196a57c4fceb04c9e30f7888048..7d8c5df64e9cb6f78d3b57c810983d5c22aec2cd 100644 (file)
@@ -202,8 +202,6 @@ void processor_t::enter_debug_mode(uint8_t cause)
   set_privilege(PRV_M);
   state.dpc = state.pc;
   state.pc = DEBUG_ROM_START;
-  //debug = true; // TODO
-  update_slow_path();
 }
 
 void processor_t::take_trap(trap_t& t, reg_t epc)
index ab3af22930ab64e321d78d3e83a995f62a250be8..3f8c4def59b4e71be280bc1d0a8629cbe74beacc 100644 (file)
@@ -189,7 +189,8 @@ public:
 
   // When true, display disassembly of each instruction that's executed.
   bool debug;
-  void update_slow_path();
+  // When true, take the slow simulation path.
+  bool slow_path();
 
   // Return the index of a trigger that matched, or -1.
   inline int trigger_match(trigger_operation_t operation, reg_t address, reg_t data)
@@ -294,8 +295,6 @@ private:
   std::string isa_string;
   bool histogram_enabled;
   bool halt_on_reset;
-  // When true, take the slow simulation path.
-  bool slow_path;
 
   std::vector<insn_desc_t> instructions;
   std::map<reg_t,uint64_t> pc_histogram;