Go to the documentation of this file.
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");
Tick curTick()
The universal simulation clock.
Tick when() const
Get the time that the event is scheduled.
Addr pioAddr
Address that the device listens to.
static constexpr uint32_t WDOGLOCK_MAGIC
If written into WdogLock, registers are unlocked for writes.
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
void restartCounter(void)
Restarts the counter to the current timeout interval.
bool integrationTestEnabled
Indicates if integration test harness is enabled.
#define UNSERIALIZE_SCALAR(scalar)
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
bool resetEnabled
Indicates if reset behaviour is enabled when counter reaches 0.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void stopCounter(void)
Stops the counter when watchdog becomes disabled.
uint32_t value(void) const
Returns the current counter value.
Cycles is a wrapper class for representing cycle counts, i.e.
bool enabled
Indicates if watchdog (counter and interrupt) is enabled.
bool writeAccessEnabled
Indicates if write access to registers is enabled.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t Tick
Tick count type.
virtual void clear()=0
Clear a signalled interrupt.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick pioDelay
Delay that the device experinces on an access.
void reschedule(Event &event, Tick when, bool always=false)
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint32_t persistedValue
Value as persisted when the watchdog is stopped.
const std::string & name()
#define SERIALIZE_SCALAR(scalar)
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 deschedule(Event &event)
Tick timeoutStartTick
Timeout start tick to keep track of the counter value.
ArmInterruptPin *const interrupt
void clearInt(void)
Clears any active interrupts.
void timeoutExpired(void)
Triggered when value reaches 0.
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
EventFunctionWrapper timeoutEvent
Timeout event, triggered when the counter value reaches 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 timeoutInterval
Timeout interval (in cycles) as specified in WdogLoad.
std::ostream CheckpointOut
virtual void raise()=0
Signal an interrupt.
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
bool active() const
True if interrupt pin is active, false otherwise.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void sendInt(void)
Raises an interrupt.
Sp805(const Sp805Params ¶ms)
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 scheduled() const
Determine if the current event is scheduled.
Generated on Sun Jul 30 2023 01:56:55 for gem5 by doxygen 1.8.17