base.hh (8834:21e8d54ecf07) base.hh (8850:ed91b534ed04)
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

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

58#include "sim/full_system.hh"
59#include "sim/insttracer.hh"
60
61class BaseCPUParams;
62class BranchPred;
63class CheckerCPU;
64class ThreadContext;
65class System;
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

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

58#include "sim/full_system.hh"
59#include "sim/insttracer.hh"
60
61class BaseCPUParams;
62class BranchPred;
63class CheckerCPU;
64class ThreadContext;
65class System;
66class Port;
67
68namespace TheISA
69{
70 class Predecoder;
71}
72
73class CPUProgressEvent : public Event
74{

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

142
143 void recvFunctional(PacketPtr pkt);
144
145 void recvRangeChange();
146
147 };
148
149 public:
66
67namespace TheISA
68{
69 class Predecoder;
70}
71
72class CPUProgressEvent : public Event
73{

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

141
142 void recvFunctional(PacketPtr pkt);
143
144 void recvRangeChange();
145
146 };
147
148 public:
149
150 /**
151 * Purely virtual method that returns a reference to the data
152 * port. All subclasses must implement this method.
153 *
154 * @return a reference to the data port
155 */
156 virtual CpuPort &getDataPort() = 0;
157
158 /**
159 * Purely virtual method that returns a reference to the instruction
160 * port. All subclasses must implement this method.
161 *
162 * @return a reference to the instruction port
163 */
164 virtual CpuPort &getInstPort() = 0;
165
150 /** Reads this CPU's ID. */
151 int cpuId() { return _cpuId; }
152
153 /** Reads this CPU's unique data requestor ID */
154 MasterID dataMasterId() { return _dataMasterId; }
155 /** Reads this CPU's unique instruction requestor ID */
156 MasterID instMasterId() { return _instMasterId; }
157
166 /** Reads this CPU's ID. */
167 int cpuId() { return _cpuId; }
168
169 /** Reads this CPU's unique data requestor ID */
170 MasterID dataMasterId() { return _dataMasterId; }
171 /** Reads this CPU's unique instruction requestor ID */
172 MasterID instMasterId() { return _instMasterId; }
173
174 /**
175 * Get a port on this MemObject. This method is virtual to allow
176 * the subclasses of the BaseCPU to override it. All CPUs have a
177 * data and instruction port, but the Atomic CPU (in its current
178 * form) adds a port directly connected to the memory and has to
179 * override getPort.
180 *
181 * This method uses getDataPort and getInstPort to resolve the two
182 * ports.
183 *
184 * @param if_name the port name
185 * @param idx ignored index
186 *
187 * @return a pointer to the port with the given name
188 */
189 virtual Port *getPort(const std::string &if_name, int idx = -1);
190
158// Tick currentTick;
159 inline Tick frequency() const { return SimClock::Frequency / clock; }
160 inline Tick ticks(int numCycles) const { return clock * numCycles; }
161 inline Tick curCycle() const { return curTick() / clock; }
162 inline Tick tickToCycles(Tick val) const { return val / clock; }
163 inline void workItemBegin() { numWorkItemsStarted++; }
164 inline void workItemEnd() { numWorkItemsCompleted++; }
165 // @todo remove me after debugging with legion done

--- 223 unchanged lines hidden ---
191// Tick currentTick;
192 inline Tick frequency() const { return SimClock::Frequency / clock; }
193 inline Tick ticks(int numCycles) const { return clock * numCycles; }
194 inline Tick curCycle() const { return curTick() / clock; }
195 inline Tick tickToCycles(Tick val) const { return val / clock; }
196 inline void workItemBegin() { numWorkItemsStarted++; }
197 inline void workItemEnd() { numWorkItemsCompleted++; }
198 // @todo remove me after debugging with legion done

--- 223 unchanged lines hidden ---