|
gem5 [DEVELOP-FOR-25.0]
|
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) | |
| unsigned int | index () const |
| void | latchCount () |
| Latch the current count (if one is not already latched) | |
| int | currentCount () |
| Get the current count for this counter. | |
| void | setRW (int rw_val) |
| Set the read/write mode. | |
| void | setMode (int mode_val) |
| Set operational mode. | |
| void | setBCD (int bcd_val) |
| Set count encoding. | |
| uint8_t | read () |
| Read a count byte. | |
| void | write (const uint8_t data) |
| Write a count byte. | |
| bool | outputHigh () |
| Is the output high? | |
| void | serialize (const std::string &base, CheckpointOut &cp) const |
| Serialize this object to the given output stream. | |
| void | unserialize (const std::string &base, CheckpointIn &cp) |
| Reconstruct the state of this object from a checkpoint. | |
| void | startup () |
| Start ticking. | |
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. | |
| uint16_t | initial_count |
| Initial count value. | |
| uint16_t | latched_count |
| Latched count. | |
| uint16_t | period |
| Interrupt period. | |
| Tick | offset |
| When to start ticking. | |
| uint8_t | mode |
| Current mode of operation. | |
| bool | output_high |
| Output goes high when the counter reaches zero. | |
| bool | latch_on |
| State of the count latch. | |
| uint8_t | read_byte |
| Determine which byte of a 16-bit count value to read/write. | |
| uint8_t | write_byte |
| Intel8254Timer * | parent |
| Pointer to container. | |
Counter element for PIT.
Definition at line 94 of file intel_8254_timer.hh.
|
private |
Set of values for read_byte and write_byte.
| Enumerator | |
|---|---|
| LSB | |
| MSB | |
Definition at line 155 of file intel_8254_timer.hh.
| gem5::Intel8254Timer::Counter::Counter | ( | Intel8254Timer * | p, |
| const std::string & | name, | ||
| unsigned int | num ) |
Definition at line 102 of file intel_8254_timer.cc.
References _name, event, initial_count, gem5::Intel8254Timer::Intel8254Timer(), latch_on, latched_count, LSB, mode, name(), num, offset, output_high, gem5::MipsISA::p, parent, period, read_byte, running, and write_byte.
| int gem5::Intel8254Timer::Counter::currentCount | ( | ) |
Get the current count for this counter.
Definition at line 124 of file intel_8254_timer.cc.
References mode, gem5::Intel8254Timer::RateGen, gem5::Intel8254Timer::SquareWave, and warn_once.
Referenced by latchCount(), and read().
|
inline |
Definition at line 166 of file intel_8254_timer.hh.
References num.
| void gem5::Intel8254Timer::Counter::latchCount | ( | ) |
Latch the current count (if one is not already latched)
Definition at line 113 of file intel_8254_timer.cc.
References currentCount(), latch_on, latched_count, LSB, and read_byte.
|
inlineprivate |
| bool gem5::Intel8254Timer::Counter::outputHigh | ( | ) |
| uint8_t gem5::Intel8254Timer::Counter::read | ( | ) |
Read a count byte.
Definition at line 138 of file intel_8254_timer.cc.
References gem5::Intel8254Timer::count, currentCount(), latch_on, latched_count, LSB, MSB, panic, and read_byte.
| void gem5::Intel8254Timer::Counter::serialize | ( | const std::string & | base, |
| CheckpointOut & | cp ) const |
Serialize this object to the given output stream.
| base | The base name of the counter object. |
| os | The stream to serialize to. |
Definition at line 236 of file intel_8254_timer.cc.
References gem5::RiscvISA::base, gem5::curTick(), event, initial_count, latch_on, latched_count, mode, output_high, gem5::paramOut(), period, read_byte, and write_byte.
| void gem5::Intel8254Timer::Counter::setBCD | ( | int | bcd_val | ) |
| void gem5::Intel8254Timer::Counter::setMode | ( | int | mode_val | ) |
Set operational mode.
Definition at line 211 of file intel_8254_timer.cc.
References gem5::Intel8254Timer::InitTc, mode, panic, gem5::Intel8254Timer::RateGen, gem5::Intel8254Timer::SoftwareStrobe, gem5::Intel8254Timer::SquareWave, and warn_once.
| void gem5::Intel8254Timer::Counter::setRW | ( | int | rw_val | ) |
Set the read/write mode.
Definition at line 204 of file intel_8254_timer.cc.
References panic, and gem5::Intel8254Timer::TwoPhase.
| void gem5::Intel8254Timer::Counter::startup | ( | ) |
Start ticking.
Definition at line 273 of file intel_8254_timer.cc.
References gem5::curTick(), event, offset, parent, period, and running.
| void gem5::Intel8254Timer::Counter::unserialize | ( | const std::string & | base, |
| CheckpointIn & | cp ) |
Reconstruct the state of this object from a checkpoint.
| base | The base name of the counter object. |
| cp | The checkpoint use. |
| section | The section name of this object |
Definition at line 255 of file intel_8254_timer.cc.
References gem5::RiscvISA::base, event, initial_count, latch_on, latched_count, mode, offset, output_high, gem5::paramIn(), period, read_byte, and write_byte.
| void gem5::Intel8254Timer::Counter::write | ( | const uint8_t | data | ) |
Write a count byte.
Definition at line 172 of file intel_8254_timer.cc.
References data, event, initial_count, LSB, mode, MSB, offset, output_high, parent, period, gem5::Intel8254Timer::RateGen, running, gem5::Intel8254Timer::SquareWave, and write_byte.
|
private |
Definition at line 123 of file intel_8254_timer.hh.
|
private |
Definition at line 128 of file intel_8254_timer.hh.
Referenced by Counter(), serialize(), startup(), unserialize(), and write().
|
private |
Initial count value.
Definition at line 134 of file intel_8254_timer.hh.
Referenced by Counter(), serialize(), unserialize(), and write().
|
private |
State of the count latch.
Definition at line 152 of file intel_8254_timer.hh.
Referenced by Counter(), latchCount(), read(), serialize(), and unserialize().
|
private |
Latched count.
Definition at line 137 of file intel_8254_timer.hh.
Referenced by Counter(), latchCount(), read(), serialize(), and unserialize().
|
private |
Current mode of operation.
Definition at line 146 of file intel_8254_timer.hh.
Referenced by Counter(), currentCount(), serialize(), setMode(), unserialize(), and write().
|
private |
Definition at line 126 of file intel_8254_timer.hh.
|
private |
When to start ticking.
Definition at line 143 of file intel_8254_timer.hh.
Referenced by Counter(), startup(), unserialize(), and write().
|
private |
Output goes high when the counter reaches zero.
Definition at line 149 of file intel_8254_timer.hh.
Referenced by Counter(), outputHigh(), serialize(), unserialize(), and write().
|
private |
Pointer to container.
Definition at line 161 of file intel_8254_timer.hh.
|
private |
Interrupt period.
Definition at line 140 of file intel_8254_timer.hh.
Referenced by Counter(), serialize(), startup(), unserialize(), and write().
|
private |
Determine which byte of a 16-bit count value to read/write.
Definition at line 158 of file intel_8254_timer.hh.
Referenced by Counter(), latchCount(), read(), serialize(), and unserialize().
|
private |
True after startup is called.
Definition at line 131 of file intel_8254_timer.hh.
|
private |
Definition at line 158 of file intel_8254_timer.hh.
Referenced by Counter(), serialize(), unserialize(), and write().