summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-03-02 21:44:43 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-03-02 21:44:43 -0500
commitdd0d8e628742c824cd5074433dc97ff7ebd92497 (patch)
tree1e905144a1b0d4cae4859b17f9f2d335f3c67b11 /sim
parent6b7d62790399f3ff675e5d37a25c320aa068897a (diff)
parent0fed64a6a47a62a94a53c5f41ac89b34a2fd6786 (diff)
downloadgem5-dd0d8e628742c824cd5074433dc97ff7ebd92497.tar.xz
Merge gblack@m5.eecs.umich.edu:/bk/multiarch
into ewok.(none):/home/gblack/m5/multiarch --HG-- extra : convert_revision : f6db244a66431dd6b8c5ba251ed02d76cd509cff
Diffstat (limited to 'sim')
-rw-r--r--sim/pseudo_inst.cc38
-rw-r--r--sim/pseudo_inst.hh5
2 files changed, 41 insertions, 2 deletions
diff --git a/sim/pseudo_inst.cc b/sim/pseudo_inst.cc
index 36c854d1c..3effef7ae 100644
--- a/sim/pseudo_inst.cc
+++ b/sim/pseudo_inst.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2005 The Regents of The University of Michigan
+ * Copyright (c) 2003-2006 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -78,6 +78,42 @@ namespace AlphaPseudo
}
void
+ quiesceNs(ExecContext *xc, uint64_t ns)
+ {
+ if (!doQuiesce || ns == 0)
+ return;
+
+ if (xc->quiesceEvent.scheduled())
+ xc->quiesceEvent.reschedule(curTick + Clock::Int::ns * ns);
+ else
+ xc->quiesceEvent.schedule(curTick + Clock::Int::ns * ns);
+
+ xc->suspend();
+ xc->kernelStats->quiesce();
+ }
+
+ void
+ quiesceCycles(ExecContext *xc, uint64_t cycles)
+ {
+ if (!doQuiesce || cycles == 0)
+ return;
+
+ if (xc->quiesceEvent.scheduled())
+ xc->quiesceEvent.reschedule(curTick + xc->cpu->cycles(cycles));
+ else
+ xc->quiesceEvent.schedule(curTick + xc->cpu->cycles(cycles));
+
+ xc->suspend();
+ xc->kernelStats->quiesce();
+ }
+
+ uint64_t
+ quiesceTime(ExecContext *xc)
+ {
+ return (xc->lastActivate - xc->lastSuspend) / Clock::Int::ns ;
+ }
+
+ void
ivlb(ExecContext *xc)
{
xc->kernelStats->ivlb();
diff --git a/sim/pseudo_inst.hh b/sim/pseudo_inst.hh
index 3857f2050..4dd427c99 100644
--- a/sim/pseudo_inst.hh
+++ b/sim/pseudo_inst.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2005 The Regents of The University of Michigan
+ * Copyright (c) 2003-2006 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,6 +44,9 @@ namespace AlphaPseudo
void arm(ExecContext *xc);
void quiesce(ExecContext *xc);
+ void quiesceNs(ExecContext *xc, uint64_t ns);
+ void quiesceCycles(ExecContext *xc, uint64_t cycles);
+ uint64_t quiesceTime(ExecContext *xc);
void ivlb(ExecContext *xc);
void ivle(ExecContext *xc);
void m5exit(ExecContext *xc, Tick delay);