From 2183afefb8f8534ff43d76ea93d7ac0b0e060fc8 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 15 May 2012 18:31:03 -0700 Subject: [PATCH] fix htif interaction with interactive mode --- riscv/interactive.cc | 2 -- riscv/sim.cc | 13 ++++++++----- riscv/sim.h | 5 +---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/riscv/interactive.cc b/riscv/interactive.cc index a81e2f2..5ba6d23 100644 --- a/riscv/interactive.cc +++ b/riscv/interactive.cc @@ -242,8 +242,6 @@ void sim_t::interactive_until(const std::string& cmd, const std::vectorstore_uint32(4, num_cores()); - //htif->wait_for_start(); + htif->wait_for_start(); for(running = true; running; ) { @@ -82,8 +81,12 @@ void sim_t::run(bool debug) void sim_t::step_all(size_t n, size_t interleave, bool noisy) { - htif->wait_for_packet(); for(size_t j = 0; j < n; j+=interleave) + { + if (steps % 16384 + interleave >= 16384) + htif->wait_for_packet(); + steps += interleave; for(int i = 0; i < (int)num_cores(); i++) procs[i]->step(interleave,noisy); + } } diff --git a/riscv/sim.h b/riscv/sim.h index 8109b50..51e33d4 100644 --- a/riscv/sim.h +++ b/riscv/sim.h @@ -27,10 +27,6 @@ public: private: htif_t* htif; - // global registers for communication with host machine - reg_t tohost; - reg_t fromhost; - // main memory, shared between processors char* mem; size_t memsz; // memory size in bytes @@ -42,6 +38,7 @@ private: // terminate the simulation loop after the current iteration void stop() { running = false; } bool running; + size_t steps; // run each processor for n instructions; interleave instructions are // run on a processor before moving on to the next processor. -- 2.30.2