1/* 2 * Copyright (c) 2004, 2005 3 * The Regents of The University of Michigan 4 * All Rights Reserved 5 * 6 * This code is part of the M5 simulator. 7 * 8 * Permission is granted to use, copy, create derivative works and --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Ali G. Saidi 29 * Andrew L. Schultz 30 * Miguel J. Serrano 31 */ 32 33#include "base/misc.hh" 34#include "dev/intel_8254_timer.hh" |
35 36using namespace std; 37 38Intel8254Timer::Intel8254Timer(EventManager *em, const string &name, 39 Counter *counter0, Counter *counter1, Counter *counter2) : 40 EventManager(em), _name(name) 41{ 42 counter[0] = counter0; --- 21 unchanged lines hidden (view full) --- 64 counter[sel]->latchCount(); 65 else { 66 counter[sel]->setRW(data.rw); 67 counter[sel]->setMode(data.mode); 68 counter[sel]->setBCD(data.bcd); 69 } 70} 71 |
72void 73Intel8254Timer::serialize(const string &base, ostream &os) 74{ 75 // serialize the counters 76 counter[0]->serialize(base + ".counter0", os); 77 counter[1]->serialize(base + ".counter1", os); 78 counter[2]->serialize(base + ".counter2", os); 79} --- 131 unchanged lines hidden (view full) --- 211} 212 213bool 214Intel8254Timer::Counter::outputHigh() 215{ 216 return output_high; 217} 218 |
219void 220Intel8254Timer::Counter::serialize(const string &base, ostream &os) 221{ 222 paramOut(os, base + ".initial_count", initial_count); 223 paramOut(os, base + ".latched_count", latched_count); 224 paramOut(os, base + ".period", period); 225 paramOut(os, base + ".mode", mode); 226 paramOut(os, base + ".output_high", output_high); 227 paramOut(os, base + ".latch_on", latch_on); 228 paramOut(os, base + ".read_byte", read_byte); 229 paramOut(os, base + ".write_byte", write_byte); |
230 231 Tick event_tick = 0; 232 if (event.scheduled()) 233 event_tick = event.when(); |
234 paramOut(os, base + ".event_tick", event_tick); 235} 236 237void 238Intel8254Timer::Counter::unserialize(const string &base, Checkpoint *cp, 239 const string §ion) 240{ 241 paramIn(cp, section, base + ".initial_count", initial_count); 242 paramIn(cp, section, base + ".latched_count", latched_count); 243 paramIn(cp, section, base + ".period", period); 244 paramIn(cp, section, base + ".mode", mode); 245 paramIn(cp, section, base + ".output_high", output_high); 246 paramIn(cp, section, base + ".latch_on", latch_on); 247 paramIn(cp, section, base + ".read_byte", read_byte); 248 paramIn(cp, section, base + ".write_byte", write_byte); 249 |
250 Tick event_tick; |
251 paramIn(cp, section, base + ".event_tick", event_tick); 252 if (event_tick) 253 parent->schedule(event, event_tick); 254} 255 256Intel8254Timer::Counter::CounterEvent::CounterEvent(Counter* c_ptr) 257{ 258 interval = (Tick)(SimClock::Float::s / 1193180.0); --- 43 unchanged lines hidden --- |