47 #include "config/the_isa.hh"
48 #include "debug/Tsunami.hh"
64 using namespace TheISA;
67 :
MC146818(p->tsunami, n, p->time, p->year_is_bcd, p->frequency),
100 if (pkt->
getSize() ==
sizeof(uint8_t)) {
140 }
else if (pkt->
getSize() ==
sizeof(uint64_t)) {
144 panic(
"I/O Read - invalid addr - va %#x size %d\n",
159 DPRINTF(
Tsunami,
"io write - va=%#x size=%d IOPort=%#x Data=%#x\n",
162 assert(pkt->
getSize() ==
sizeof(uint8_t));
184 picr &= ~(1 << (pkt->
get<uint8_t>() & 0xF));
296 TsunamiIOParams::create()
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
Emulation of the Tsunami CChip CSRs.
uint8_t readData(const uint8_t addr)
RTC read data.
void writeControl(const CtrlReg data)
Write control word.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Real-Time Clock (MC146818)
void postDRIR(uint32_t interrupt)
post an interrupt to the CPU.
void writeData(const uint8_t addr, const uint8_t data)
RTC write data.
Top level class for Tsunami Chipset emulation.
uint8_t mode1
Mode of PIC1.
void clearPIC(uint8_t bitvector)
Clear a posted interrupt.
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
void startup() override
Start running.
uint8_t readCounter(unsigned int num)
TsunamiCChip * cchip
Pointer to the Tsunami CChip.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
void writeCounter(unsigned int num, const uint8_t data)
void startup()
Start ticking.
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
uint16_t timerData
The interval is set via two writes to the PIT.
bool picInterrupting
Is the pic interrupting right now or not.
bool outputHigh(unsigned int num)
const Params * params() const
#define UNSERIALIZE_SCALAR(scalar)
Addr pioSize
Size that the device's address range.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
Declaration of top level class for the Tsunami chipset.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
RTC(const std::string &n, const TsunamiIOParams *p)
Tsunami * tsunami
A pointer to the Tsunami device which be belong to.
Tsunami I/O Space mapping including RTC/timer interrupts.
Tick frequency() const
Return the freqency of the RTC.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
TsunamiIO(const Params *p)
Initialize all the data for devices supported by Tsunami I/O.
#define SERIALIZE_SCALAR(scalar)
uint8_t mode2
Mode of PIC2.
uint8_t mask2
Mask of the PIC2.
virtual const std::string name() const
Declaration of the Packet class.
std::ostream CheckpointOut
virtual void startup()
Start ticking.
Intel8254Timer pitimer
Intel 8253 Periodic Interval Timer.
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
uint8_t picr
Raw PIC interrupt register before masking.
Tick pioDelay
Delay that the device experinces on an access.
void clearDRIR(uint32_t interrupt)
clear an interrupt previously posted to the CPU.
Tsunami I/O device is a catch all for all the south bridge stuff we care to implement.
TsunamiIO * io
Pointer to the TsunamiIO device which has the RTC.
uint8_t mask1
Mask of the PIC1.
void postPIC(uint8_t bitvector)
Post an PIC interrupt to the CPU via the CChip.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Addr pioAddr
Address that the device listens to.
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.