41#include "params/RiscvRTC.hh"
54 const struct tm time,
bool bcd,
Tick frequency,
int int_pin_count) :
57 for (
int i = 0;
i < int_pin_count;
i++) {
75 if (if_name ==
"int_pin")
76 return *
rtc.intPin.at(idx);
78 panic(
"Getting invalid port " + if_name);
91 rtc.serialize(
"rtc",
cp);
98 rtc.unserialize(
"rtc",
cp);
MC146818(EventManager *em, const std::string &name, const struct tm time, bool bcd, Tick frequency)
virtual std::string name() const
Ports are used to interface objects to each other.
RTC(EventManager *em, const std::string &n, const struct tm time, bool bcd, Tick frequency, int int_pin_count)
std::vector< std::unique_ptr< IntSource > > intPin
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
RiscvRTC(const Params ¶ms)
void startup() override
startup() is the final initialization call before simulation.
EventManager(EventManager &em)
Event manger manages events in the event queue.
#define panic(...)
This implements a cprintf based panic() function.
const Params & params() const
SimObject(const Params &p)
Copyright (c) 2024 Arm Limited All rights reserved.
IntSourcePinBase IntSourcePin
std::ostream CheckpointOut
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)