base.hh (9023:e9201a7bce59) base.hh (9157:e0bad9d7bbd6)
1/*
2 * Copyright (c) 2011 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

83 void repeatEvent(bool repeat) { _repeatEvent = repeat; }
84
85 virtual const char *description() const;
86};
87
88class BaseCPU : public MemObject
89{
90 protected:
1/*
2 * Copyright (c) 2011 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

83 void repeatEvent(bool repeat) { _repeatEvent = repeat; }
84
85 virtual const char *description() const;
86};
87
88class BaseCPU : public MemObject
89{
90 protected:
91 // CPU's clock period in terms of the number of ticks of curTime.
92 Tick clock;
91
93 // @todo remove me after debugging with legion done
94 Tick instCnt;
95 // every cpu has an id, put it in the base cpu
96 // Set at initialization, only time a cpuId might change is during a
97 // takeover (which should be done from within the BaseCPU anyway,
98 // therefore no setCpuId() method is provided
99 int _cpuId;
100

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

169 *
170 * @param if_name the port name
171 * @param idx ignored index
172 *
173 * @return a reference to the port with the given name
174 */
175 MasterPort &getMasterPort(const std::string &if_name, int idx = -1);
176
92 // @todo remove me after debugging with legion done
93 Tick instCnt;
94 // every cpu has an id, put it in the base cpu
95 // Set at initialization, only time a cpuId might change is during a
96 // takeover (which should be done from within the BaseCPU anyway,
97 // therefore no setCpuId() method is provided
98 int _cpuId;
99

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

168 *
169 * @param if_name the port name
170 * @param idx ignored index
171 *
172 * @return a reference to the port with the given name
173 */
174 MasterPort &getMasterPort(const std::string &if_name, int idx = -1);
175
177// Tick currentTick;
178 inline Tick frequency() const { return SimClock::Frequency / clock; }
179 inline Tick ticks(int numCycles) const { return clock * numCycles; }
180 inline Tick curCycle() const { return curTick() / clock; }
181 inline Tick tickToCycles(Tick val) const { return val / clock; }
182 inline void workItemBegin() { numWorkItemsStarted++; }
183 inline void workItemEnd() { numWorkItemsCompleted++; }
184 // @todo remove me after debugging with legion done
185 Tick instCount() { return instCnt; }
186
176 inline void workItemBegin() { numWorkItemsStarted++; }
177 inline void workItemEnd() { numWorkItemsCompleted++; }
178 // @todo remove me after debugging with legion done
179 Tick instCount() { return instCnt; }
180
187 /** The next cycle the CPU should be scheduled, given a cache
188 * access or quiesce event returning on this cycle. This function
189 * may return curTick() if the CPU should run on the current cycle.
190 */
191 Tick nextCycle();
192
193 /** The next cycle the CPU should be scheduled, given a cache
194 * access or quiesce event returning on the given Tick. This
195 * function may return curTick() if the CPU should run on the
196 * current cycle.
197 * @param begin_tick The tick that the event is completing on.
198 */
199 Tick nextCycle(Tick begin_tick);
200
201 TheISA::MicrocodeRom microcodeRom;
202
203 protected:
204 TheISA::Interrupts *interrupts;
205
206 public:
207 TheISA::Interrupts *
208 getInterruptController()

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

323 * Vector of per-thread load-based event queues. Used for
324 * scheduling events based on number of loads committed by
325 *a particular thread.
326 */
327 EventQueue **comLoadEventQueue;
328
329 System *system;
330
181 TheISA::MicrocodeRom microcodeRom;
182
183 protected:
184 TheISA::Interrupts *interrupts;
185
186 public:
187 TheISA::Interrupts *
188 getInterruptController()

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

303 * Vector of per-thread load-based event queues. Used for
304 * scheduling events based on number of loads committed by
305 *a particular thread.
306 */
307 EventQueue **comLoadEventQueue;
308
309 System *system;
310
331 Tick phase;
332
333 /**
334 * Serialize this object to the given output stream.
335 * @param os The stream to serialize to.
336 */
337 virtual void serialize(std::ostream &os);
338
339 /**
340 * Reconstruct the state of this object from a checkpoint.

--- 66 unchanged lines hidden ---
311 /**
312 * Serialize this object to the given output stream.
313 * @param os The stream to serialize to.
314 */
315 virtual void serialize(std::ostream &os);
316
317 /**
318 * Reconstruct the state of this object from a checkpoint.

--- 66 unchanged lines hidden ---