liangrj2014 / ISPD24_contest

20 stars 0 forks source link

Bug in Evaluate Scripts #6

Open XCI9 opened 11 months ago

XCI9 commented 11 months ago

Hi, I think the evaluate scripts may contain bug: From line 445 to 464

for (int l = 1; l < nLayers; ++l) {
    int direction = layerDirections[l];
    if (direction == 0) {  // horizontal
        for (int x = 0; x < xSize - 1; ++x) {
            for (int y = 0; y < ySize; ++y) {
                if (GR[l][x][y] == 1 && GR[l][x + 1][y] == 1) {
                    wireMap[l][x][y]++;
                }
            }
        }
    } else {  // vertical
        for (int x = 0; x < xSize; ++x) {
            for (int y = 0; y < ySize - 1; ++y) {
                if (GR[l][x][y] == 1 && GR[l][x][y + 1] == 1) {
                    wireMap[l][x][y]++;
                }
            }
        }
    }
}

It check if current net passes both current GCell and neighboring GCell (right for horizontal layer and up for vertical layer). If so, mark usage to current edge. But if the GCell is actually only use for via pass through and no edge to neighboring GCell, the code will calculate the usage wrongly.

For example, for the following .net input:

net1
(
[(0, 0, 0)]
[(0, 0, 1)]
)

Tow points are vertically adjecent. Assume even layers are for vertical. And we decided to use layer 6 to connect two points:

# point 1 vias
0 0 1 1 metal1
0 0 1 1 metal2
0 0 1 1 metal3
0 0 1 1 metal4
0 0 1 1 metal5
0 0 1 1 metal6
# point 2 vias
0 1 1 2 metal1
0 1 1 2 metal2
0 1 1 2 metal3
0 1 1 2 metal4
0 1 1 2 metal5
0 1 1 2 metal6
# edge
0 0 0 2 metal6

The (0, 0) on metal4 and metal2 will also count as it has edge to (0, 1), although only vias pass through. Or is this a expected behavior?

Thank you!

liangrj2014 commented 11 months ago

Thanks for pointing out the corner case! You are right! Our evaluator will calculate the usage wrongly for the corner case you mentioned. We plan to release the updated evaluator script next week, which will fixed a few bugs as well as has much faster runtime. Thanks!