diff options
| author | Wilson Fung <[email protected]> | 2012-03-22 00:50:08 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:19:05 -0700 |
| commit | 32157fd2092221457ccef34f7fd4e69d60c643c6 (patch) | |
| tree | 6582fcdd9c11c7cde6dd8cb4aa30e6bf995bfe77 /src/gpgpu-sim/addrdec.cc | |
| parent | 95a508ff02436fa680aaf6841938eebc00e8e5b5 (diff) | |
Fixing bug 145. Now partition_address() works for non-power-of-two number of memory partition as well (before it just leaves the memory address unchanged!).
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 11755]
Diffstat (limited to 'src/gpgpu-sim/addrdec.cc')
| -rw-r--r-- | src/gpgpu-sim/addrdec.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gpgpu-sim/addrdec.cc b/src/gpgpu-sim/addrdec.cc index b259f1a..868696d 100644 --- a/src/gpgpu-sim/addrdec.cc +++ b/src/gpgpu-sim/addrdec.cc @@ -67,13 +67,13 @@ void linear_to_raw_address_translation::addrdec_setoption(option_parser_t opp) new_addr_type linear_to_raw_address_translation::partition_address( new_addr_type addr ) const { if (!gap) { + return addrdec_packbits( ~addrdec_mask[CHIP], addr, 64, 0 ); + } else { // see addrdec_tlx for explanation unsigned long long int partition_addr; partition_addr = ( (addr>>ADDR_CHIP_S) / Nchips) << ADDR_CHIP_S; partition_addr |= addr & ((1 << ADDR_CHIP_S) - 1); return partition_addr; - } else { - return addrdec_packbits( ~addrdec_mask[CHIP], addr, 64, 0 ); } } @@ -345,6 +345,11 @@ void linear_to_raw_address_translation::sweep_test() const abort(); } else { assert((int)tlx.chip < Nchips); + // ensure that partition_address() returns the concatenated address + if ((ADDR_CHIP_S != -1 and raw_addr >= (1ULL << ADDR_CHIP_S)) or + (ADDR_CHIP_S == -1 and raw_addr >= (1ULL << addrdec_mklow[CHIP]))) { + assert(raw_addr != partition_address(raw_addr)); + } history_map[tlx] = raw_addr; } |
