gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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, int int_num, 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...
 
const uint32_t intNum
 Number of interrupt to cause/clear. 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...
 
EventWrapper< Timer,&Timer::counterAtZerozeroEvent
 

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
 

Detailed Description

Definition at line 55 of file timer_sp804.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
LoadReg 
CurrentReg 
ControlReg 
IntClear 
RawISR 
MaskedISR 
BGLoad 
Size 

Definition at line 59 of file timer_sp804.hh.

Constructor & Destructor Documentation

Sp804::Timer::Timer ( std::string  __name,
Sp804 parent,
int  int_num,
Tick  clock 
)

Definition at line 57 of file timer_sp804.cc.

Member Function Documentation

Sp804::Timer::BitUnion32 ( CTRL  )
void Sp804::Timer::counterAtZero ( )

Called when the counter reaches 0.

Definition at line 194 of file timer_sp804.cc.

References DPRINTF.

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

Definition at line 116 of file timer_sp804.hh.

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

Handle read for a single timer.

Definition at line 84 of file timer_sp804.cc.

References curTick(), DPRINTF, Packet::get(), panic, power(), Packet::set(), and timerPrescale.

Referenced by Sp804::read().

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 173 of file timer_sp804.cc.

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

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 221 of file timer_sp804.cc.

References DPRINTF, and SERIALIZE_SCALAR.

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 243 of file timer_sp804.cc.

References DPRINTF, and UNSERIALIZE_SCALAR.

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

Handle write for a single timer.

Definition at line 137 of file timer_sp804.cc.

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

Referenced by Sp804::write().

Member Data Documentation

const Tick Sp804::Timer::clock

Number of ticks in a clock input.

Definition at line 89 of file timer_sp804.hh.

CTRL Sp804::Timer::control

Control register as specified above.

Definition at line 92 of file timer_sp804.hh.

Bitfield<5> Sp804::Timer::intEnable

Definition at line 74 of file timer_sp804.hh.

const uint32_t Sp804::Timer::intNum

Number of interrupt to cause/clear.

Definition at line 86 of file timer_sp804.hh.

uint32_t Sp804::Timer::loadValue

Value to load into counter when periodic mode reaches 0.

Definition at line 103 of file timer_sp804.hh.

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

Pointer to parent class.

Definition at line 77 of file timer_sp804.hh.

bool Sp804::Timer::pendingInt

If an interrupt is currently pending.

Logical and of CTRL.intEnable and rawInt

Definition at line 100 of file timer_sp804.hh.

bool Sp804::Timer::rawInt

If timer has caused an interrupt.

This is irrespective of interrupt enable

Definition at line 96 of file timer_sp804.hh.

Bitfield<7> Sp804::Timer::timerEnable

Definition at line 76 of file timer_sp804.hh.

Bitfield<6> Sp804::Timer::timerMode

Definition at line 75 of file timer_sp804.hh.

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

Definition at line 73 of file timer_sp804.hh.

Referenced by read().

Bitfield<1> Sp804::Timer::timerSize

Definition at line 72 of file timer_sp804.hh.

EventWrapper<Timer, &Timer::counterAtZero> Sp804::Timer::zeroEvent

Definition at line 107 of file timer_sp804.hh.


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

Generated on Fri Jun 9 2017 13:04:20 for gem5 by doxygen 1.8.6