From 07d126d57ede2d3c7e28fddd08338b2171f884bb Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 22 Jul 2012 21:01:18 -0700 Subject: [PATCH] correct HTIF reset behavior cores' reset signals can be independently toggled --- riscv/htif.cc | 13 ++----------- riscv/processor.cc | 29 ++++++++++++----------------- riscv/processor.h | 5 ++--- 3 files changed, 16 insertions(+), 31 deletions(-) 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