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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 228 unchanged lines hidden (view full) --- 239 Addr _pc; 240 241 public: 242 /** Minimal constructor. No fields are initialized. 243 * (Note that _flags and privateFlags are cleared by Flags 244 * default constructor.) 245 */ 246 Request() |
247 : translateDelta(0), accessDelta(0), depth(0) |
248 {} 249 250 /** 251 * Constructor for physical (e.g. device) requests. Initializes 252 * just physical address, size, flags, and timestamp (to curTick()). 253 * These fields are adequate to perform a request. 254 */ 255 Request(Addr paddr, int size, Flags flags, MasterID mid) --- 44 unchanged lines hidden (view full) --- 300 _paddr = paddr; 301 _size = size; 302 _time = time; 303 _masterId = mid; 304 _flags.clear(~STICKY_FLAGS); 305 _flags.set(flags); 306 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 307 privateFlags.set(VALID_PADDR|VALID_SIZE); |
308 depth = 0; 309 accessDelta = 0; 310 //translateDelta = 0; |
311 } 312 313 void 314 setPhys(Addr paddr, int size, Flags flags, MasterID mid) 315 { 316 setPhys(paddr, size, flags, mid, curTick()); 317 } 318 --- 11 unchanged lines hidden (view full) --- 330 _masterId = mid; 331 _pc = pc; 332 _time = curTick(); 333 334 _flags.clear(~STICKY_FLAGS); 335 _flags.set(flags); 336 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 337 privateFlags.set(VALID_VADDR|VALID_SIZE|VALID_PC); |
338 depth = 0; 339 accessDelta = 0; 340 translateDelta = 0; |
341 } 342 343 /** 344 * Set just the physical address. This usually used to record the 345 * result of a translation. However, when using virtualized CPUs 346 * setPhys() is sometimes called to finalize a physical address 347 * without a virtual address, so we can't check if the virtual 348 * address is valid. --- 35 unchanged lines hidden (view full) --- 384 Addr 385 getPaddr() 386 { 387 assert(privateFlags.isSet(VALID_PADDR)); 388 return _paddr; 389 } 390 391 /** |
392 * Time for the TLB/table walker to successfully translate this request. 393 */ 394 Tick translateDelta; 395 396 /** 397 * Access latency to complete this memory transaction not including 398 * translation time. 399 */ 400 Tick accessDelta; 401 402 /** 403 * Level of the cache hierachy where this request was responded to 404 * (e.g. 0 = L1; 1 = L2). 405 */ 406 int depth; 407 408 /** |
409 * Accessor for size. 410 */ 411 bool 412 hasSize() 413 { 414 return privateFlags.isSet(VALID_SIZE); 415 } 416 --- 137 unchanged lines hidden (view full) --- 554 /** Accessor function for pc.*/ 555 Addr 556 getPC() const 557 { 558 assert(privateFlags.isSet(VALID_PC)); 559 return _pc; 560 } 561 |
562 /** 563 * Increment/Get the depth at which this request is responded to. 564 * This currently happens when the request misses in any cache level. 565 */ 566 void incAccessDepth() { depth++; } 567 int getAccessDepth() const { return depth; } 568 569 /** 570 * Set/Get the time taken for this request to be successfully translated. 571 */ 572 void setTranslateLatency() { translateDelta = curTick() - _time; } 573 Tick getTranslateLatency() const { return translateDelta; } 574 575 /** 576 * Set/Get the time taken to complete this request's access, not including 577 * the time to successfully translate the request. 578 */ 579 void setAccessLatency() { accessDelta = curTick() - _time - translateDelta; } 580 Tick getAccessLatency() const { return accessDelta; } 581 |
582 /** Accessor functions for flags. Note that these are for testing 583 only; setting flags should be done via setFlags(). */ 584 bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); } 585 bool isInstFetch() const { return _flags.isSet(INST_FETCH); } 586 bool isPrefetch() const { return _flags.isSet(PREFETCH); } 587 bool isLLSC() const { return _flags.isSet(LLSC); } 588 bool isPriv() const { return _flags.isSet(PRIVILEGED); } 589 bool isLocked() const { return _flags.isSet(LOCKED); } 590 bool isSwap() const { return _flags.isSet(MEM_SWAP|MEM_SWAP_COND); } 591 bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); } 592 bool isMmappedIpr() const { return _flags.isSet(MMAPPED_IPR); } 593 bool isClearLL() const { return _flags.isSet(CLEAR_LL); } 594}; 595 596#endif // __MEM_REQUEST_HH__ |