41#include "debug/Sp805.hh"
43#include "params/Sp805.hh"
50 timeoutInterval(0xffffffff),
52 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);
99 resp = pkt->
getUintX(ByteOrder::little);
101 warn(
"Sp805::read: Unexpected address (0x%x:%i), assuming RAZ\n",
107 pkt->
setUintX(resp, ByteOrder::little);
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",
217 warn(
"Watchdog timed out, system reset asserted\n");
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
ArmInterruptPin *const interrupt
virtual void clear()=0
Clear a signalled interrupt.
virtual void raise()=0
Signal an interrupt.
bool active() const
True if interrupt pin is active, false otherwise.
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
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...
Cycles is a wrapper class for representing cycle counts, i.e.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
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 ...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
bool integrationTestEnabled
Indicates if integration test harness is enabled.
uint32_t value(void) const
Returns the current counter value.
uint32_t persistedValue
Value as persisted when the watchdog is stopped.
static constexpr uint32_t WDOGLOCK_MAGIC
If written into WdogLock, registers are unlocked for writes.
bool resetEnabled
Indicates if reset behaviour is enabled when counter reaches 0.
void restartCounter(void)
Restarts the counter to the current timeout interval.
void stopCounter(void)
Stops the counter when watchdog becomes disabled.
void clearInt(void)
Clears any active interrupts.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void serialize(CheckpointOut &cp) const override
Serialize an object.
uint32_t timeoutInterval
Timeout interval (in cycles) as specified in WdogLoad.
void sendInt(void)
Raises an interrupt.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool enabled
Indicates if watchdog (counter and interrupt) is enabled.
Tick timeoutStartTick
Timeout start tick to keep track of the counter value.
void timeoutExpired(void)
Triggered when value reaches 0.
bool writeAccessEnabled
Indicates if write access to registers is enabled.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
EventFunctionWrapper timeoutEvent
Timeout event, triggered when the counter value reaches 0.
Sp805(const Sp805Params ¶ms)
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
void deschedule(Event &event)
bool scheduled() const
Determine if the current event is scheduled.
void reschedule(Event &event, Tick when, bool always=false)
Tick when() const
Get the time that the event is scheduled.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)
const std::string & name()
Arm Watchdog Module (SP805) Reference: Arm Watchdog Module (SP805) - Technical Reference Manual - rev...