summaryrefslogtreecommitdiff
path: root/src/sim/pseudo_inst.cc
diff options
context:
space:
mode:
authorGabor Dozsa <gabor.dozsa@arm.com>2016-01-07 16:33:47 -0600
committerGabor Dozsa <gabor.dozsa@arm.com>2016-01-07 16:33:47 -0600
commit5dec4e07b89786aa67ce64aadeeb14c81b3977b3 (patch)
tree44535119ad1f458cbe2a26b56c8c8377a25fe0ff /src/sim/pseudo_inst.cc
parente67749426054d8ddb7f11b53a89741d4808f3acb (diff)
downloadgem5-5dec4e07b89786aa67ce64aadeeb14c81b3977b3.tar.xz
dev: Distributed Ethernet link for distributed gem5 simulations
Distributed gem5 (abbreviated dist-gem5) is the result of the convergence effort between multi-gem5 and pd-gem5 (from Univ. of Wisconsin). It relies on the base multi-gem5 infrastructure for packet forwarding, synchronisation and checkpointing but combines those with the elaborated network switch model from pd-gem5. --HG-- rename : src/dev/net/multi_etherlink.cc => src/dev/net/dist_etherlink.cc rename : src/dev/net/multi_etherlink.hh => src/dev/net/dist_etherlink.hh rename : src/dev/net/multi_iface.cc => src/dev/net/dist_iface.cc rename : src/dev/net/multi_iface.hh => src/dev/net/dist_iface.hh rename : src/dev/net/multi_packet.hh => src/dev/net/dist_packet.hh
Diffstat (limited to 'src/sim/pseudo_inst.cc')
-rw-r--r--src/sim/pseudo_inst.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc
index 0f7de0c3a..67c47ce77 100644
--- a/src/sim/pseudo_inst.cc
+++ b/src/sim/pseudo_inst.cc
@@ -63,8 +63,10 @@
#include "debug/PseudoInst.hh"
#include "debug/Quiesce.hh"
#include "debug/WorkItems.hh"
+#include "dev/net/dist_iface.hh"
#include "params/BaseCPU.hh"
#include "sim/full_system.hh"
+#include "sim/initparam_keys.hh"
#include "sim/process.hh"
#include "sim/pseudo_inst.hh"
#include "sim/serialize.hh"
@@ -357,8 +359,10 @@ void
m5exit(ThreadContext *tc, Tick delay)
{
DPRINTF(PseudoInst, "PseudoInst::m5exit(%i)\n", delay);
- Tick when = curTick() + delay * SimClock::Int::ns;
- exitSimLoop("m5_exit instruction encountered", 0, when, 0, true);
+ if (DistIface::readyToExit(delay)) {
+ Tick when = curTick() + delay * SimClock::Int::ns;
+ exitSimLoop("m5_exit instruction encountered", 0, when, 0, true);
+ }
}
void
@@ -471,10 +475,14 @@ initParam(ThreadContext *tc, uint64_t key_str1, uint64_t key_str2)
// Compare the key parameter with the known values to select the return
// value
uint64_t val;
- if (strlen(key_str) == 0) {
+ if (strcmp(key_str, InitParamKey::DEFAULT) == 0) {
val = tc->getCpuPtr()->system->init_param;
+ } else if (strcmp(key_str, InitParamKey::DIST_RANK) == 0) {
+ val = DistIface::rankParam();
+ } else if (strcmp(key_str, InitParamKey::DIST_SIZE) == 0) {
+ val = DistIface::sizeParam();
} else {
- panic("Unknown key for initparam pseudo instruction");
+ panic("Unknown key for initparam pseudo instruction:\"%s\"", key_str);
}
return val;
}
@@ -529,10 +537,11 @@ m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
return;
- Tick when = curTick() + delay * SimClock::Int::ns;
- Tick repeat = period * SimClock::Int::ns;
-
- exitSimLoop("checkpoint", 0, when, repeat);
+ if (DistIface::readyToCkpt(delay, period)) {
+ Tick when = curTick() + delay * SimClock::Int::ns;
+ Tick repeat = period * SimClock::Int::ns;
+ exitSimLoop("checkpoint", 0, when, repeat);
+ }
}
uint64_t