|
gem5
v19.0.0.0
|
#include <timer_cpulocal.hh>
Public Types | |
| enum | { TimerLoadReg = 0x00, TimerCounterReg = 0x04, TimerControlReg = 0x08, TimerIntStatusReg = 0x0C, WatchdogLoadReg = 0x20, WatchdogCounterReg = 0x24, WatchdogControlReg = 0x28, WatchdogIntStatusReg = 0x2C, WatchdogResetStatusReg = 0x30, WatchdogDisableReg = 0x34, Size = 0x38 } |
Public Member Functions | |
| BitUnion32 (TimerCtrl) Bitfield< 0 > enable | |
| EndBitUnion (TimerCtrl) BitUnion32(WatchdogCtrl) Bitfield< 0 > enable | |
| void | timerAtZero () |
| Called when the counter reaches 0. More... | |
| void | watchdogAtZero () |
| void | restartTimerCounter (uint32_t val) |
| Restart the counter ticking at val. More... | |
| void | restartWatchdogCounter (uint32_t val) |
| Timer (const std::string &name, CpuLocalTimer *_parent, ArmInterruptPin *int_timer, ArmInterruptPin *int_watchdog) | |
| std::string | name () const |
| void | read (PacketPtr pkt, Addr daddr) |
| Handle read for a single timer. More... | |
| void | write (PacketPtr pkt, Addr daddr) |
| Handle write for a single timer. More... | |
| void | serialize (CheckpointOut &cp) const override |
| Serialize an object. More... | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. More... | |
Public Member Functions inherited from Serializable | |
| Serializable () | |
| virtual | ~Serializable () |
| void | serializeSection (CheckpointOut &cp, const char *name) const |
| Serialize an object into a new section. More... | |
| void | serializeSection (CheckpointOut &cp, const std::string &name) const |
| void | unserializeSection (CheckpointIn &cp, const char *name) |
| Unserialize an a child object. More... | |
| void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
| Bitfield< 1 > | autoReload |
| Bitfield< 2 > | intEnable |
| Bitfield< 7, 3 > | reserved |
| Bitfield< 15, 8 > | prescalar |
| Bitfield< 3 > | watchdogMode |
| Bitfield< 7, 4 > | reserved |
| EndBitUnion(WatchdogCtrl) protected CpuLocalTimer * | parent |
| Pointer to parent class. More... | |
| ArmInterruptPin * | intTimer |
| Interrupt to cause/clear. More... | |
| ArmInterruptPin * | intWatchdog |
| TimerCtrl | timerControl |
| Control register as specified above. More... | |
| WatchdogCtrl | watchdogControl |
| bool | rawIntTimer |
| If timer has caused an interrupt. More... | |
| bool | rawIntWatchdog |
| bool | rawResetWatchdog |
| uint32_t | watchdogDisableReg |
| bool | pendingIntTimer |
| If an interrupt is currently pending. More... | |
| bool | pendingIntWatchdog |
| uint32_t | timerLoadValue |
| Value to load into counters when periodic mode reaches 0. More... | |
| uint32_t | watchdogLoadValue |
| EventFunctionWrapper | timerZeroEvent |
| EventFunctionWrapper | watchdogZeroEvent |
Friends | |
| class | CpuLocalTimer |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
| static const std::string & | currentSection () |
| Get the fully-qualified name of the active section. More... | |
| static void | serializeAll (const std::string &cpt_dir) |
| static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
| static int | ckptCount = 0 |
| static int | ckptMaxCount = 0 |
| static int | ckptPrevCount = -1 |
Definition at line 59 of file timer_cpulocal.hh.
| anonymous enum |
| Enumerator | |
|---|---|
| TimerLoadReg | |
| TimerCounterReg | |
| TimerControlReg | |
| TimerIntStatusReg | |
| WatchdogLoadReg | |
| WatchdogCounterReg | |
| WatchdogControlReg | |
| WatchdogIntStatusReg | |
| WatchdogResetStatusReg | |
| WatchdogDisableReg | |
| Size | |
Definition at line 63 of file timer_cpulocal.hh.
| CpuLocalTimer::Timer::Timer | ( | const std::string & | name, |
| CpuLocalTimer * | _parent, | ||
| ArmInterruptPin * | int_timer, | ||
| ArmInterruptPin * | int_watchdog | ||
| ) |
Definition at line 76 of file timer_cpulocal.cc.
References name(), timerAtZero(), watchdogAtZero(), and watchdogZeroEvent.
| CpuLocalTimer::Timer::BitUnion32 | ( | TimerCtrl | ) |
| CpuLocalTimer::Timer::EndBitUnion | ( | TimerCtrl | ) |
|
inline |
Definition at line 141 of file timer_cpulocal.hh.
References read(), serialize(), unserialize(), and write().
Referenced by Timer().
Handle read for a single timer.
Definition at line 112 of file timer_cpulocal.cc.
References Clocked::clockPeriod(), curTick(), DPRINTF, panic, parent, power(), rawIntTimer, rawIntWatchdog, rawResetWatchdog, Packet::setLE(), timerControl, TimerControlReg, TimerCounterReg, TimerIntStatusReg, TimerLoadReg, timerLoadValue, timerZeroEvent, watchdogControl, WatchdogControlReg, WatchdogCounterReg, WatchdogDisableReg, WatchdogIntStatusReg, WatchdogLoadReg, watchdogLoadValue, WatchdogResetStatusReg, watchdogZeroEvent, and Event::when().
Referenced by name(), and CpuLocalTimer::params().
| void CpuLocalTimer::Timer::restartTimerCounter | ( | uint32_t | val | ) |
Restart the counter ticking at val.
| val | the value to start at |
Definition at line 266 of file timer_cpulocal.cc.
References Clocked::clockPeriod(), curTick(), EventManager::deschedule(), DPRINTF, parent, power(), EventManager::schedule(), Event::scheduled(), timerControl, timerZeroEvent, and X86ISA::val.
Referenced by timerAtZero(), and write().
| void CpuLocalTimer::Timer::restartWatchdogCounter | ( | uint32_t | val | ) |
Definition at line 284 of file timer_cpulocal.cc.
References Clocked::clockPeriod(), curTick(), EventManager::deschedule(), DPRINTF, parent, power(), EventManager::schedule(), Event::scheduled(), X86ISA::val, watchdogControl, and watchdogZeroEvent.
Referenced by watchdogAtZero(), and write().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 357 of file timer_cpulocal.cc.
References DPRINTF, pendingIntTimer, pendingIntWatchdog, rawIntTimer, rawIntWatchdog, rawResetWatchdog, Event::scheduled(), SERIALIZE_SCALAR, timerControl, timerLoadValue, timerZeroEvent, watchdogControl, watchdogDisableReg, watchdogLoadValue, watchdogZeroEvent, and Event::when().
Referenced by name(), and CpuLocalTimer::params().
| void CpuLocalTimer::Timer::timerAtZero | ( | ) |
Called when the counter reaches 0.
Definition at line 303 of file timer_cpulocal.cc.
References DPRINTF, intTimer, pendingIntTimer, ArmInterruptPin::raise(), rawIntTimer, restartTimerCounter(), timerControl, and timerLoadValue.
Referenced by Timer().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements Serializable.
Definition at line 393 of file timer_cpulocal.cc.
References DPRINTF, parent, pendingIntTimer, pendingIntWatchdog, rawIntTimer, rawIntWatchdog, rawResetWatchdog, EventManager::schedule(), timerControl, timerLoadValue, timerZeroEvent, UNSERIALIZE_SCALAR, watchdogControl, watchdogDisableReg, watchdogLoadValue, and watchdogZeroEvent.
Referenced by name(), and CpuLocalTimer::params().
| void CpuLocalTimer::Timer::watchdogAtZero | ( | ) |
Definition at line 326 of file timer_cpulocal.cc.
References DPRINTF, fatal, intWatchdog, pendingIntWatchdog, ArmInterruptPin::raise(), rawIntWatchdog, rawResetWatchdog, restartWatchdogCounter(), watchdogControl, and watchdogLoadValue.
Referenced by Timer().
Handle write for a single timer.
Definition at line 189 of file timer_cpulocal.cc.
References DPRINTF, Packet::getLE(), panic, pendingIntTimer, pendingIntWatchdog, rawIntTimer, rawIntWatchdog, rawResetWatchdog, restartTimerCounter(), restartWatchdogCounter(), timerControl, TimerControlReg, TimerCounterReg, TimerIntStatusReg, TimerLoadReg, timerLoadValue, watchdogControl, WatchdogControlReg, WatchdogCounterReg, WatchdogDisableReg, watchdogDisableReg, WatchdogIntStatusReg, WatchdogLoadReg, watchdogLoadValue, and WatchdogResetStatusReg.
Referenced by name(), and CpuLocalTimer::params().
|
friend |
Definition at line 152 of file timer_cpulocal.hh.
Referenced by CpuLocalTimer::params(), and CpuLocalTimer::unserialize().
| Bitfield< 1 > CpuLocalTimer::Timer::autoReload |
Definition at line 79 of file timer_cpulocal.hh.
| Bitfield< 2 > CpuLocalTimer::Timer::intEnable |
Definition at line 80 of file timer_cpulocal.hh.
| ArmInterruptPin* CpuLocalTimer::Timer::intTimer |
Interrupt to cause/clear.
Definition at line 101 of file timer_cpulocal.hh.
Referenced by timerAtZero().
| ArmInterruptPin* CpuLocalTimer::Timer::intWatchdog |
Definition at line 102 of file timer_cpulocal.hh.
Referenced by watchdogAtZero().
| EndBitUnion (WatchdogCtrl) protected CpuLocalTimer* CpuLocalTimer::Timer::parent |
Pointer to parent class.
Definition at line 92 of file timer_cpulocal.hh.
Referenced by read(), restartTimerCounter(), restartWatchdogCounter(), and unserialize().
| bool CpuLocalTimer::Timer::pendingIntTimer |
If an interrupt is currently pending.
Logical and of Timer or Watchdog Ctrl.enable and rawIntTimer or rawIntWatchdog
Definition at line 117 of file timer_cpulocal.hh.
Referenced by serialize(), timerAtZero(), unserialize(), and write().
| bool CpuLocalTimer::Timer::pendingIntWatchdog |
Definition at line 118 of file timer_cpulocal.hh.
Referenced by serialize(), unserialize(), watchdogAtZero(), and write().
| Bitfield< 15, 8 > CpuLocalTimer::Timer::prescalar |
Definition at line 82 of file timer_cpulocal.hh.
| bool CpuLocalTimer::Timer::rawIntTimer |
If timer has caused an interrupt.
This is irrespective of interrupt enable
Definition at line 110 of file timer_cpulocal.hh.
Referenced by read(), serialize(), timerAtZero(), unserialize(), and write().
| bool CpuLocalTimer::Timer::rawIntWatchdog |
Definition at line 111 of file timer_cpulocal.hh.
Referenced by read(), serialize(), unserialize(), watchdogAtZero(), and write().
| bool CpuLocalTimer::Timer::rawResetWatchdog |
Definition at line 112 of file timer_cpulocal.hh.
Referenced by read(), serialize(), unserialize(), watchdogAtZero(), and write().
| Bitfield<7,3> CpuLocalTimer::Timer::reserved |
Definition at line 81 of file timer_cpulocal.hh.
| Bitfield<7,4> CpuLocalTimer::Timer::reserved |
Definition at line 90 of file timer_cpulocal.hh.
| TimerCtrl CpuLocalTimer::Timer::timerControl |
Control register as specified above.
Definition at line 105 of file timer_cpulocal.hh.
Referenced by read(), restartTimerCounter(), serialize(), timerAtZero(), unserialize(), and write().
| uint32_t CpuLocalTimer::Timer::timerLoadValue |
Value to load into counters when periodic mode reaches 0.
Definition at line 121 of file timer_cpulocal.hh.
Referenced by read(), serialize(), timerAtZero(), unserialize(), and write().
| EventFunctionWrapper CpuLocalTimer::Timer::timerZeroEvent |
Definition at line 126 of file timer_cpulocal.hh.
Referenced by read(), restartTimerCounter(), serialize(), and unserialize().
| WatchdogCtrl CpuLocalTimer::Timer::watchdogControl |
Definition at line 106 of file timer_cpulocal.hh.
Referenced by read(), restartWatchdogCounter(), serialize(), unserialize(), watchdogAtZero(), and write().
| uint32_t CpuLocalTimer::Timer::watchdogDisableReg |
Definition at line 113 of file timer_cpulocal.hh.
Referenced by serialize(), unserialize(), and write().
| uint32_t CpuLocalTimer::Timer::watchdogLoadValue |
Definition at line 122 of file timer_cpulocal.hh.
Referenced by read(), serialize(), unserialize(), watchdogAtZero(), and write().
| Bitfield<3> CpuLocalTimer::Timer::watchdogMode |
Definition at line 89 of file timer_cpulocal.hh.
| EventFunctionWrapper CpuLocalTimer::Timer::watchdogZeroEvent |
Definition at line 129 of file timer_cpulocal.hh.
Referenced by read(), restartWatchdogCounter(), serialize(), Timer(), and unserialize().