|
|
|
@ -23,7 +23,7 @@ |
|
|
|
#undef STATE |
|
|
|
#define STATE state |
|
|
|
|
|
|
|
processor_t::processor_t(isa_parser_t isa, const char* varch, |
|
|
|
processor_t::processor_t(const isa_parser_t *isa, const char* varch, |
|
|
|
simif_t* sim, uint32_t id, bool halt_on_reset, |
|
|
|
FILE* log_file, std::ostream& sout_) |
|
|
|
: debug(false), halt_request(HR_NONE), isa(isa), sim(sim), id(id), xlen(0), |
|
|
|
@ -46,16 +46,16 @@ processor_t::processor_t(isa_parser_t isa, const char* varch, |
|
|
|
register_base_instructions(); |
|
|
|
mmu = new mmu_t(sim, this); |
|
|
|
|
|
|
|
disassembler = new disassembler_t(&isa); |
|
|
|
for (auto e : isa.get_extensions()) |
|
|
|
disassembler = new disassembler_t(isa); |
|
|
|
for (auto e : isa->get_extensions()) |
|
|
|
register_extension(e.second); |
|
|
|
|
|
|
|
set_pmp_granularity(1 << PMP_SHIFT); |
|
|
|
set_pmp_num(state.max_pmp); |
|
|
|
|
|
|
|
if (isa.get_max_xlen() == 32) |
|
|
|
if (isa->get_max_xlen() == 32) |
|
|
|
set_mmu_capability(IMPL_MMU_SV32); |
|
|
|
else if (isa.get_max_xlen() == 64) |
|
|
|
else if (isa->get_max_xlen() == 64) |
|
|
|
set_mmu_capability(IMPL_MMU_SV48); |
|
|
|
|
|
|
|
set_impl(IMPL_MMU_ASID, true); |
|
|
|
@ -486,8 +486,8 @@ void processor_t::enable_log_commits() |
|
|
|
|
|
|
|
void processor_t::reset() |
|
|
|
{ |
|
|
|
xlen = isa.get_max_xlen(); |
|
|
|
state.reset(this, isa.get_max_isa()); |
|
|
|
xlen = isa->get_max_xlen(); |
|
|
|
state.reset(this, isa->get_max_isa()); |
|
|
|
state.dcsr->halt = halt_on_reset; |
|
|
|
halt_on_reset = false; |
|
|
|
VU.reset(); |
|
|
|
@ -624,7 +624,7 @@ void processor_t::take_interrupt(reg_t pending_interrupts) |
|
|
|
else |
|
|
|
abort(); |
|
|
|
|
|
|
|
throw trap_t(((reg_t)1 << (isa.get_max_xlen()-1)) | ctz(enabled_interrupts)); |
|
|
|
throw trap_t(((reg_t)1 << (isa->get_max_xlen()-1)) | ctz(enabled_interrupts)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -688,7 +688,7 @@ void processor_t::debug_output_log(std::stringstream *s) |
|
|
|
|
|
|
|
void processor_t::take_trap(trap_t& t, reg_t epc) |
|
|
|
{ |
|
|
|
unsigned max_xlen = isa.get_max_xlen(); |
|
|
|
unsigned max_xlen = isa->get_max_xlen(); |
|
|
|
|
|
|
|
if (debug) { |
|
|
|
std::stringstream s; // first put everything in a string, later send it to output
|
|
|
|
@ -813,7 +813,7 @@ void processor_t::disasm(insn_t insn) |
|
|
|
<< ": Executed " << executions << " times" << std::endl; |
|
|
|
} |
|
|
|
|
|
|
|
unsigned max_xlen = isa.get_max_xlen(); |
|
|
|
unsigned max_xlen = isa->get_max_xlen(); |
|
|
|
|
|
|
|
s << "core " << std::dec << std::setfill(' ') << std::setw(3) << id |
|
|
|
<< std::hex << ": 0x" << std::setfill('0') << std::setw(max_xlen/4) |
|
|
|
@ -832,7 +832,7 @@ void processor_t::disasm(insn_t insn) |
|
|
|
|
|
|
|
int processor_t::paddr_bits() |
|
|
|
{ |
|
|
|
unsigned max_xlen = isa.get_max_xlen(); |
|
|
|
unsigned max_xlen = isa->get_max_xlen(); |
|
|
|
assert(xlen == max_xlen); |
|
|
|
return max_xlen == 64 ? 50 : 34; |
|
|
|
} |
|
|
|
|