1
2/*
3 * Copyright (c) 1999 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

102
103 // Data Members (m_ prefix)
104 physical_address_t m_address;
105};
106
107inline
108Address line_address(const Address& addr) { Address temp(addr); temp.makeLineAddress(); return temp; }
109
110/*
111inline
112Address next_stride_address(const Address& addr, int stride) {
113 Address temp = addr;
114 temp.makeNextStrideAddress(stride);
115 temp.setAddress(temp.maskHighOrderBits(ADDRESS_WIDTH-RubyConfig::memorySizeBits())); // surpress wrap-around problem
116 return temp;
117}
118*/
119
110// Output operator declaration
111ostream& operator<<(ostream& out, const Address& obj);
112// comparison operator declaration
113bool operator==(const Address& obj1, const Address& obj2);
114bool operator!=(const Address& obj1, const Address& obj2);
115bool operator<(const Address& obj1, const Address& obj2);
116/* Address& operator=(const physical_address_t address); */
117

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

192 return (m_address >> number);
193}
194
195inline
196integer_t Address::memoryModuleIndex() const
197{
198 integer_t index = bitSelect(RubySystem::getBlockSizeBits()+RubySystem::getMemorySizeBits(), ADDRESS_WIDTH);
199 assert (index >= 0);
210 /*
211 if (index >= RubyConfig::memoryModuleBlocks()) {
212 cerr << " memoryBits: " << RubySystem::getMemorySizeBits() << " memorySizeBits: " << RubySystem::getMemorySizeBits()
213 << " Address: " << "[" << hex << "0x" << m_address << "," << " line 0x" << maskLowOrderBits(RubySystem::getBlockSizeBits()) << dec << "]" << flush
214 << "error: limit exceeded. " <<
215 " getDataBlockBits: " << RubySystem::getBlockSizeBits() <<
216 " memoryModuleBlocks: " << RubyConfig::memoryModuleBlocks() <<
217 " index: " << index << endl;
218 }
219 assert (index < RubyConfig::memoryModuleBlocks());
220 */
200 return index;
201
202 // Index indexHighPortion = address.bitSelect(MEMORY_SIZE_BITS-1, PAGE_SIZE_BITS+NUMBER_OF_MEMORY_MODULE_BITS);
203 // Index indexLowPortion = address.bitSelect(DATA_BLOCK_BITS, PAGE_SIZE_BITS-1);
204
205 //Index index = indexLowPortion | (indexHighPortion << (PAGE_SIZE_BITS - DATA_BLOCK_BITS));
206
207 /*

--- 37 unchanged lines hidden ---