lip6 / coriolis

Coriolis VLSI EDA Tool (LIP6)
https://coriolis.lip6.fr
GNU General Public License v2.0
44 stars 5 forks source link

LEF pins causing misaligned Horizonal/Verticals and power via generation #100

Closed gatecat closed 5 months ago

gatecat commented 7 months ago

Test case, hopefully complete: sram_minimal.zip

(run run_pnr.py)

There are a few issues going on here, but one of the first I notice is around offgrid parts of the power pins in the LEF.

For example:

    PORT
      LAYER Metal3 ;
        RECT 0 40.76 5.07 47.575 ;
    END

All of the points of the rectangle are on the 0.005um grid, but as the centerline isn't, Coriolis produces this error:

[ERROR] LefParser::fromUnitsMicrons(): Offgrid value 44.1675um (DbU=883350), grid 0.005um (DbU=100).

As this is a power port, it seems like this also leads to offgrid power vias further down the line, although it may be that there's a better way to connect macros to power than just creating metal3 for all the power pin areas and relying on the usual via generation down to it.

jpc-lip6 commented 7 months ago

Thanks for making the right analysis. This error was nagging at me for some times. The parser transforms rectangles into segments, so they use the center coordinate. Most likely I will slightly shrink the rectangle, but I need to check if it does not create other problems. The other fix would be to use Hurricane::Pad instead of segments, but this would have a lot of implication in the code (I heavily rely on shapes being segments).

I will take a serious look by the end of the week.

jpc-lip6 commented 6 months ago

There was in fact, three different causes for the offgrid segments:

  1. In your routing gauge configuration, the Metal5 layer was offgrid : 0.876 ? (replaced it by 0.88).
  2. In LefImport, the translation of rectilinear polygons into Horizontal / Vertical was sometime failing because the axis may be offgrid. I replace them by two overlapping on grid.
  3. The GDS parser, when reading PATH records, translate them as series of articulated Contact & Horizontal / Vertical, and it suffers the same limitation as LefImport. For now, I force them on grid while writing back with GdsDriver, but still display an error message. This may be a bit dangerous.
  4. Unrouted signals like io_out_to_pad(23) may have segments offgrid because the router fails on them and the segments are never placed ongrid. Not really a problem because the layout is wrong anyway...