-class Address {
-public:
- // Constructors
- Address() { m_address = 0; }
- explicit Address(physical_address_t address) { m_address = address; }
-
- Address(const Address& obj);
- Address& operator=(const Address& obj);
-
- // Destructor
- // ~Address();
-
- // Public Methods
-
- void setAddress(physical_address_t address) { m_address = address; }
- physical_address_t getAddress() const {return m_address;}
- // selects bits inclusive
- physical_address_t bitSelect(int small, int big) const;
- physical_address_t maskLowOrderBits(int number) const;
- physical_address_t maskHighOrderBits(int number) const;
- physical_address_t shiftLowOrderBits(int number) const;
- physical_address_t getLineAddress() const
- { return bitSelect(RubySystem::getBlockSizeBits(), ADDRESS_WIDTH); }
- physical_address_t getOffset() const
- { return bitSelect(0, RubySystem::getBlockSizeBits()-1); }
-
- void makeLineAddress() { m_address = maskLowOrderBits(RubySystem::getBlockSizeBits()); }
- // returns the next stride address based on line address
- void makeNextStrideAddress( int stride) {
- m_address = maskLowOrderBits(RubySystem::getBlockSizeBits())
- + RubySystem::getBlockSizeBytes()*stride;
- }
- int getBankSetNum() const;
- int getBankSetDist() const;
-
- Index memoryModuleIndex() const;
-
- void print(ostream& out) const;
- void output(ostream& out) const;
- void input(istream& in);
-
- void setOffset( int offset ){
- // first, zero out the offset bits
- makeLineAddress();
- m_address |= (physical_address_t) offset;
- }
-
-private:
- // Private Methods
-
- // Private copy constructor and assignment operator
- // Address(const Address& obj);
- // Address& operator=(const Address& obj);
-
- // Data Members (m_ prefix)
- physical_address_t m_address;
+class Address
+{
+ public:
+ Address()
+ : m_address(0)
+ { }
+
+ explicit
+ Address(physical_address_t address)
+ : m_address(address)
+ { }
+
+ Address(const Address& obj);
+ Address& operator=(const Address& obj);
+
+ void setAddress(physical_address_t address) { m_address = address; }
+ physical_address_t getAddress() const {return m_address;}
+ // selects bits inclusive
+ physical_address_t bitSelect(unsigned int small, unsigned int big) const;
+ physical_address_t bitRemove(unsigned int small, unsigned int big) const;
+ physical_address_t maskLowOrderBits(unsigned int number) const;
+ physical_address_t maskHighOrderBits(unsigned int number) const;
+ physical_address_t shiftLowOrderBits(unsigned int number) const;
+
+ physical_address_t getLineAddress() const;
+ physical_address_t getOffset() const;
+ void makeLineAddress();
+ void makeNextStrideAddress(int stride);
+
+ int64 memoryModuleIndex() const;
+
+ void print(std::ostream& out) const;
+ void output(std::ostream& out) const;
+ void input(std::istream& in);
+
+ void
+ setOffset(int offset)
+ {
+ // first, zero out the offset bits
+ makeLineAddress();
+ m_address |= (physical_address_t) offset;
+ }
+
+ private:
+ physical_address_t m_address;