Deleted Added
sdiff udiff text old ( 10568:e70523bd0d26 ) new ( 10653:e3fc6bc7f97e )
full compact
1/*
2 * Copyright (c) 2012-2013 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

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

193 static const PrivateFlagsType VALID_EXTRA_DATA = 0x00000080;
194
195 /** These flags are *not* cleared when a Request object is reused
196 (assigned a new address). */
197 static const PrivateFlagsType STICKY_PRIVATE_FLAGS =
198 VALID_CONTEXT_ID | VALID_THREAD_ID;
199
200 private:
201
202 /**
203 * Set up a physical (e.g. device) request in a previously
204 * allocated Request object.
205 */
206 void
207 setPhys(Addr paddr, unsigned size, Flags flags, MasterID mid, Tick time)
208 {
209 assert(size >= 0);
210 _paddr = paddr;
211 _size = size;
212 _time = time;
213 _masterId = mid;
214 _flags.clear(~STICKY_FLAGS);
215 _flags.set(flags);
216 privateFlags.clear(~STICKY_PRIVATE_FLAGS);
217 privateFlags.set(VALID_PADDR|VALID_SIZE);
218 depth = 0;
219 accessDelta = 0;
220 //translateDelta = 0;
221 }
222
223 /**
224 * The physical address of the request. Valid only if validPaddr
225 * is set.
226 */
227 Addr _paddr;
228
229 /**
230 * The size of the request. This field must be set when vaddr or
231 * paddr is written via setVirt() or setPhys(), so it is always
232 * valid as long as one of the address fields is valid.
233 */
234 unsigned _size;
235
236 /** The requestor ID which is unique in the system for all ports
237 * that are capable of issuing a transaction
238 */
239 MasterID _masterId;
240
241 /** Flag structure for the request. */
242 Flags _flags;

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

271 int _contextId;
272 /** The thread ID (id within this CPU) */
273 int _threadId;
274
275 /** program counter of initiating access; for tracing/debugging */
276 Addr _pc;
277
278 public:
279
280 /**
281 * Minimal constructor. No fields are initialized. (Note that
282 * _flags and privateFlags are cleared by Flags default
283 * constructor.)
284 */
285 Request()
286 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
287 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
288 _extraData(0), _contextId(0), _threadId(0), _pc(0),
289 translateDelta(0), accessDelta(0), depth(0)
290 {}
291
292 /**
293 * Constructor for physical (e.g. device) requests. Initializes
294 * just physical address, size, flags, and timestamp (to curTick()).
295 * These fields are adequate to perform a request.
296 */
297 Request(Addr paddr, unsigned size, Flags flags, MasterID mid)
298 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
299 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
300 _extraData(0), _contextId(0), _threadId(0), _pc(0),
301 translateDelta(0), accessDelta(0), depth(0)
302 {
303 setPhys(paddr, size, flags, mid, curTick());
304 }
305
306 Request(Addr paddr, unsigned size, Flags flags, MasterID mid, Tick time)
307 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
308 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
309 _extraData(0), _contextId(0), _threadId(0), _pc(0),
310 translateDelta(0), accessDelta(0), depth(0)
311 {
312 setPhys(paddr, size, flags, mid, time);
313 }
314
315 Request(Addr paddr, unsigned size, Flags flags, MasterID mid, Tick time,
316 Addr pc)
317 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
318 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
319 _extraData(0), _contextId(0), _threadId(0), _pc(0),
320 translateDelta(0), accessDelta(0), depth(0)
321 {
322 setPhys(paddr, size, flags, mid, time);
323 privateFlags.set(VALID_PC);
324 _pc = pc;
325 }
326
327 Request(int asid, Addr vaddr, unsigned size, Flags flags, MasterID mid,
328 Addr pc,
329 int cid, ThreadID tid)
330 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
331 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
332 _extraData(0), _contextId(0), _threadId(0), _pc(0),
333 translateDelta(0), accessDelta(0), depth(0)
334 {
335 setVirt(asid, vaddr, size, flags, mid, pc);
336 setThreadContext(cid, tid);

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

345 setThreadContext(int context_id, ThreadID tid)
346 {
347 _contextId = context_id;
348 _threadId = tid;
349 privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID);
350 }
351
352 /**
353 * Set up a virtual (e.g., CPU) request in a previously
354 * allocated Request object.
355 */
356 void
357 setVirt(int asid, Addr vaddr, unsigned size, Flags flags, MasterID mid,
358 Addr pc)
359 {
360 assert(size >= 0);
361 _asid = asid;
362 _vaddr = vaddr;
363 _size = size;
364 _masterId = mid;
365 _pc = pc;
366 _time = curTick();

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

392 * Generate two requests as if this request had been split into two
393 * pieces. The original request can't have been translated already.
394 */
395 void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2)
396 {
397 assert(privateFlags.isSet(VALID_VADDR));
398 assert(privateFlags.noneSet(VALID_PADDR));
399 assert(split_addr > _vaddr && split_addr < _vaddr + _size);
400 req1 = new Request(*this);
401 req2 = new Request(*this);
402 req1->_size = split_addr - _vaddr;
403 req2->_vaddr = split_addr;
404 req2->_size = _size - req1->_size;
405 }
406
407 /**
408 * Accessor for paddr.
409 */

--- 245 unchanged lines hidden ---