29 #ifndef __DEV_8254_HH__ 30 #define __DEV_8254_HH__ 38 #include "debug/Intel8254Timer.hh" 98 void setTo(
int clocks);
156 void setRW(
int rw_val);
259 #endif // __DEV_8254_HH__
void serialize(CheckpointOut &cp) const override
Serialize an object.
void setBCD(int bcd_val)
Set count encoding.
EndBitUnion(CtrlReg) enum SelectVal
virtual ~Intel8254Timer()
void writeControl(const CtrlReg data)
Write control word.
uint16_t initial_count
Initial count value.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Programmable Interval Timer (Intel 8254)
Intel8254Timer * parent
Pointer to container.
BitUnion8(CtrlReg) Bitfield< 7
friend class Counter
All counters are of 64-bit values.
Intel8254Timer(EventManager *em, const std::string &name, Counter *counter0, Counter *counter1, Counter *counter2)
Counter * counter
Pointer back to Counter.
void latchCount()
Latch the current count (if one is not already latched)
uint8_t readCounter(unsigned int num)
void setRW(int rw_val)
Set the read/write mode.
void writeCounter(unsigned int num, const uint8_t data)
virtual const char * description() const
Event description.
void startup()
Start ticking.
bool outputHigh(unsigned int num)
bool running
True after startup is called.
virtual const std::string name() const
virtual void counterInterrupt(unsigned int num)
uint8_t mode
Current mode of operation.
bool output_high
Output goes high when the counter reaches zero.
uint64_t Tick
Tick count type.
const std::string & name() const
uint8_t read_byte
Determine which byte of a 16-bit count value to read/write.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
void setMode(int mode_val)
Set operational mode.
bool latch_on
State of the count latch.
bool outputHigh()
Is the output high?
void process()
Event process.
std::ostream CheckpointOut
int currentCount()
Get the current count for this counter.
const std::string & name() const
Event for counter interrupt.
uint16_t latched_count
Latched count.
uint8_t read()
Read a count byte.
void write(const uint8_t data)
Write a count byte.
uint16_t period
Interrupt period.
Tick offset
When to start ticking.