gem5  v20.1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
Sp804::Timer Class Reference

#include <timer_sp804.hh>

Inheritance diagram for Sp804::Timer:
Serializable

Public Types

enum  {
  LoadReg = 0x00, CurrentReg = 0x04, ControlReg = 0x08, IntClear = 0x0C,
  RawISR = 0x10, MaskedISR = 0x14, BGLoad = 0x18, Size = 0x20
}
 

Public Member Functions

 BitUnion32 (CTRL) Bitfield< 0 > oneShot
 
void counterAtZero ()
 Called when the counter reaches 0. More...
 
void restartCounter (uint32_t val)
 Restart the counter ticking at val. More...
 
 Timer (std::string __name, Sp804 *parent, ArmInterruptPin *_interrupt, Tick clock)
 
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 > timerSize
 
Bitfield< 3, 2 > timerPrescale
 
Bitfield< 5 > intEnable
 
Bitfield< 6 > timerMode
 
Bitfield< 7 > timerEnable
 
EndBitUnion(CTRL) protected Sp804parent
 Pointer to parent class. More...
 
ArmInterruptPin *const interrupt
 Pointer to the interrupt pin. More...
 
const Tick clock
 Number of ticks in a clock input. More...
 
CTRL control
 Control register as specified above. More...
 
bool rawInt
 If timer has caused an interrupt. More...
 
bool pendingInt
 If an interrupt is currently pending. More...
 
uint32_t loadValue
 Value to load into counter when periodic mode reaches 0. More...
 
EventFunctionWrapper zeroEvent
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 

Detailed Description

Definition at line 53 of file timer_sp804.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
LoadReg 
CurrentReg 
ControlReg 
IntClear 
RawISR 
MaskedISR 
BGLoad 
Size 

Definition at line 57 of file timer_sp804.hh.

Constructor & Destructor Documentation

◆ Timer()

Sp804::Timer::Timer ( std::string  __name,
Sp804 parent,
ArmInterruptPin _interrupt,
Tick  clock 
)

Definition at line 55 of file timer_sp804.cc.

References counterAtZero().

Member Function Documentation

◆ BitUnion32()

Sp804::Timer::BitUnion32 ( CTRL  )

◆ counterAtZero()

void Sp804::Timer::counterAtZero ( )

Called when the counter reaches 0.

Definition at line 197 of file timer_sp804.cc.

References DPRINTF.

Referenced by Timer().

◆ name()

std::string Sp804::Timer::name ( ) const
inline

Definition at line 115 of file timer_sp804.hh.

◆ read()

void Sp804::Timer::read ( PacketPtr  pkt,
Addr  daddr 
)

Handle read for a single timer.

Definition at line 85 of file timer_sp804.cc.

References curTick(), DPRINTF, Packet::getLE(), panic, power(), Packet::setLE(), and timerPrescale.

Referenced by Sp804::read().

◆ restartCounter()

void Sp804::Timer::restartCounter ( uint32_t  val)

Restart the counter ticking at val.

Parameters
valthe value to start at (pre-16 bit masking if en)

Definition at line 176 of file timer_sp804.cc.

References bits(), curTick(), DPRINTF, power(), and X86ISA::val.

◆ serialize()

void Sp804::Timer::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 224 of file timer_sp804.cc.

References DPRINTF, and SERIALIZE_SCALAR.

◆ unserialize()

void Sp804::Timer::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 246 of file timer_sp804.cc.

References DPRINTF, and UNSERIALIZE_SCALAR.

◆ write()

void Sp804::Timer::write ( PacketPtr  pkt,
Addr  daddr 
)

Handle write for a single timer.

Definition at line 139 of file timer_sp804.cc.

References DPRINTF, Packet::getLE(), and panic.

Referenced by Sp804::write().

Member Data Documentation

◆ clock

const Tick Sp804::Timer::clock

Number of ticks in a clock input.

Definition at line 87 of file timer_sp804.hh.

◆ control

CTRL Sp804::Timer::control

Control register as specified above.

Definition at line 90 of file timer_sp804.hh.

◆ intEnable

Bitfield<5> Sp804::Timer::intEnable

Definition at line 72 of file timer_sp804.hh.

◆ interrupt

ArmInterruptPin* const Sp804::Timer::interrupt

Pointer to the interrupt pin.

Definition at line 84 of file timer_sp804.hh.

◆ loadValue

uint32_t Sp804::Timer::loadValue

Value to load into counter when periodic mode reaches 0.

Definition at line 101 of file timer_sp804.hh.

◆ parent

EndBitUnion (CTRL) protected Sp804* Sp804::Timer::parent

Pointer to parent class.

Definition at line 75 of file timer_sp804.hh.

◆ pendingInt

bool Sp804::Timer::pendingInt

If an interrupt is currently pending.

Logical and of CTRL.intEnable and rawInt

Definition at line 98 of file timer_sp804.hh.

◆ rawInt

bool Sp804::Timer::rawInt

If timer has caused an interrupt.

This is irrespective of interrupt enable

Definition at line 94 of file timer_sp804.hh.

◆ timerEnable

Bitfield<7> Sp804::Timer::timerEnable

Definition at line 74 of file timer_sp804.hh.

◆ timerMode

Bitfield<6> Sp804::Timer::timerMode

Definition at line 73 of file timer_sp804.hh.

◆ timerPrescale

Bitfield<3,2> Sp804::Timer::timerPrescale

Definition at line 71 of file timer_sp804.hh.

Referenced by read().

◆ timerSize

Bitfield<1> Sp804::Timer::timerSize

Definition at line 70 of file timer_sp804.hh.

◆ zeroEvent

EventFunctionWrapper Sp804::Timer::zeroEvent

Definition at line 105 of file timer_sp804.hh.


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:32 for gem5 by doxygen 1.8.17