|
gem5
v22.1.0.0
|
PerfEvent based timer using the host's CPU cycle counter. More...
#include <timer.hh>
Public Member Functions | |
| PerfKvmTimer (PerfKvmCounter &ctr, int signo, float hostFactor, Tick hostFreq) | |
| Create a timer that uses an existing hardware cycle counter. More... | |
| ~PerfKvmTimer () | |
| void | arm (Tick ticks) |
| Arm the timer so that it fires after a certain number of ticks. More... | |
| void | disarm () |
| Disarm the timer. More... | |
Public Member Functions inherited from gem5::BaseKvmTimer | |
| BaseKvmTimer (int signo, float hostFactor, Tick hostFreq) | |
| Setup basic timer functionality shared by all timer implementations. More... | |
| virtual | ~BaseKvmTimer () |
| virtual bool | expired () |
| 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 () |
| Calculate the timer resolution, used by resolution() which caches the result. More... | |
Protected Member Functions inherited from gem5::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 | |
| PerfKvmCounter & | hwOverflow |
Additional Inherited Members | |
Protected Attributes inherited from gem5::BaseKvmTimer | |
| int | signo |
| Signal to deliver when the timer times out. More... | |
PerfEvent based timer using the host's CPU cycle counter.
| gem5::PerfKvmTimer::PerfKvmTimer | ( | PerfKvmCounter & | ctr, |
| int | signo, | ||
| float | hostFactor, | ||
| Tick | hostFreq | ||
| ) |
Create a timer that uses an existing hardware cycle counter.
| ctr | Attached performance counter configured for overflow reporting. |
| signo | Signal to deliver |
| hostFactor | Performance scaling factor |
| hostFreq | Clock frequency of the host |
Definition at line 171 of file timer.cc.
References gem5::PerfKvmCounter::enableSignals(), hwOverflow, and gem5::BaseKvmTimer::signo.
|
virtual |
Arm the timer so that it fires after a certain number of ticks.
| ticks | Number of ticks until the timer fires |
Implements gem5::BaseKvmTimer.
Definition at line 184 of file timer.cc.
References gem5::BaseKvmTimer::hostCycles(), hwOverflow, gem5::PerfKvmCounter::period(), and gem5::PerfKvmCounter::refresh().
|
protectedvirtual |
Calculate the timer resolution, used by resolution() which caches the result.
Implements gem5::BaseKvmTimer.
Definition at line 197 of file timer.cc.
References gem5::MIN_HOST_CYCLES, and gem5::BaseKvmTimer::ticksFromHostCycles().
|
virtual |
Disarm the timer.
When this method has returned, the timer may no longer deliver signals upon timeout.
Implements gem5::BaseKvmTimer.
Definition at line 191 of file timer.cc.
References hwOverflow, and gem5::PerfKvmCounter::stop().
|
private |
Definition at line 250 of file timer.hh.
Referenced by arm(), disarm(), and PerfKvmTimer().