system.hh (8922:17f037ad8918) system.hh (8931:7a1dfb191e3f)
1/*
2 * Copyright (c) 2012 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

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

54#include "base/misc.hh"
55#include "base/statistics.hh"
56#include "cpu/pc_event.hh"
57#include "enums/MemoryMode.hh"
58#include "kern/system_events.hh"
59#include "mem/fs_translating_port_proxy.hh"
60#include "mem/mem_object.hh"
61#include "mem/port.hh"
1/*
2 * Copyright (c) 2012 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

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

54#include "base/misc.hh"
55#include "base/statistics.hh"
56#include "cpu/pc_event.hh"
57#include "enums/MemoryMode.hh"
58#include "kern/system_events.hh"
59#include "mem/fs_translating_port_proxy.hh"
60#include "mem/mem_object.hh"
61#include "mem/port.hh"
62#include "mem/physical.hh"
62#include "params/System.hh"
63
64class BaseCPU;
65class BaseRemoteGDB;
66class GDBListener;
67class ObjectFile;
63#include "params/System.hh"
64
65class BaseCPU;
66class BaseRemoteGDB;
67class GDBListener;
68class ObjectFile;
68class PhysicalMemory;
69class Platform;
70class ThreadContext;
71
72class System : public MemObject
73{
74 private:
75
76 /**

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

133 }
134
135 /** Change the memory mode of the system. This should only be called by the
136 * python!!
137 * @param mode Mode to change to (atomic/timing)
138 */
139 void setMemoryMode(Enums::MemoryMode mode);
140
69class Platform;
70class ThreadContext;
71
72class System : public MemObject
73{
74 private:
75
76 /**

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

133 }
134
135 /** Change the memory mode of the system. This should only be called by the
136 * python!!
137 * @param mode Mode to change to (atomic/timing)
138 */
139 void setMemoryMode(Enums::MemoryMode mode);
140
141 PhysicalMemory *physmem;
142 PCEventQueue pcEventQueue;
143
144 std::vector<ThreadContext *> threadContexts;
145 int _numContexts;
146
147 ThreadContext *getThreadContext(ThreadID tid)
148 {
149 return threadContexts[tid];

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

154 assert(_numContexts == (int)threadContexts.size());
155 return _numContexts;
156 }
157
158 /** Return number of running (non-halted) thread contexts in
159 * system. These threads could be Active or Suspended. */
160 int numRunningContexts();
161
141 PCEventQueue pcEventQueue;
142
143 std::vector<ThreadContext *> threadContexts;
144 int _numContexts;
145
146 ThreadContext *getThreadContext(ThreadID tid)
147 {
148 return threadContexts[tid];

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

153 assert(_numContexts == (int)threadContexts.size());
154 return _numContexts;
155 }
156
157 /** Return number of running (non-halted) thread contexts in
158 * system. These threads could be Active or Suspended. */
159 int numRunningContexts();
160
162 /** List to store ranges of memories in this system */
163 AddrRangeList memRanges;
164
165 /** check if an address points to valid system memory
166 * and thus we can fetch instructions out of it
167 */
168 bool isMemory(const Addr addr) const;
169
170 Addr pagePtr;
171
172 uint64_t init_param;
173
174 /** Port to physical memory used for writing object files into ram at
175 * boot.*/
176 PortProxy physProxy;
177 FSTranslatingPortProxy virtProxy;

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

203 uint64_t nextPID;
204
205 public:
206 uint64_t allocatePID()
207 {
208 return nextPID++;
209 }
210
161 Addr pagePtr;
162
163 uint64_t init_param;
164
165 /** Port to physical memory used for writing object files into ram at
166 * boot.*/
167 PortProxy physProxy;
168 FSTranslatingPortProxy virtProxy;

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

194 uint64_t nextPID;
195
196 public:
197 uint64_t allocatePID()
198 {
199 return nextPID++;
200 }
201
202 /** Get a pointer to access the physical memory of the system */
203 PhysicalMemory& getPhysMem() { return physmem; }
204
211 /** Amount of physical memory that is still free */
205 /** Amount of physical memory that is still free */
212 Addr freeMemSize();
206 Addr freeMemSize() const;
213
214 /** Amount of physical memory that exists */
207
208 /** Amount of physical memory that exists */
215 Addr memSize();
209 Addr memSize() const;
216
210
211 /**
212 * Check if a physical address is within a range of a memory that
213 * is part of the global address map.
214 *
215 * @param addr A physical address
216 * @return Whether the address corresponds to a memory
217 */
218 bool isMemAddr(Addr addr) const;
219
217 protected:
220 protected:
221
222 PhysicalMemory physmem;
223
218 Enums::MemoryMode memoryMode;
219 uint64_t workItemsBegin;
220 uint64_t workItemsEnd;
221 uint32_t numWorkIds;
222 std::vector<bool> activeCpus;
223
224 /** This array is a per-sytem list of all devices capable of issuing a
225 * memory system request and an associated string for each master id.

--- 179 unchanged lines hidden ---
224 Enums::MemoryMode memoryMode;
225 uint64_t workItemsBegin;
226 uint64_t workItemsEnd;
227 uint32_t numWorkIds;
228 std::vector<bool> activeCpus;
229
230 /** This array is a per-sytem list of all devices capable of issuing a
231 * memory system request and an associated string for each master id.

--- 179 unchanged lines hidden ---