45 #include "debug/Checkpoint.hh" 46 #include "debug/Timer.hh" 53 lastWrittenTick(0), loadVal(0), matchVal(0),
54 rawInt(false), maskInt(false), pendingInt(false),
68 DPRINTF(Timer,
"Reading from RTC at offset: %#x\n", daddr);
95 data = pkt->
getLE<uint32_t>();
98 panic(
"Tried to read PL031 at offset %#x that doesn't exist\n", daddr);
113 panic(
"Uart read size too big?\n");
128 DPRINTF(Timer,
"Writing to RTC at offset: %#x\n", daddr);
149 if (pkt->
getLE<uint32_t>()) {
157 panic(
"Tried to read PL031 at offset %#x that doesn't exist\n", daddr);
168 DPRINTF(Timer,
"Setting up new match event match=%d time=%d\n",
matchVal,
175 DPRINTF(Timer,
"-- Event was already schedule, de-scheduling\n");
179 DPRINTF(Timer,
"-- Scheduling new event for: %d\n",
curTick() + ticks_until);
185 DPRINTF(Timer,
"Counter reached zero\n");
191 DPRINTF(Timer,
"-- Causing interrupt\n");
199 DPRINTF(Checkpoint,
"Serializing Arm PL031\n");
221 DPRINTF(Checkpoint,
"Unserializing Arm PL031\n");
244 PL031Params::create()
246 return new PL031(
this);
#define panic(...)
This implements a cprintf based panic() function.
Tick when() const
Get the time that the event is scheduled.
EventFunctionWrapper matchEvent
Tick read(PacketPtr pkt) override
Handle a read to the device.
AmbaPioDeviceParams Params
Tick write(PacketPtr pkt) override
Handle writes to the device.
void resyncMatch()
Called to update the matchEvent when the load Value or match value are written.
bool rawInt
If timer has caused an interrupt.
void deschedule(Event &event)
void setLE(T v)
Set the value in the data pointer to v as little endian.
#define UNSERIALIZE_SCALAR(scalar)
bool maskInt
If the timer interrupt mask that is anded with the raw interrupt to generate a pending interrupt...
Tick curTick()
The current simulated tick.
bool scheduled() const
Determine if the current event is scheduled.
Addr pioSize
Size that the device's address range.
void serialize(CheckpointOut &cp) const override
Serialize an object.
This is a base class for AMBA devices that have to respond to Device and Implementer ID calls...
virtual void sendInt(uint32_t num)=0
Post an interrupt from a device that is connected to the GIC.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual const std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
#define SERIALIZE_SCALAR(scalar)
This implements the ARM Primecell 031 RTC.
Declaration of the Packet class.
std::ostream CheckpointOut
bool pendingInt
If an interrupt is currently pending.
Tick pioDelay
Delay that the device experinces on an access.
PL031(Params *p)
The constructor for RealView just registers itself with the MMU.
void schedule(Event &event, Tick when)
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
void counterMatch()
Called when the counter reaches matches.
Addr pioAddr
Address that the device listens to.
time_t mkutctime(struct tm *time)