base_set_assoc.hh (11870:b470020b29de) | base_set_assoc.hh (11893:3033b3e6a32a) |
---|---|
1/* 2 * Copyright (c) 2012-2014 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 --- 92 unchanged lines hidden (view full) --- 101 uint8_t *dataBlks; 102 103 /** The amount to shift the address to get the set. */ 104 int setShift; 105 /** The amount to shift the address to get the tag. */ 106 int tagShift; 107 /** Mask out all bits that aren't part of the set index. */ 108 unsigned setMask; | 1/* 2 * Copyright (c) 2012-2014 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 --- 92 unchanged lines hidden (view full) --- 101 uint8_t *dataBlks; 102 103 /** The amount to shift the address to get the set. */ 104 int setShift; 105 /** The amount to shift the address to get the tag. */ 106 int tagShift; 107 /** Mask out all bits that aren't part of the set index. */ 108 unsigned setMask; |
109 /** Mask out all bits that aren't part of the block offset. */ 110 unsigned blkMask; | |
111 112public: 113 114 /** Convenience typedef. */ 115 typedef BaseSetAssocParams Params; 116 117 /** 118 * Construct and initialize this tag store. --- 198 unchanged lines hidden (view full) --- 317 * @return The set index of the address. 318 */ 319 int extractSet(Addr addr) const override 320 { 321 return ((addr >> setShift) & setMask); 322 } 323 324 /** | 109 110public: 111 112 /** Convenience typedef. */ 113 typedef BaseSetAssocParams Params; 114 115 /** 116 * Construct and initialize this tag store. --- 198 unchanged lines hidden (view full) --- 315 * @return The set index of the address. 316 */ 317 int extractSet(Addr addr) const override 318 { 319 return ((addr >> setShift) & setMask); 320 } 321 322 /** |
325 * Align an address to the block size. 326 * @param addr the address to align. 327 * @return The block address. 328 */ 329 Addr blkAlign(Addr addr) const 330 { 331 return (addr & ~(Addr)blkMask); 332 } 333 334 /** | |
335 * Regenerate the block address from the tag. 336 * @param tag The tag of the block. 337 * @param set The set of the block. 338 * @return The block address. 339 */ 340 Addr regenerateBlkAddr(Addr tag, unsigned set) const override 341 { 342 return ((tag << tagShift) | ((Addr)set << setShift)); --- 38 unchanged lines hidden --- | 323 * Regenerate the block address from the tag. 324 * @param tag The tag of the block. 325 * @param set The set of the block. 326 * @return The block address. 327 */ 328 Addr regenerateBlkAddr(Addr tag, unsigned set) const override 329 { 330 return ((tag << tagShift) | ((Addr)set << setShift)); --- 38 unchanged lines hidden --- |