adapt to extended instrumentation interface

This commit is contained in:
Eyck Jentzsch 2022-02-09 21:01:17 +01:00
parent ac86f14a54
commit b8fa5fbbda
4 changed files with 12 additions and 1 deletions

View File

@ -169,7 +169,6 @@ struct ${coreDef.name.toLowerCase()}: public arch_if {
}}%> }}%>
uint32_t trap_state = 0, pending_trap = 0; uint32_t trap_state = 0, pending_trap = 0;
uint64_t icount = 0; uint64_t icount = 0;
uint64_t cycle = 0;
uint64_t instret = 0; uint64_t instret = 0;
uint32_t last_branch; uint32_t last_branch;
} reg; } reg;

View File

@ -237,6 +237,10 @@ protected:
uint64_t get_next_pc() override { return arch.get_next_pc(); }; uint64_t get_next_pc() override { return arch.get_next_pc(); };
uint64_t get_instr_count() { return arch.reg.icount; }
uint64_t get_total_cycles() override { return arch.reg.icount + arch.cycle_offset; }
void set_curr_instr_cycles(unsigned cycles) override { arch.cycle_offset += cycles - 1; }; void set_curr_instr_cycles(unsigned cycles) override { arch.cycle_offset += cycles - 1; };
riscv_hart_m_p<BASE, FEAT> &arch; riscv_hart_m_p<BASE, FEAT> &arch;

View File

@ -340,6 +340,10 @@ protected:
virtual uint64_t get_next_pc() { return arch.get_next_pc(); }; virtual uint64_t get_next_pc() { return arch.get_next_pc(); };
uint64_t get_instr_count() { return arch.reg.icount; }
uint64_t get_total_cycles() override { return arch.reg.icount + arch.cycle_offset; }
virtual void set_curr_instr_cycles(unsigned cycles) { arch.cycle_offset += cycles - 1; }; virtual void set_curr_instr_cycles(unsigned cycles) { arch.cycle_offset += cycles - 1; };
riscv_hart_msu_vp<BASE> &arch; riscv_hart_msu_vp<BASE> &arch;

View File

@ -252,6 +252,10 @@ protected:
virtual uint64_t get_next_pc() { return arch.get_next_pc(); }; virtual uint64_t get_next_pc() { return arch.get_next_pc(); };
uint64_t get_instr_count() { return arch.reg.icount; }
uint64_t get_total_cycles() override { return arch.reg.icount + arch.cycle_offset; }
virtual void set_curr_instr_cycles(unsigned cycles) { arch.cycle_offset += cycles - 1; }; virtual void set_curr_instr_cycles(unsigned cycles) { arch.cycle_offset += cycles - 1; };
riscv_hart_mu_p<BASE, FEAT> &arch; riscv_hart_mu_p<BASE, FEAT> &arch;