reg_t data;
};
+typedef struct
+{
+ uint8_t prv;
+ bool step;
+ bool ebreakm;
+ bool ebreakh;
+ bool ebreaks;
+ bool ebreaku;
+ bool halt;
+ uint8_t cause;
+} dcsr_t;
+
// architectural state of a RISC-V hart
struct state_t
{
reg_t stvec;
reg_t sptbr;
reg_t scause;
+ reg_t dpc;
+ reg_t dscratch;
+ dcsr_t dcsr;
+
uint32_t fflags;
uint32_t frm;
bool serialized; // whether timer CSRs are in a well-defined state
bool load(reg_t addr, size_t len, uint8_t* bytes);
bool store(reg_t addr, size_t len, const uint8_t* bytes);
+ // When true, display disassembly of each instruction that's executed.
+ bool debug;
+
private:
sim_t* sim;
mmu_t* mmu; // main memory is always accessed via the mmu
reg_t isa;
std::string isa_string;
bool run; // !reset
- bool debug;
bool histogram_enabled;
std::vector<insn_desc_t> instructions;
void take_trap(trap_t& t, reg_t epc); // take an exception
void disasm(insn_t insn); // disassemble and print an instruction
+ void enter_debug_mode(uint8_t cause);
+
friend class sim_t;
friend class mmu_t;
friend class rtc_t;
friend class extension_t;
- friend class gdbserver_t;
void parse_isa_string(const char* isa);
void build_opcode_map();