From eb5d9ba72b0309e7f98c382e3a80ce0601dbe084 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 10 Nov 2008 11:51:18 -0800 Subject: pseudo inst: Add rpns (read processor nanoseconds) instruction. This instruction basically returns the number of nanoseconds that the CPU has been running. --- src/sim/pseudo_inst.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sim/pseudo_inst.cc') diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc index 409a6e009..e43279376 100644 --- a/src/sim/pseudo_inst.cc +++ b/src/sim/pseudo_inst.cc @@ -125,6 +125,12 @@ quiesceTime(ThreadContext *tc) return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns; } +uint64_t +rpns(ThreadContext *tc) +{ + return curTick / Clock::Int::ns; +} + void m5exit(ThreadContext *tc, Tick delay) { -- cgit v1.2.3