32#include "debug/LupioRTC.hh"
34#include "params/LupioRTC.hh"
57 total_time = (time_t) time_sec +
start;
62 gmtime_r(&total_time, &
time);
81 r = (
time.tm_year + 1900) % 100;
84 r = (
time.tm_year + 1900) / 100;
87 r = 1 + (
time.tm_wday + 6) % 7;
101 "Read request - addr: %#x, size: %#x, atomic:%d\n",
122 panic(
"Unexpected write to the LupioRTC device!");
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
LupioRTC: A Real-Time Clock Virtual Device that returns the current date and time in ISO 8601 format.
LupioRTC(const Params ¶ms)
Tick read(PacketPtr pkt) override
Implement BasicPioDevice virtual functions.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
uint8_t lupioRTCRead(const uint8_t addr)
Function to return current time and date using system's wall-clock time.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
void setData(const uint8_t *p)
Copy data into the packet from the provided pointer.
void makeAtomicResponse()
MemCmd cmd
The command field of the packet.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.