Address.hh (8946:fb6c89334b86) Address.hh (9362:d7f4abbf52e3)
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;

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

31
32#include <cassert>
33#include <iomanip>
34#include <iostream>
35
36#include "base/hashmap.hh"
37#include "mem/ruby/common/TypeDefines.hh"
38
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;

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

31
32#include <cassert>
33#include <iomanip>
34#include <iostream>
35
36#include "base/hashmap.hh"
37#include "mem/ruby/common/TypeDefines.hh"
38
39const int ADDRESS_WIDTH = 64; // address width in bytes
39const uint32_t ADDRESS_WIDTH = 64; // address width in bytes
40
41class Address;
42typedef Address PhysAddress;
43typedef Address VirtAddress;
44
45class Address
46{
47 public:

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

64 physical_address_t bitRemove(int small, int big) const;
65 physical_address_t maskLowOrderBits(int number) const;
66 physical_address_t maskHighOrderBits(int number) const;
67 physical_address_t shiftLowOrderBits(int number) const;
68
69 physical_address_t getLineAddress() const;
70 physical_address_t getOffset() const;
71 void makeLineAddress();
40
41class Address;
42typedef Address PhysAddress;
43typedef Address VirtAddress;
44
45class Address
46{
47 public:

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

64 physical_address_t bitRemove(int small, int big) const;
65 physical_address_t maskLowOrderBits(int number) const;
66 physical_address_t maskHighOrderBits(int number) const;
67 physical_address_t shiftLowOrderBits(int number) const;
68
69 physical_address_t getLineAddress() const;
70 physical_address_t getOffset() const;
71 void makeLineAddress();
72 void makePageAddress();
72 void makeNextStrideAddress(int stride);
73
74 int getBankSetNum() const;
75 int getBankSetDist() const;
76
77 Index memoryModuleIndex() const;
78
79 void print(std::ostream& out) const;

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

197}
198
199inline physical_address_t
200Address::shiftLowOrderBits(int number) const
201{
202 return (m_address >> number);
203}
204
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;

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

198}
199
200inline physical_address_t
201Address::shiftLowOrderBits(int number) const
202{
203 return (m_address >> number);
204}
205
206Address next_stride_address(const Address& addr, int stride);
207Address page_address(const Address& addr);
208
205__hash_namespace_begin
206template <> struct hash<Address>
207{
208 size_t
209 operator()(const Address &s) const
210 {
211 return (size_t)s.getAddress();
212 }

--- 15 unchanged lines hidden ---
209__hash_namespace_begin
210template <> struct hash<Address>
211{
212 size_t
213 operator()(const Address &s) const
214 {
215 return (size_t)s.getAddress();
216 }

--- 15 unchanged lines hidden ---