From: Andrew Waterman Date: Mon, 23 Jul 2012 04:01:18 +0000 (-0700) Subject: correct HTIF reset behavior X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07d126d57ede2d3c7e28fddd08338b2171f884bb;p=riscv-isa-sim.git correct HTIF reset behavior cores' reset signals can be independently toggled --- diff --git a/riscv/htif.cc b/riscv/htif.cc index 0ba995a..1be8d87 100644 --- a/riscv/htif.cc +++ b/riscv/htif.cc @@ -129,17 +129,8 @@ int htif_t::wait_for_packet() assert(p.data_size == 1); if (pcr_reg == PCR_RESET) { - if (p.data[0] & 1) - { - sim->procs[pcr_coreid]->reset(); - if (pcr_coreid == 0 && sim->procs[0]->running()) - sim->stop(); - } - else if (!sim->procs[pcr_coreid]->running()) - { - reset = false; - sim->procs[pcr_coreid]->deliver_ipi(); - } + reset = p.data[0] & 1; + sim->procs[pcr_coreid]->reset(reset); } else { diff --git a/riscv/processor.cc b/riscv/processor.cc index bc235fe..c116575 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -12,7 +12,7 @@ processor_t::processor_t(sim_t* _sim, mmu_t* _mmu, uint32_t _id) : sim(*_sim), mmu(*_mmu), id(_id), utidx(0) { - reset(); + reset(true); // create microthreads for (int i=0; i