gem5  v20.1.0.0
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Intel8254Timer::Counter Class Reference

Counter element for PIT. More...

#include <intel_8254_timer.hh>

Classes

class  CounterEvent
 Event for counter interrupt. More...
 

Public Member Functions

 Counter (Intel8254Timer *p, const std::string &name, unsigned int num)
 
void latchCount ()
 Latch the current count (if one is not already latched) More...
 
int currentCount ()
 Get the current count for this counter. More...
 
void setRW (int rw_val)
 Set the read/write mode. More...
 
void setMode (int mode_val)
 Set operational mode. More...
 
void setBCD (int bcd_val)
 Set count encoding. More...
 
uint8_t read ()
 Read a count byte. More...
 
void write (const uint8_t data)
 Write a count byte. More...
 
bool outputHigh ()
 Is the output high? More...
 
void serialize (const std::string &base, CheckpointOut &cp) const
 Serialize this object to the given output stream. More...
 
void unserialize (const std::string &base, CheckpointIn &cp)
 Reconstruct the state of this object from a checkpoint. More...
 
void startup ()
 Start ticking. More...
 

Private Types

enum  { LSB, MSB }
 Set of values for read_byte and write_byte. More...
 

Private Member Functions

const std::string & name () const
 

Private Attributes

std::string _name
 
unsigned int num
 
CounterEvent event
 
bool running
 True after startup is called. More...
 
uint16_t initial_count
 Initial count value. More...
 
uint16_t latched_count
 Latched count. More...
 
uint16_t period
 Interrupt period. More...
 
Tick offset
 When to start ticking. More...
 
uint8_t mode
 Current mode of operation. More...
 
bool output_high
 Output goes high when the counter reaches zero. More...
 
bool latch_on
 State of the count latch. More...
 
uint8_t read_byte
 Determine which byte of a 16-bit count value to read/write. More...
 
uint8_t write_byte
 
Intel8254Timerparent
 Pointer to container. More...
 

Detailed Description

Counter element for PIT.

Definition at line 77 of file intel_8254_timer.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Set of values for read_byte and write_byte.

Enumerator
LSB 
MSB 

Definition at line 138 of file intel_8254_timer.hh.

Constructor & Destructor Documentation

◆ Counter()

Intel8254Timer::Counter::Counter ( Intel8254Timer p,
const std::string &  name,
unsigned int  num 
)

Definition at line 96 of file intel_8254_timer.cc.

References offset, and period.

Member Function Documentation

◆ currentCount()

int Intel8254Timer::Counter::currentCount ( )

Get the current count for this counter.

Definition at line 118 of file intel_8254_timer.cc.

References Intel8254Timer::mode, Intel8254Timer::RateGen, Intel8254Timer::SquareWave, and warn_once.

◆ latchCount()

void Intel8254Timer::Counter::latchCount ( )

Latch the current count (if one is not already latched)

Definition at line 107 of file intel_8254_timer.cc.

Referenced by Intel8254Timer::writeControl().

◆ name()

const std::string& Intel8254Timer::Counter::name ( ) const
inlineprivate

Definition at line 107 of file intel_8254_timer.hh.

References _name.

◆ outputHigh()

bool Intel8254Timer::Counter::outputHigh ( )

Is the output high?

Definition at line 222 of file intel_8254_timer.cc.

Referenced by Intel8254Timer::outputHigh().

◆ read()

uint8_t Intel8254Timer::Counter::read ( )

Read a count byte.

Definition at line 132 of file intel_8254_timer.cc.

References X86ISA::count, and panic.

Referenced by Intel8254Timer::readCounter().

◆ serialize()

void Intel8254Timer::Counter::serialize ( const std::string &  base,
CheckpointOut cp 
) const

Serialize this object to the given output stream.

Parameters
baseThe base name of the counter object.
osThe stream to serialize to.

Definition at line 228 of file intel_8254_timer.cc.

