43 #include "debug/Sp805.hh" 45 #include "params/Sp805.hh" 49 timeoutInterval(0xffffffff),
51 persistedValue(timeoutInterval),
55 writeAccessEnabled(true),
56 integrationTestEnabled(false),
65 const size_t size = pkt->
getSize();
66 panic_if(size != 4,
"Sp805::read: Invalid size %i\n", size);
80 warn(
"Sp805::read: WO reg (0x%x) [WDOGINTCLR]\n", addr);
95 warn(
"Sp805::read: WO reg (0x%x) [WDOGITOP]\n", addr);
101 warn(
"Sp805::read: Unexpected address (0x%x:%i), assuming RAZ\n",
105 DPRINTF(
Sp805,
"Sp805::read: 0x%x<-0x%x(%i)\n", resp, addr, size);
116 const size_t size = pkt->
getSize();
117 panic_if(size != 4,
"Sp805::write: Invalid size %i\n", size);
133 warn(
"Sp805::write: RO reg (0x%x) [WDOGVALUE]\n", addr);
157 warn(
"Sp805::write: RO reg (0x%x) [WDOGRIS]\n", addr);
160 warn(
"Sp805::write: RO reg (0x%x) [WDOGMIS]\n", addr);
166 warn(
"Sp805::write: No support for integration test harness\n");
169 warn(
"Sp805::write: Unexpected address (0x%x:%i), assuming WI\n",
173 DPRINTF(
Sp805,
"Sp805::write: 0x%x->0x%x(%i)\n", data, addr, size);
217 warn(
"Watchdog timed out, system reset asserted\n");
271 Sp805Params::create()
273 return new Sp805(
this);
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
static constexpr uint32_t WDOGLOCK_MAGIC
If written into WdogLock, registers are unlocked for writes.
Cycles is a wrapper class for representing cycle counts, i.e.
virtual void clearInt(uint32_t num)=0
Clear an interrupt from a device that is connected to the GIC.
void restartCounter(void)
Restarts the counter to the current timeout interval.
Tick when() const
Get the time that the event is scheduled.
void stopCounter(void)
Stops the counter when watchdog becomes disabled.
Tick timeoutStartTick
Timeout start tick to keep track of the counter value.
uint32_t value(void) const
Returns the current counter value.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void timeoutExpired(void)
Triggered when value reaches 0.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void deschedule(Event &event)
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits...
Sp805(Sp805Params const *params)
#define UNSERIALIZE_SCALAR(scalar)
EventFunctionWrapper timeoutEvent
Timeout event, triggered when the counter value reaches 0.
Tick curTick()
The current simulated tick.
bool resetEnabled
Indicates if reset behaviour is enabled when counter reaches 0.
bool scheduled() const
Determine if the current event is scheduled.
virtual void sendInt(uint32_t num)=0
Post an interrupt from a device that is connected to the GIC.
uint64_t Tick
Tick count type.
uint32_t timeoutInterval
Timeout interval (in cycles) as specified in WdogLoad.
void clearInt(void)
Clears any active interrupts.
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.
bool enabled
Indicates if watchdog (counter and interrupt) is enabled.
virtual const std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
#define SERIALIZE_SCALAR(scalar)
void reschedule(Event &event, Tick when, bool always=false)
bool intRaised
Indicates if an interrupt has been raised by the counter reaching 0.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint32_t persistedValue
Value as persisted when the watchdog is stopped.
std::ostream CheckpointOut
bool integrationTestEnabled
Indicates if integration test harness is enabled.
Tick pioDelay
Delay that the device experinces on an access.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool writeAccessEnabled
Indicates if write access to registers is enabled.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Addr pioAddr
Address that the device listens to.
Arm Watchdog Module (SP805) Reference: Arm Watchdog Module (SP805) - Technical Reference Manual - rev...
void sendInt(void)
Raises an interrupt.