41#include "params/GenericWatchdog.hh"
53 refreshFrame(
p.refresh_start,
p.refresh_start + 0x10000),
54 controlFrame(
p.control_start,
p.control_start + 0x10000),
55 pioLatency(
p.pio_latency),
56 cnt(*
p.system_counter),
61 cnt.registerListener(&cntListener);
77 const size_t size = pkt->
getSize();
78 panic_if(size != 4,
"GenericWatchdog::read: Invalid size %i\n", size);
87 panic(
"%s unknown address %#x\n", __func__,
addr);
90 pkt->
setUintX(resp, ByteOrder::little);
108 panic(
"%s unknown address %#x\n", __func__,
addr);
120 return controlStatus;
130 panic(
"%s unknown address %#x\n", __func__,
addr);
138 const size_t size = pkt->
getSize();
139 panic_if(size != 4,
"GenericWatchdog::write: Invalid size %i\n", size);
148 panic(
"%s unknown address %#x\n", __func__,
addr);
166 panic(
"%s unknown address %#x\n", __func__,
addr);
178 controlStatus =
data & 0x1;
192 panic(
"%s unknown address %#x\n", __func__,
addr);
200 controlStatus.ws0 = 0;
201 controlStatus.ws1 = 0;
224 if (!controlStatus.enabled)
227 if (!controlStatus.ws0) {
228 controlStatus.ws0 = 1;
231 controlStatus.ws1 = 1;
Base class for ARM GIC implementations.
virtual void clear()=0
Clear a signalled interrupt.
virtual void raise()=0
Signal an interrupt.
const uint32_t iidr
Interface Identification Register.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
const AddrRange controlFrame
EventFunctionWrapper timeoutEvent
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
ArmInterruptPin *const ws1
void writeRefresh(Addr addr, uint32_t data)
uint64_t compare
Compare Register.
const AddrRange refreshFrame
uint32_t readControl(Addr addr)
GenericWatchdog(const GenericWatchdogParams ¶ms)
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
void writeControl(Addr addr, uint32_t data)
uint32_t offset
Offset Register.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
uint32_t readRefresh(Addr addr)
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.
This device is the base class which all devices senstive to an address range inherit from.
Tick whenValue(uint64_t target_val)
Returns the tick at which a certain counter value is reached.
uint64_t value()
Updates and returns the counter value.
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
bool contains(const Addr &a) const
Determine if the range contains an address.
Addr start() const
Get the start address of the range.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
constexpr T insertBits(T val, unsigned first, unsigned last, B bit_val)
Returns val with bits first to last set to the LSBs of bit_val.
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(...)
This implements a cprintf based panic() function.
#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.
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 SBSA Generic Watchdog Reference: Arm Server Base System Architecture (SBSA) Doc.