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

#include <timer_a9global.hh>

Inheritance diagram for A9GlobalTimer::Timer:
Serializable

Public Types

enum  {
  CounterRegLow32 = 0x00, CounterRegHigh32 = 0x04, ControlReg = 0x08, IntStatusReg = 0x0C,
  CmpValRegLow32 = 0x10, CmpValRegHigh32 = 0x14, AutoIncrementReg = 0x18, Size = 0x1C
}
 

Public Member Functions

 BitUnion32 (CTRL) Bitfield< 0 > enable
 
void counterAtCmpVal ()
 Called when the counter reaches the comparator. More...
 
void restartCounter ()
 Restart the counter ticking. More...
 
uint64_t getTimeCounterFromTicks (Tick ticks)
 Convert a number of ticks into the time counter format. More...
 
 Timer (std::string __name, A9GlobalTimer *parent, int int_num)
 
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 > cmpEnable
 
Bitfield< 2 > intEnable
 
Bitfield< 3 > autoIncrement
 
Bitfield< 7, 4 > reserved
 
Bitfield< 15, 8 > prescalar
 
EndBitUnion(CTRL) protected A9GlobalTimerparent
 Pointer to parent class. More...
 
const uint32_t intNum
 Number of interrupt to cause/clear. 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...
 
uint64_t cmpVal
 Value of the comparator. More...
 
uint32_t autoIncValue
 Value to add to comparator when counter reaches comparator. More...
 
EventWrapper< Timer, &Timer::counterAtCmpValcmpValEvent
 

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 55 of file timer_a9global.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
CounterRegLow32 
CounterRegHigh32 
ControlReg 
IntStatusReg 
CmpValRegLow32 
CmpValRegHigh32 
AutoIncrementReg 
Size 

Definition at line 62 of file timer_a9global.hh.

Constructor & Destructor Documentation

◆ Timer()

A9GlobalTimer::Timer::Timer ( std::string  __name,
A9GlobalTimer parent,
int  int_num 
)

Definition at line 55 of file timer_a9global.cc.

Member Function Documentation

◆ BitUnion32()

A9GlobalTimer::Timer::BitUnion32 ( CTRL  )

◆ counterAtCmpVal()

void A9GlobalTimer::Timer::counterAtCmpVal ( )

Called when the counter reaches the comparator.

Definition at line 230 of file timer_a9global.cc.

References DPRINTF.

◆ getTimeCounterFromTicks()

uint64_t A9GlobalTimer::Timer::getTimeCounterFromTicks ( Tick  ticks)

Convert a number of ticks into the time counter format.

Parameters
ticksnumber of ticks

Definition at line 79 of file timer_a9global.cc.

◆ name()

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

Definition at line 126 of file timer_a9global.hh.

◆ read()

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

Handle read for a single timer.

Definition at line 85 of file timer_a9global.cc.

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

Referenced by A9GlobalTimer::read().

◆ restartCounter()

void A9GlobalTimer::Timer::restartCounter ( )

Restart the counter ticking.

Definition at line 209 of file timer_a9global.cc.

References curTick(), and DPRINTF.

◆ serialize()

void A9GlobalTimer::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 254 of file timer_a9global.cc.

References DPRINTF, and SERIALIZE_SCALAR.

Referenced by A9GlobalTimer::serialize().

◆ unserialize()

void A9GlobalTimer::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 277 of file timer_a9global.cc.

References DPRINTF, and UNSERIALIZE_SCALAR.

Referenced by A9GlobalTimer::unserialize().

◆ write()

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

Handle write for a single timer.

Definition at line 162 of file timer_a9global.cc.

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

Referenced by A9GlobalTimer::write().

Member Data Documentation

◆ autoIncrement

Bitfield<3> A9GlobalTimer::Timer::autoIncrement

Definition at line 78 of file timer_a9global.hh.

◆ autoIncValue

uint32_t A9GlobalTimer::Timer::autoIncValue

Value to add to comparator when counter reaches comparator.

Definition at line 110 of file timer_a9global.hh.

◆ cmpEnable

Bitfield<1> A9GlobalTimer::Timer::cmpEnable

Definition at line 76 of file timer_a9global.hh.

◆ cmpVal

uint64_t A9GlobalTimer::Timer::cmpVal

Value of the comparator.

Definition at line 106 of file timer_a9global.hh.

◆ cmpValEvent

EventWrapper<Timer, &Timer::counterAtCmpVal> A9GlobalTimer::Timer::cmpValEvent

Definition at line 114 of file timer_a9global.hh.

◆ control

CTRL A9GlobalTimer::Timer::control

Control register as specified above.

Definition at line 94 of file timer_a9global.hh.

◆ intEnable

Bitfield<2> A9GlobalTimer::Timer::intEnable

Definition at line 77 of file timer_a9global.hh.

◆ intNum

const uint32_t A9GlobalTimer::Timer::intNum

Number of interrupt to cause/clear.

Definition at line 90 of file timer_a9global.hh.

◆ parent

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

Pointer to parent class.

Definition at line 81 of file timer_a9global.hh.

◆ pendingInt

bool A9GlobalTimer::Timer::pendingInt

If an interrupt is currently pending.

Logical and of CTRL.intEnable and rawInt

Definition at line 103 of file timer_a9global.hh.

◆ prescalar

Bitfield<15,8> A9GlobalTimer::Timer::prescalar

Definition at line 80 of file timer_a9global.hh.

Referenced by read().

◆ rawInt

bool A9GlobalTimer::Timer::rawInt

If timer has caused an interrupt.

This is irrespective of interrupt enable

Definition at line 99 of file timer_a9global.hh.

◆ reserved

Bitfield<7,4> A9GlobalTimer::Timer::reserved

Definition at line 79 of file timer_a9global.hh.


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

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