gem5
v20.1.0.0
|
Timer based on standard POSIX timers. More...
#include <timer.hh>
Public Member Functions | |
PosixKvmTimer (int signo, clockid_t clockID, float hostFactor, Tick hostFreq) | |
~PosixKvmTimer () | |
void | arm (Tick ticks) override |
Arm the timer so that it fires after a certain number of ticks. More... | |
void | disarm () override |
Disarm the timer. More... | |
bool | expired () override |
Public Member Functions inherited from BaseKvmTimer | |
BaseKvmTimer (int signo, float hostFactor, Tick hostFreq) | |
Setup basic timer functionality shared by all timer implementations. More... | |
virtual | ~BaseKvmTimer () |
Tick | resolution () |
Determine the resolution of the timer in ticks. More... | |
Tick | ticksFromHostCycles (uint64_t cycles) |
Convert cycles executed on the host into Ticks executed in the simulator. More... | |
Tick | ticksFromHostNs (uint64_t ns) |
Convert nanoseconds executed on the host into Ticks executed in the simulator. More... | |
Protected Member Functions | |
Tick | calcResolution () override |
Calculate the timer resolution, used by resolution() which caches the result. More... | |
Protected Member Functions inherited from BaseKvmTimer | |
uint64_t | hostNs (Tick ticks) |
Convert a time in simulator ticks to host nanoseconds. More... | |
uint64_t | hostCycles (Tick ticks) |
Convert a time in simulator ticks to host cycles. More... | |
Private Attributes | |
clockid_t | clockID |
timer_t | timer |
struct itimerspec | prevTimerSpec |
Additional Inherited Members | |
Protected Attributes inherited from BaseKvmTimer | |
int | signo |
Signal to deliver when the timer times out. More... | |
Timer based on standard POSIX timers.
The POSIX timer API supports several different clock with different characteristics.
PosixKvmTimer::PosixKvmTimer | ( | int | signo, |
clockid_t | clockID, | ||
float | hostFactor, | ||
Tick | hostFreq | ||
) |
signo | Signal to deliver |
clockID | ID of the clock to use |
hostFactor | Performance scaling factor |
hostFreq | Clock frequency of the host |
Definition at line 76 of file timer.cc.
References clockID, panic, BaseKvmTimer::signo, sysGettid(), and timer.
|
overridevirtual |
Arm the timer so that it fires after a certain number of ticks.
ticks | Number of ticks until the timer fires |
Implements BaseKvmTimer.
Definition at line 100 of file timer.cc.
References DPRINTF, BaseKvmTimer::hostNs(), panic, timer, ArmISA::ts, and ULL.
|
overrideprotectedvirtual |
Calculate the timer resolution, used by resolution() which caches the result.
Implements BaseKvmTimer.
Definition at line 141 of file timer.cc.
References clockID, MIN_HOST_CYCLES, panic, BaseKvmTimer::resolution(), BaseKvmTimer::ticksFromHostCycles(), BaseKvmTimer::ticksFromHostNs(), ArmISA::ts, and ULL.
|
overridevirtual |
Disarm the timer.
When this method has returned, the timer may no longer deliver signals upon timeout.
Implements BaseKvmTimer.
Definition at line 120 of file timer.cc.
References DPRINTF, panic, prevTimerSpec, timer, and ArmISA::ts.
|
overridevirtual |
|
private |
Definition at line 205 of file timer.hh.
Referenced by calcResolution(), and PosixKvmTimer().
|
private |
|
private |
Definition at line 206 of file timer.hh.
Referenced by arm(), disarm(), PosixKvmTimer(), and ~PosixKvmTimer().