diff --git a/tools/segmatch.cc b/tools/segmatch.cc index d62cc27b0..f3752d971 100644 --- a/tools/segmatch.cc +++ b/tools/segmatch.cc @@ -223,9 +223,9 @@ void read_input(std::istream& f, std::string filename) { abort(); } - // printf("Number of segments: %d\n", int(segdata.size())); - // printf("Number of bits: %d\n", num_bits); - // printf("Number of tags: %d\n", num_tags); + printf("Number of segments: %d\n", int(segdata.size())); + printf("Number of bits: %d\n", num_bits); + printf("Number of tags: %d\n", num_tags); for (auto& segdat : segdata) { segdata_bits(segdat.second).resize(num_bits); @@ -279,26 +279,48 @@ int main(int argc, char** argv) { std::vector out_lines; - for (int tag_idx = 0; tag_idx < num_tags; tag_idx++) { + int searched_tag = tag_ids.at("IOB18.IOB_Y0.SSTL135.IN"); + for (int tag_idx = searched_tag; tag_idx <= searched_tag ; tag_idx++) { bool_vec mask(num_bits, true); int count1 = 0, count0 = 0; + std::cout << tag_ids_r.at(tag_idx) << ": " << tag_idx; for (auto& segdat : segdata) { + std::cout << "Segment: " << segdat.first << std::endl; + auto& sd = segdat.second; bool tag1 = segdata_tags1(sd).get(tag_idx); bool tag0 = segdata_tags0(sd).get(tag_idx); - assert(!tag1 || !tag0); + for (int bit_idx = 0; bit_idx < num_bits; bit_idx++) { + if (tag1 && segdata_bits(sd).get(bit_idx)) { + std::cout << bit_ids_r.at(bit_idx) << std::endl; + } + } if (tag1) { count1++; mask.apply_and(segdata_bits(sd)); + std::cout << "Resulting mask(tag1): "; + for (int bit_idx = 0; bit_idx < num_bits; bit_idx++) { + if (tag1 && mask.get(bit_idx)) { + std::cout <