diff --git a/drama/src/rev-mc.c b/drama/src/rev-mc.c index 95adb6c..dbc888a 100644 --- a/drama/src/rev-mc.c +++ b/drama/src/rev-mc.c @@ -308,6 +308,7 @@ find_row_mask(std::vector &sets, if (row_mask & LS_BITMASK(CL_SHIFT)) { return false; } for (auto addr_pool : same_row_sets) { if (stopped.load(std::memory_order_relaxed)) { return false; } + addr_tuple base_addr = addr_pool[0]; for (int i = 1; i < addr_pool.size(); i++) { addr_tuple tmp = addr_pool[i]; @@ -319,32 +320,28 @@ find_row_mask(std::vector &sets, std::atomic_bool found{false}; std::mutex lock; - std::queue mask_task; - while (row_mask < last_mask) { - mask_task.push(row_mask); - row_mask = next_bit_permutation(row_mask); - } + // while (row_mask < last_mask) { + // row_mask = next_bit_permutation(row_mask); + // } std::vector workers; for (int i = 0; i < 8; ++i) { workers.emplace_back([&] { while (!found) { - uint64_t cur_mask; + uint64_t cur_mask = last_mask; { std::lock_guard _(lock); - if (mask_task.empty()) { break; } - cur_mask = mask_task.front(); - mask_task.pop(); - verbose_printerr("[LOG] - Row mask: 0x%0lx \t\t bits: %s\n", cur_mask, bit_string(cur_mask)); + cur_mask = row_mask; + if (row_mask >= last_mask) { break; } + + row_mask = next_bit_permutation(row_mask); + verbose_printerr("[LOG] - Cur Row mask: 0x%0lx \t\t bits: %s\n", cur_mask, bit_string(cur_mask)); } if (resolve(cur_mask, found)) { std::lock_guard _(lock); - if (!found.exchange(true)) { - row_mask = cur_mask; - while (!mask_task.empty()) mask_task.pop(); - } + if (!found.exchange(true)) { row_mask = cur_mask; } } } });