Go to the documentation of this file.
41 #include "params/GenericWatchdog.hh"
51 refreshFrame(
p.refresh_start,
p.refresh_start + 0x10000),
52 controlFrame(
p.control_start,
p.control_start + 0x10000),
53 pioLatency(
p.pio_latency),
54 cnt(*
p.system_counter),
59 cnt.registerListener(&cntListener);
75 const size_t size = pkt->
getSize();
76 panic_if(size != 4,
"GenericWatchdog::read: Invalid size %i\n", size);
85 panic(
"%s unknown address %#x\n", __func__,
addr);
88 pkt->
setUintX(resp, ByteOrder::little);
106 panic(
"%s unknown address %#x\n", __func__,
addr);
118 return controlStatus;
128 panic(
"%s unknown address %#x\n", __func__,
addr);
136 const size_t size = pkt->
getSize();
137 panic_if(size != 4,
"GenericWatchdog::write: Invalid size %i\n", size);
146 panic(
"%s unknown address %#x\n", __func__,
addr);
164 panic(
"%s unknown address %#x\n", __func__,
addr);
176 controlStatus =
data & 0x1;
190 panic(
"%s unknown address %#x\n", __func__,
addr);
198 controlStatus.ws0 = 0;
199 controlStatus.ws1 = 0;
222 if (!controlStatus.enabled)
225 if (!controlStatus.ws0) {
226 controlStatus.ws0 = 1;
229 controlStatus.ws1 = 1;
EventFunctionWrapper timeoutEvent
bool scheduled() const
Determine if the current event is scheduled.
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.
Tick whenValue(uint64_t target_val)
Returns the tick at which a certain counter value is reached.
#define UNSERIALIZE_SCALAR(scalar)
void reschedule(Event &event, Tick when, bool always=false)
virtual void clear()=0
Clear a signalled interrupt.
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
uint32_t offset
Offset Register.
virtual void raise()=0
Signal an interrupt.
uint64_t Tick
Tick count type.
bool contains(const Addr &a) const
Determine if the range contains an address.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
ArmInterruptPin *const ws1
Tick when() const
Get the time that the event is scheduled.
void writeControl(Addr addr, uint32_t data)
This device is the base class which all devices senstive to an address range inherit from.
GenericWatchdog(const GenericWatchdogParams ¶ms)
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
uint64_t compare
Compare Register.
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 serialize(CheckpointOut &cp) const override
Serialize an object.
uint64_t value()
Updates and returns the counter value.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const AddrRange refreshFrame
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()
const AddrRange controlFrame
#define SERIALIZE_SCALAR(scalar)
uint32_t readControl(Addr addr)
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
uint32_t readRefresh(Addr addr)
Addr start() const
Get the start address of the range.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void writeRefresh(Addr addr, uint32_t data)
std::ostream CheckpointOut
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
const uint32_t iidr
Interface Identification Register.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Tue Jun 22 2021 15:28:27 for gem5 by doxygen 1.8.17