Address.cc (9362:d7f4abbf52e3) Address.cc (10314:94b6b28fc968)
1/*
2 * Copyright (c) 1999-2008 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;

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

52// returns the next stride address based on line address
53void
54Address::makeNextStrideAddress(int stride)
55{
56 m_address = maskLowOrderBits(RubySystem::getBlockSizeBits())
57 + RubySystem::getBlockSizeBytes()*stride;
58}
59
1/*
2 * Copyright (c) 1999-2008 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;

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

52// returns the next stride address based on line address
53void
54Address::makeNextStrideAddress(int stride)
55{
56 m_address = maskLowOrderBits(RubySystem::getBlockSizeBits())
57 + RubySystem::getBlockSizeBytes()*stride;
58}
59
60Index
60int64
61Address::memoryModuleIndex() const
62{
61Address::memoryModuleIndex() const
62{
63 Index index =
63 int64 index =
64 bitSelect(RubySystem::getBlockSizeBits() +
65 RubySystem::getMemorySizeBits(), ADDRESS_WIDTH);
66 assert (index >= 0);
67 return index;
68
64 bitSelect(RubySystem::getBlockSizeBits() +
65 RubySystem::getMemorySizeBits(), ADDRESS_WIDTH);
66 assert (index >= 0);
67 return index;
68
69 // Index indexHighPortion =
69 // int64 indexHighPortion =
70 // address.bitSelect(MEMORY_SIZE_BITS - 1,
71 // PAGE_SIZE_BITS + NUMBER_OF_MEMORY_MODULE_BITS);
70 // address.bitSelect(MEMORY_SIZE_BITS - 1,
71 // PAGE_SIZE_BITS + NUMBER_OF_MEMORY_MODULE_BITS);
72 // Index indexLowPortion =
72 // int64 indexLowPortion =
73 // address.bitSelect(DATA_BLOCK_BITS, PAGE_SIZE_BITS - 1);
74 //
73 // address.bitSelect(DATA_BLOCK_BITS, PAGE_SIZE_BITS - 1);
74 //
75 // Index index = indexLowPortion |
75 // int64 index = indexLowPortion |
76 // (indexHighPortion << (PAGE_SIZE_BITS - DATA_BLOCK_BITS));
77
78 /*
79 Round-robin mapping of addresses, at page size granularity
80
81ADDRESS_WIDTH MEMORY_SIZE_BITS PAGE_SIZE_BITS DATA_BLOCK_BITS
82 | | | |
83 \ / \ / \ / \ / 0

--- 76 unchanged lines hidden ---
76 // (indexHighPortion << (PAGE_SIZE_BITS - DATA_BLOCK_BITS));
77
78 /*
79 Round-robin mapping of addresses, at page size granularity
80
81ADDRESS_WIDTH MEMORY_SIZE_BITS PAGE_SIZE_BITS DATA_BLOCK_BITS
82 | | | |
83 \ / \ / \ / \ / 0

--- 76 unchanged lines hidden ---