From 9b397ce7f45fc275f9004d78520628e2e7c0dd16 Mon Sep 17 00:00:00 2001 From: Ron Dreslinski Date: Fri, 23 Jan 2004 13:01:32 -0500 Subject: Add RTC event for uip bit dev/tsunami_io.cc: Add RTC event to change the state of a uip bit dev/tsunami_io.hh: Add RTC event to change state of an uip bit --HG-- extra : convert_revision : acde7bdfe152d3e08f7ed53b4c8e910378f6ae67 --- dev/tsunami_io.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'dev/tsunami_io.cc') diff --git a/dev/tsunami_io.cc b/dev/tsunami_io.cc index eb0b9ae91..537e40a22 100644 --- a/dev/tsunami_io.cc +++ b/dev/tsunami_io.cc @@ -22,6 +22,38 @@ #include "sim/system.hh" using namespace std; +TsunamiIO::RTCEvent::RTCEvent() + : Event(&mainEventQueue) +{ + DPRINTF(Tsunami, "RTC Event Initilizing\n"); + rtc_uip = 0; + schedule(curTick + (curTick % ticksPerSecond)); +} + +void +TsunamiIO::RTCEvent::process() +{ + DPRINTF(Tsunami, "Timer Interrupt\n"); + if (rtc_uip == 0) { + rtc_uip = 1; //Signal a second has occured + schedule(curTick + (curTick % ticksPerSecond) - 10); + } + else + rtc_uip = 0; //Done signaling second has occured + schedule(curTick + (curTick % ticksPerSecond)); +} + +const char * +TsunamiIO::RTCEvent::description() +{ + return "tsunami RTC changte second"; +} + +uint8_t +TsunamiIO::RTCEvent::rtc_uip_value() +{ + return rtc_uip; +} TsunamiIO::ClockEvent::ClockEvent() : Event(&mainEventQueue) -- cgit v1.2.3