1/* 2 * Copyright (c) 1999 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 15 unchanged lines hidden (view full) --- 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#ifndef __MEM_RUBY_COMMON_ADDRESS_HH__ 30#define __MEM_RUBY_COMMON_ADDRESS_HH__ 31 |
32#include <cassert> |
33#include <iomanip> 34 35#include "base/hashmap.hh" 36#include "mem/ruby/common/Global.hh" 37#include "mem/ruby/system/MachineID.hh" 38#include "mem/ruby/system/NodeID.hh" |
39 40const int ADDRESS_WIDTH = 64; // address width in bytes 41 42class Address; 43typedef Address PhysAddress; 44typedef Address VirtAddress; 45 46class Address --- 15 unchanged lines hidden (view full) --- 62 physical_address_t getAddress() const {return m_address;} 63 // selects bits inclusive 64 physical_address_t bitSelect(int small, int big) const; 65 physical_address_t bitRemove(int small, int big) const; 66 physical_address_t maskLowOrderBits(int number) const; 67 physical_address_t maskHighOrderBits(int number) const; 68 physical_address_t shiftLowOrderBits(int number) const; 69 |
70 physical_address_t getLineAddress() const; 71 physical_address_t getOffset() const; 72 void makeLineAddress(); 73 void makeNextStrideAddress(int stride); |
74 |
75 int getBankSetNum() const; 76 int getBankSetDist() const; 77 78 Index memoryModuleIndex() const; 79 80 void print(std::ostream& out) const; 81 void output(std::ostream& out) const; 82 void input(std::istream& in); --- 115 unchanged lines hidden (view full) --- 198} 199 200inline physical_address_t 201Address::shiftLowOrderBits(int number) const 202{ 203 return (m_address >> number); 204} 205 |
206class Address; 207namespace __hash_namespace { 208template <> struct hash<Address> 209{ 210 size_t 211 operator()(const Address &s) const 212 { 213 return (size_t)s.getAddress(); --- 16 unchanged lines hidden --- |