liangrj2014 / ISPD24_contest

20 stars 0 forks source link

Potential bug in evaluation script #3

Open ZFTurbo opened 11 months ago

ZFTurbo commented 11 months ago

There is this part of code which I believe check if all access points were covered by solution for given net:

            bool cover = false;
            // std::cout << "numPins " << numPins << std::endl;

            for (int i = 0; i < numPins; ++i) {
                std::vector<std::vector<int>> points = accessPoints[i];
                for (auto point : points) {
                    int l = point[0], x = point[1], y = point[2];
                    // std::cout << "Access point " << l << " " << x << " " << y << std::endl;
                    if (l == 0) {
                        if (GR[l][x][y] == 1 && GR[l + 1][x][y] == 1) {
                            cover = true;
                            break;
                        }
                    }
                    else {
                        if (GR[l][x][y] == 1) {
                            cover = true;
                            break;
                        }
                    }
                }

                if (!cover) {
                    uncovered_net_cnt++;
                    std::cout << "uncovered net " << name << std::endl;
                }
                // assert(cover);
            }

I think that bool cover = false; must be placed after for (int i = 0; i < numPins; ++i) {

            // std::cout << "numPins " << numPins << std::endl;

            for (int i = 0; i < numPins; ++i) {
                bool cover = false;
                std::vector<std::vector<int>> points = accessPoints[i];
                for (auto point : points) {
                    int l = point[0], x = point[1], y = point[2];
                    // std::cout << "Access point " << l << " " << x << " " << y << std::endl;
                    if (l == 0) {
                        if (GR[l][x][y] == 1 && GR[l + 1][x][y] == 1) {
                            cover = true;
                            break;
                        }
                    }
                    else {
                        if (GR[l][x][y] == 1) {
                            cover = true;
                            break;
                        }
                    }
                }

                if (!cover) {
                    uncovered_net_cnt++;
                    std::cout << "uncovered net " << name << std::endl;
                }
                // assert(cover);
            }
liangrj2014 commented 11 months ago

Thanks for the feedback! I will check it out soon!

liangrj2014 commented 11 months ago

You are right! Thanks for pointing out the error! We plan to release the updated version of evaluator script next week, which will fix some bugs and have faster runtime. Thanks!