-bool
-Bulk::isSet(Addr addr) const
-{
- // c0 contains the cache index bits
- const int filter_size = filter.size();
- int c0 = bits(addr, offsetBits + sectorBits - 1, offsetBits);
- // c1 contains the lower 10 permuted bits
- //Address permuted_bits = permute(addr);
- int c1 = bits(addr, (offsetBits + 2 * sectorBits) - 1,
- offsetBits + sectorBits);
- //assert(c0 < (filter_size/2));
- //assert(c0 + (filter_size/2) < filter_size);
- //assert(c1 < (filter_size/2));
- // set v0 bit
- std::vector<int> temp_filter(filter.size(), 0);
- temp_filter[c0 + (filter_size/2)] = 1;
- // set v1 bit
- temp_filter[c1] = 1;
-
- // perform filter intersection. If any c part is 0, no possibility
- // of address being in signature. get first c intersection part
- bool zero = false;
- for (int i = 0; i < filter_size/2; ++i){
- // get intersection of signatures
- temp_filter[i] = temp_filter[i] && filter[i];
- zero = zero || temp_filter[i];
- }
- zero = !zero;
- if (zero) {
- // one section is zero, no possiblility of address in signature
- // reset bits we just set
- temp_filter[c0 + (filter_size / 2)] = 0;
- temp_filter[c1] = 0;
- return false;
- }
-
- // check second section
- zero = false;
- for (int i = filter_size / 2; i < filter_size; ++i) {
- // get intersection of signatures
- temp_filter[i] = temp_filter[i] && filter[i];
- zero = zero || temp_filter[i];
- }
- zero = !zero;
- if (zero) {
- // one section is zero, no possiblility of address in signature
- temp_filter[c0 + (filter_size / 2)] = 0;
- temp_filter[c1] = 0;
- return false;
- }
- // one section has at least one bit set
- temp_filter[c0 + (filter_size / 2)] = 0;
- temp_filter[c1] = 0;
- return true;
-}