request.hh (9950:4b7f60080149) | request.hh (10020:2f33cb012383) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2012 ARM Limited | 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() | 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) |
|
247 {} 248 249 /** 250 * Constructor for physical (e.g. device) requests. Initializes 251 * just physical address, size, flags, and timestamp (to curTick()). 252 * These fields are adequate to perform a request. 253 */ 254 Request(Addr paddr, int size, Flags flags, MasterID mid) --- 44 unchanged lines hidden (view full) --- 299 _paddr = paddr; 300 _size = size; 301 _time = time; 302 _masterId = mid; 303 _flags.clear(~STICKY_FLAGS); 304 _flags.set(flags); 305 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 306 privateFlags.set(VALID_PADDR|VALID_SIZE); | 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; |
|
307 } 308 309 void 310 setPhys(Addr paddr, int size, Flags flags, MasterID mid) 311 { 312 setPhys(paddr, size, flags, mid, curTick()); 313 } 314 --- 11 unchanged lines hidden (view full) --- 326 _masterId = mid; 327 _pc = pc; 328 _time = curTick(); 329 330 _flags.clear(~STICKY_FLAGS); 331 _flags.set(flags); 332 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 333 privateFlags.set(VALID_VADDR|VALID_SIZE|VALID_PC); | 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; |
|
334 } 335 336 /** 337 * Set just the physical address. This usually used to record the 338 * result of a translation. However, when using virtualized CPUs 339 * setPhys() is sometimes called to finalize a physical address 340 * without a virtual address, so we can't check if the virtual 341 * address is valid. --- 35 unchanged lines hidden (view full) --- 377 Addr 378 getPaddr() 379 { 380 assert(privateFlags.isSet(VALID_PADDR)); 381 return _paddr; 382 } 383 384 /** | 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 /** |
|
385 * Accessor for size. 386 */ 387 bool 388 hasSize() 389 { 390 return privateFlags.isSet(VALID_SIZE); 391 } 392 --- 137 unchanged lines hidden (view full) --- 530 /** Accessor function for pc.*/ 531 Addr 532 getPC() const 533 { 534 assert(privateFlags.isSet(VALID_PC)); 535 return _pc; 536 } 537 | 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 |
|
538 /** Accessor functions for flags. Note that these are for testing 539 only; setting flags should be done via setFlags(). */ 540 bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); } 541 bool isInstFetch() const { return _flags.isSet(INST_FETCH); } 542 bool isPrefetch() const { return _flags.isSet(PREFETCH); } 543 bool isLLSC() const { return _flags.isSet(LLSC); } 544 bool isPriv() const { return _flags.isSet(PRIVILEGED); } 545 bool isLocked() const { return _flags.isSet(LOCKED); } 546 bool isSwap() const { return _flags.isSet(MEM_SWAP|MEM_SWAP_COND); } 547 bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); } 548 bool isMmappedIpr() const { return _flags.isSet(MMAPPED_IPR); } 549 bool isClearLL() const { return _flags.isSet(CLEAR_LL); } 550}; 551 552#endif // __MEM_REQUEST_HH__ | 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__ |