X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=riscv%2Fsim.h;h=97e9edecb8dc08d758a4c4c46bace1127dd670c6;hb=d6fcfdebf6a893bf37670fd67203d18653df4a0e;hp=638206e11b329249e04f6b8c37ba0dee1280229b;hpb=4a97a05a6e806f7abcb6cd30685093aa5b9331a9;p=riscv-isa-sim.git diff --git a/riscv/sim.h b/riscv/sim.h index 638206e..97e9ede 100644 --- a/riscv/sim.h +++ b/riscv/sim.h @@ -6,6 +6,7 @@ #include "processor.h" #include "devices.h" #include "debug_module.h" +#include "simif.h" #include #include #include @@ -15,17 +16,6 @@ class mmu_t; class remote_bitbang_t; -// this is the interface to the simulator used by the processors and memory -class simif_t -{ -public: - // should return NULL for MMIO addresses - virtual char* addr_to_mem(reg_t addr) = 0; - // used for MMIO addresses - virtual bool mmio_load(reg_t addr, size_t len, uint8_t* bytes) = 0; - virtual bool mmio_store(reg_t addr, size_t len, const uint8_t* bytes) = 0; -}; - // this class encapsulates the processors and memory in a RISC-V machine. class sim_t : public htif_t, public simif_t { @@ -33,7 +23,7 @@ public: sim_t(const char* isa, size_t _nprocs, bool halted, reg_t start_pc, std::vector> mems, const std::vector& args, const std::vector hartids, - unsigned progsize, unsigned max_bus_master_bits); + unsigned progsize, unsigned max_bus_master_bits, bool require_authentication); ~sim_t(); // run the simulation to completion @@ -49,6 +39,9 @@ public: processor_t* get_core(size_t i) { return procs.at(i); } unsigned nprocs() const { return procs.size(); } + // Callback for processors to let the simulation know they were reset. + void proc_reset(unsigned id); + private: std::vector> mems; mmu_t* debug_mmu; // debug port into main memory