summaryrefslogtreecommitdiff
path: root/dev/tsunami_io.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-03-29 07:55:44 -0500
committerNathan Binkert <binkertn@umich.edu>2005-03-29 07:55:44 -0500
commit43a9caa2214faffaa1fd5ce1730063f9959a8ce8 (patch)
treec4e76e7d0dffaee04f58f131e458b23d8be06611 /dev/tsunami_io.cc
parenta86b95cb182b435bda5d76197cd9f32ba6db83c2 (diff)
downloadgem5-43a9caa2214faffaa1fd5ce1730063f9959a8ce8.tar.xz
expose variables for number of global events per simulated second,
millisecond, microsecond, etc. so that the user can explicitly convert between system ticks and time and know what sorts of expensive operations are being used for that conversion. arch/alpha/alpha_tru64_process.cc: arch/alpha/pseudo_inst.cc: dev/etherdump.cc: dev/etherlink.cc: dev/ns_gige.cc: dev/sinic.cc: dev/tsunami_io.cc: dev/uart.cc: sim/stat_control.cc: sim/syscall_emul.hh: Use the new variables for getting the event clock dev/etherdump.hh: delete variables that are no longer needed. --HG-- extra : convert_revision : d95fc7d44909443e1b7952a24ef822ef051c7cf2
Diffstat (limited to 'dev/tsunami_io.cc')
-rw-r--r--dev/tsunami_io.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/dev/tsunami_io.cc b/dev/tsunami_io.cc
index 6c9195bff..1e4f44346 100644
--- a/dev/tsunami_io.cc
+++ b/dev/tsunami_io.cc
@@ -95,6 +95,13 @@ TsunamiIO::RTCEvent::unserialize(Checkpoint *cp, const std::string &section)
TsunamiIO::ClockEvent::ClockEvent()
: Event(&mainEventQueue)
{
+ /* This is the PIT Tick Rate. A constant for the 8254 timer. The
+ * Tsunami platform has one of these cycle counters on the Cypress
+ * South Bridge and it is used by linux for estimating the cycle
+ * frequency of the machine it is running on. --Ali
+ */
+ interval = (Tick)(Clock::Float::s / 1193180.0);
+
DPRINTF(Tsunami, "Clock Event Initilizing\n");
mode = 0;
}
@@ -113,9 +120,7 @@ void
TsunamiIO::ClockEvent::Program(int count)
{
DPRINTF(Tsunami, "Timer set to curTick + %d\n", count);
- // should be count * (cpufreq/pitfreq)
- interval = count * ticksPerSecond/1193180UL;
- schedule(curTick + interval);
+ schedule(curTick + count * interval);
status = 0;
}