Add --dump-config-string flag
[riscv-isa-sim.git] / riscv / sim.h
index 636190e1107326485cdf6f0e1428bb8a740537fa..d8f39e2e73ed9e7637bf55834dc303d00a2cf1ae 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include "processor.h"
 #include "mmu.h"
+#include "devices.h"
 
 class htif_isasim_t;
 
@@ -28,9 +29,7 @@ public:
   void set_histogram(bool value);
   void set_procs_debug(bool value);
   htif_isasim_t* get_htif() { return htif.get(); }
-
-  // deliver an IPI to a specific processor
-  void send_ipi(reg_t who);
+  const char* get_config_string() { return &config_string->contents()[0]; }
 
   // returns the number of processors in this simulator
   size_t num_cores() { return procs.size(); }
@@ -45,12 +44,15 @@ private:
   size_t memsz; // memory size in bytes
   mmu_t* debug_mmu;  // debug port into main memory
   std::vector<processor_t*> procs;
+  std::unique_ptr<rom_device_t> config_string;
+  std::unique_ptr<rtc_t> rtc;
+  reg_t config_string_addr;
+  bus_t bus;
 
   processor_t* get_core(const std::string& i);
   void step(size_t n); // step through simulation
   static const size_t INTERLEAVE = 5000;
   static const size_t INSNS_PER_RTC_TICK = 100; // 10 MHz clock for 1 BIPS core
-  reg_t rtc;
   size_t current_step;
   size_t current_proc;
   bool debug;
@@ -60,6 +62,7 @@ private:
   // memory-mapped I/O routines
   bool mmio_load(reg_t addr, size_t len, uint8_t* bytes);
   bool mmio_store(reg_t addr, size_t len, const uint8_t* bytes);
+  void make_config_string();
 
   // presents a prompt for introspection into the simulation
   void interactive();