References X86ISA::base, curTick(), MipsISA::event, Intel8254Timer::mode, and paramOut().

Referenced by Intel8254Timer::serialize().

◆ setBCD()

void Intel8254Timer::Counter::setBCD ( int  bcd_val)

Set count encoding.

Definition at line 215 of file intel_8254_timer.cc.

References panic.

Referenced by Intel8254Timer::writeControl().

◆ setMode()

void Intel8254Timer::Counter::setMode ( int  mode_val)

◆ setRW()

void Intel8254Timer::Counter::setRW ( int  rw_val)

Set the read/write mode.

Definition at line 198 of file intel_8254_timer.cc.

References panic, and Intel8254Timer::TwoPhase.

Referenced by Intel8254Timer::writeControl().

◆ startup()

void Intel8254Timer::Counter::startup ( )

Start ticking.

Definition at line 264 of file intel_8254_timer.cc.

References curTick(), MipsISA::event, and ArmISA::offset.

Referenced by Intel8254Timer::startup().

◆ unserialize()

void Intel8254Timer::Counter::unserialize ( const std::string &  base,
CheckpointIn cp 
)

Reconstruct the state of this object from a checkpoint.

Parameters
baseThe base name of the counter object.
cpThe checkpoint use.
sectionThe section name of this object

Definition at line 246 of file intel_8254_timer.cc.

References X86ISA::base, MipsISA::event, Intel8254Timer::mode, ArmISA::offset, and paramIn().

Referenced by Intel8254Timer::unserialize().

◆ write()

void Intel8254Timer::Counter::write ( const uint8_t  data)

Member Data Documentation

◆ _name

std::string Intel8254Timer::Counter::_name
private

Definition at line 106 of file intel_8254_timer.hh.

Referenced by name().

◆ event

CounterEvent Intel8254Timer::Counter::event
private

Definition at line 111 of file intel_8254_timer.hh.

◆ initial_count

uint16_t Intel8254Timer::Counter::initial_count
private

Initial count value.

Definition at line 117 of file intel_8254_timer.hh.

◆ latch_on

bool Intel8254Timer::Counter::latch_on
private

State of the count latch.

Definition at line 135 of file intel_8254_timer.hh.

◆ latched_count

uint16_t Intel8254Timer::Counter::latched_count
private

Latched count.

Definition at line 120 of file intel_8254_timer.hh.

◆ mode

uint8_t Intel8254Timer::Counter::mode
private

Current mode of operation.

Definition at line 129 of file intel_8254_timer.hh.

Referenced by Intel8254Timer::Counter::CounterEvent::process().

◆ num

unsigned int Intel8254Timer::Counter::num
private

Definition at line 109 of file intel_8254_timer.hh.

Referenced by Intel8254Timer::Counter::CounterEvent::process().

◆ offset

Tick Intel8254Timer::Counter::offset
private

When to start ticking.

Definition at line 126 of file intel_8254_timer.hh.

Referenced by Counter().

◆ output_high

bool Intel8254Timer::Counter::output_high
private

Output goes high when the counter reaches zero.

Definition at line 132 of file intel_8254_timer.hh.

Referenced by Intel8254Timer::Counter::CounterEvent::process().

◆ parent

Intel8254Timer* Intel8254Timer::Counter::parent
private

◆ period

uint16_t Intel8254Timer::Counter::period
private

Interrupt period.

Definition at line 123 of file intel_8254_timer.hh.

Referenced by Counter(), and Intel8254Timer::Counter::CounterEvent::process().

◆ read_byte

uint8_t Intel8254Timer::Counter::read_byte
private

Determine which byte of a 16-bit count value to read/write.

Definition at line 141 of file intel_8254_timer.hh.

◆ running

bool Intel8254Timer::Counter::running
private

True after startup is called.

Definition at line 114 of file intel_8254_timer.hh.

◆ write_byte

uint8_t Intel8254Timer::Counter::write_byte
private

Definition at line 141 of file intel_8254_timer.hh.


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

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