diff options
author | Steve Reinhardt ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E%2C%20Ali%20Saidi%20%3CAli.Saidi%40ARM.com%3E) <stever@gmail.com> | 2013-11-25 11:21:00 -0600 |
---|---|---|
committer | Steve Reinhardt ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E%2C%20Ali%20Saidi%20%3CAli.Saidi%40ARM.com%3E) <stever@gmail.com> | 2013-11-25 11:21:00 -0600 |
commit | de366a16f11b7e27a5b5e064a2a773052568428e (patch) | |
tree | 9bed0ebc9801c118e0f17702a979a659a59a67df /src/sim/debug.cc | |
parent | 8a53da22c2f07aed924a45ab296f7468d842d7f6 (diff) | |
download | gem5-de366a16f11b7e27a5b5e064a2a773052568428e.tar.xz |
sim: simulate with multiple threads and event queues
This patch adds support for simulating with multiple threads, each of
which operates on an event queue. Each sim object specifies which eventq
is would like to be on. A custom barrier implementation is being added
using which eventqs synchronize.
The patch was tested in two different configurations:
1. ruby_network_test.py: in this simulation L1 cache controllers receive
requests from the cpu. The requests are replied to immediately without
any communication taking place with any other level.
2. twosys-tsunami-simple-atomic: this configuration simulates a client-server
system which are connected by an ethernet link.
We still lack the ability to communicate using message buffers or ports. But
other things like simulation start and end, synchronizing after every quantum
are working.
Committed by: Nilay Vaish
Diffstat (limited to 'src/sim/debug.cc')
-rw-r--r-- | src/sim/debug.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/sim/debug.cc b/src/sim/debug.cc index bfb28198d..0dd16a88d 100644 --- a/src/sim/debug.cc +++ b/src/sim/debug.cc @@ -37,6 +37,7 @@ #include "base/debug.hh" #include "sim/debug.hh" #include "sim/eventq_impl.hh" +#include "sim/global_event.hh" #include "sim/sim_events.hh" #include "sim/sim_exit.hh" @@ -46,9 +47,9 @@ using namespace std; // Debug event: place a breakpoint on the process function and // schedule the event to break at a particular cycle // -struct DebugBreakEvent : public Event +struct DebugBreakEvent : public GlobalEvent { - DebugBreakEvent(); + DebugBreakEvent(Tick when); void process(); // process event virtual const char *description() const; }; @@ -56,8 +57,8 @@ struct DebugBreakEvent : public Event // // constructor: schedule at specified time // -DebugBreakEvent::DebugBreakEvent() - : Event(Debug_Break_Pri, AutoDelete) +DebugBreakEvent::DebugBreakEvent(Tick when) + : GlobalEvent(when, Debug_Break_Pri, AutoDelete) { } @@ -84,7 +85,7 @@ DebugBreakEvent::description() const void schedBreak(Tick when) { - mainEventQueue.schedule(new DebugBreakEvent, when); + new DebugBreakEvent(when); warn("need to stop all queues"); } @@ -102,8 +103,9 @@ takeCheckpoint(Tick when) void eventqDump() { - mainEventQueue.dump(); - warn("need to dump all queues"); + for (uint32_t i = 0; i < numMainEventQueues; ++i) { + mainEventQueue[i]->dump(); + } } void |