41#include "params/RiscvRTC.hh"
48 rtc(this, params.
name, params.time, params.bcd,
49 params.frequency, params.port_int_pin_connection_count)
54 const struct tm time,
bool bcd,
Tick frequency,
int int_pin_count) :
57 for (
int i = 0;
i < int_pin_count;
i++) {
66 for (
auto &pin: intPin) {
75 if (if_name ==
"int_pin")
78 panic(
"Getting invalid port " + if_name);
Real-Time Clock (MC146818)
virtual void startup()
Start ticking.
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
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.
Abstract superclass for simulation objects.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
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)
const std::string & name()