Go to the documentation of this file.
41 #include "debug/Sp805.hh"
43 #include "params/Sp805.hh"
47 timeoutInterval(0xffffffff),
49 persistedValue(timeoutInterval),
52 writeAccessEnabled(true),
53 integrationTestEnabled(false),
62 const size_t size = pkt->
getSize();
63 panic_if(size != 4,
"Sp805::read: Invalid size %i\n", size);
77 warn(
"Sp805::read: WO reg (0x%x) [WDOGINTCLR]\n",
addr);
92 warn(
"Sp805::read: WO reg (0x%x) [WDOGITOP]\n",
addr);
96 resp = pkt->
getUintX(ByteOrder::little);
98 warn(
"Sp805::read: Unexpected address (0x%x:%i), assuming RAZ\n",
104 pkt->
setUintX(resp, ByteOrder::little);
113 const size_t size = pkt->
getSize();
114 panic_if(size != 4,
"Sp805::write: Invalid size %i\n", size);
130 warn(
"Sp805::write: RO reg (0x%x) [WDOGVALUE]\n",
addr);
154 warn(
"Sp805::write: RO reg (0x%x) [WDOGRIS]\n",
addr);
157 warn(
"Sp805::write: RO reg (0x%x) [WDOGMIS]\n",
addr);
163 warn(
"Sp805::write: No support for integration test harness\n");
166 warn(
"Sp805::write: Unexpected address (0x%x:%i), assuming WI\n",
214 warn(
"Watchdog timed out, system reset asserted\n");
264 Sp805Params::create()
266 return new Sp805(
this);
bool scheduled() const
Determine if the current event is scheduled.
void sendInt(void)
Raises an interrupt.
Addr pioAddr
Address that the device listens to.
Tick timeoutStartTick
Timeout start tick to keep track of the counter value.
#define UNSERIALIZE_SCALAR(scalar)
void reschedule(Event &event, Tick when, bool always=false)
virtual void clear()=0
Clear a signalled interrupt.
void stopCounter(void)
Stops the counter when watchdog becomes disabled.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
virtual void raise()=0
Signal an interrupt.
static constexpr uint32_t WDOGLOCK_MAGIC
If written into WdogLock, registers are unlocked for writes.
uint64_t Tick
Tick count type.
void restartCounter(void)
Restarts the counter to the current timeout interval.
void deschedule(Event &event)
bool resetEnabled
Indicates if reset behaviour is enabled when counter reaches 0.
Tick when() const
Get the time that the event is scheduled.
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.
Sp805(Sp805Params const *params)
ArmInterruptPin *const interrupt
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
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...
void unserialize(CheckpointIn &cp) override
Unserialize an object.
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 ...
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
EventFunctionWrapper timeoutEvent
Timeout event, triggered when the counter value reaches 0.
uint32_t timeoutInterval
Timeout interval (in cycles) as specified in WdogLoad.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
const std::string & name()
#define SERIALIZE_SCALAR(scalar)
bool active() const
True if interrupt pin is active, false otherwise.
bool enabled
Indicates if watchdog (counter and interrupt) is enabled.
void clearInt(void)
Clears any active interrupts.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void serialize(CheckpointOut &cp) const override
Serialize an object.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool integrationTestEnabled
Indicates if integration test harness is enabled.
Cycles is a wrapper class for representing cycle counts, i.e.
Tick pioDelay
Delay that the device experinces on an access.
std::ostream CheckpointOut
uint32_t persistedValue
Value as persisted when the watchdog is stopped.
bool writeAccessEnabled
Indicates if write access to registers is enabled.
Tick curTick()
The current simulated tick.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:02:10 for gem5 by doxygen 1.8.17