diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2006-03-01 12:43:04 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2006-03-01 12:43:04 -0500 |
commit | 1624d9e5458fbd02d2e21c6d88f78769680b78b0 (patch) | |
tree | 925cf2497d6c440e2b764bb7bda4a049580c7481 /sim | |
parent | 34da58a698e4119876f04d13c337e9974970f49a (diff) | |
parent | 26d7b5a4d1ee06ce314093facdbef6389ee1ec55 (diff) | |
download | gem5-1624d9e5458fbd02d2e21c6d88f78769680b78b0.tar.xz |
Merge zizzer:/bk/m5
into zeep.eecs.umich.edu:/z/saidi/work/m5.q
--HG--
extra : convert_revision : 4855ecfb3de652456a8be413c9e538c91709dcb6
Diffstat (limited to 'sim')
-rw-r--r-- | sim/pseudo_inst.cc | 38 | ||||
-rw-r--r-- | sim/pseudo_inst.hh | 5 |
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); |