YosysHQ/padring

Failure to fit filler cell results in infinite loop

Closed this issue · 8 comments

The behavior of searching for fill cells checks the existing list of fill cells for the widest cell that fits the remaining space. If not found, it prints an error message (src/main.cpp line 268). However, if there is no cell narrow enough to fit the remaining space, it does not break the loop after printing the error, and so it goes into an infinite loop.

Also: I have a fill macro that it 1um wide. padring is also going into an infinite loop telling me that there are no fill macros available to fit a 1um wide space. The diagnostics at the top of running padring show that it sees both my fill cells (5um and 1um) and says that the minimum fill cell size is 1um. So is this a roundoff problem when comparing "cell.first <= width" in src/fillerhandler.h line 53? I will see if I can debug this and figure out if that's true or if it is something else.

trcwm commented

I suspect a round-off error due to the use of floating point arithmetic. Is there a minimal test case you can submit?

Probably not; it worked just fine for me with the X-Fab process so the error seems to be very specific to some set of numbers (if it is a roundoff error). I'll run a test here and see if adding a small delta fraction fixes the problem.

Okay, I had forgotten that I could not compile padring on my desktop, so I had also forgotten that the executable on my desktop was one that I had copied from my laptop, and I have no idea what version that was. I did a git pull on my laptop and recompiled, then ran again, and the roundoff error problem just went away. So you can ignore that one. However, the infinite loop is still a problem, and occurs in any padframe where the pads have not been properly designed and do not match a multiple of the narrowest fill. This is, of course, an improperly defined pad library, but unfortunately happens all the time. The "break" is still needed after the error message as mentioned above (src/main.cpp line 268, but note that this is repeated for N, S, E, W, and so the "break" statement needs to be added four times). I patched the source with the needed break statement and now padring works again for me (with the badly defined pad library).

@RTimothyEdwards Sounds like you should send a pull request?

trcwm commented

No PR needed - it's very minor.

trcwm commented

Added a test case and pushed a fix.

trcwm commented

Moving from floating-point to fixed-point math for placement is on the TODO list.

Issue resolved; closing.