Propogate the reset call to the extensions as well. Add reset function to extensions...
authorStephen Twigg <sdtwigg@eecs.berkeley.edu>
Tue, 15 Oct 2013 07:30:46 +0000 (00:30 -0700)
committerStephen Twigg <sdtwigg@eecs.berkeley.edu>
Tue, 15 Oct 2013 07:30:46 +0000 (00:30 -0700)
riscv/dummy-rocc.h
riscv/extension.h
riscv/processor.cc

index 55cd48f54d479a95e6fa80bc7894dcc3450a28fe..c74286e477b869be2b02d7d8f49daff583b33b61 100644 (file)
@@ -35,6 +35,11 @@ class dummy_rocc_t : public rocc_t
 
     return prev_acc; // in all cases, xd <- previous value of acc[rs2]
   }
+  
+  void reset()
+  {
+    for(int i = 0; i < num_acc; i++) acc[i] = 0;
+  }
 
  private:
   static const int num_acc = 4;
index 218deb4128df6f4ca60e128041ea02166e7e1387..7e9bfe59e0d6dd22c1c4bf4ab7d5a0b53778e74a 100644 (file)
@@ -15,6 +15,7 @@ class extension_t
   virtual ~extension_t();
 
   void set_processor(processor_t* _p) { p = _p; }
+  virtual void reset() {};
  protected:
   processor_t* p;
 
index 5c0d784c3aa51ee72877dcc8875352c4f69249a9..652a17033aad9d78a2c748f87760ac841ba0f402 100644 (file)
@@ -65,7 +65,8 @@ void processor_t::reset(bool value)
     return;
   run = !value;
 
-  state.reset();
+  state.reset(); // reset the core
+  ext->reset(); // reset the extension
 }
 
 uint32_t processor_t::set_fsr(uint32_t val)