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

--- 88 unchanged lines hidden (view full) ---

97 /** Event description */
98 virtual const char *description() const;
99
100 friend class Counter;
101
102 void setTo(int clocks);
103
104 int clocksLeft();
105
106 Tick getInterval();
107 };
108
109 private:
110 std::string _name;
111 const std::string &name() const { return _name; }
112
113 unsigned int num;
114
115 CounterEvent event;
116
117 /** True after startup is called. */
118 bool running;
119
120 /** Initial count value */
121 uint16_t initial_count;
122
123 /** Latched count */
124 uint16_t latched_count;
125
126 /** Interrupt period */
127 uint16_t period;
128
129 /** When to start ticking */
130 Tick offset;
131
132 /** Current mode of operation */
133 uint8_t mode;
134
135 /** Output goes high when the counter reaches zero */
136 bool output_high;
137
138 /** State of the count latch */
139 bool latch_on;

--- 44 unchanged lines hidden (view full) ---

184 /**
185 * Reconstruct the state of this object from a checkpoint.
186 * @param base The base name of the counter object.
187 * @param cp The checkpoint use.
188 * @param section The section name of this object
189 */
190 void unserialize(const std::string &base, Checkpoint *cp,
191 const std::string &section);
192
193 /** Start ticking */
194 void startup();
195 };
196
197 protected:
198 std::string _name;
199 const std::string &name() const { return _name; }
200
201 /** PIT has three seperate counters */
202 Counter *counter[3];

--- 49 unchanged lines hidden (view full) ---

252 /**
253 * Reconstruct the state of this object from a checkpoint.
254 * @param base The base name of the counter object.
255 * @param cp The checkpoint use.
256 * @param section The section name of this object
257 */
258 void unserialize(const std::string &base, Checkpoint *cp,
259 const std::string &section);
260
261 /** Start ticking */
262 void startup();
263};
264
265#endif // __DEV_8254_HH__