Rework DRC structure#10
Conversation
|
Discussed with @mole99 . More precise feedback will come later, but there is need to:
|
|
@Scafir Hi Clyde, Thanks again for the PR. I gave it a high-level overview and tried to understand all the trade-offs between load vs eval vs require, block.call vs instance_exec etc. Yes, it does require some boilerplate, but creating a new rule deck does not seem to be much work at all. Two more things from our last call:
Once multiprocessing is implemented, I'll try this out with LibreLane to see the speed-up of wafer.space designs :) |
a8b7b0c to
aeaad3b
Compare
Deprecates table_name. Discussion required around connectivity_rules
This is one step towards separating PDK related stuff from framework one Next: implementing a runner
mole99
left a comment
There was a problem hiding this comment.
LGTM! I completed a full run on my gf180mcu FABulous FPGA (with KLayout patch):
DRC Total Run time 461.170021382 seconds
🥳
I found one minor issue, and now that run_drc.py is non-functional, we should remove it.
| current = RBA::Application.instance.version.split('.').map(&:to_i) | ||
|
|
||
| if (current <=> required_parallel).negative? && (opts.workers > 1) | ||
| warn('Running parallel workers with klayout smaller than 0.30.8 is likely to fail due ' / |
There was a problem hiding this comment.
The / should probably be \?
There was a problem hiding this comment.
Fixed, run_drc.py removed, documentation updated and end report implemented.
The script will also now exit with non-zero return code if the layout is not DRC clean
|
After the changes have been made and this PR has been merged, there's still some work to do. Writing this down so I don't forget about it. I need to port the changes over from wafer.space:
One more thing that would be great as part of the DRC is a short summary at the end: I think you can query the number of DRC items of the RDB object? It would be great to print the total number of DRC violations as a summary, and maybe even the number of violations per category. |
These two rulesets where forgotten earlier
Klayout will no return nonzero return code if the check is not DRC clean
This improves the rules on: * Printed messages to report are now correct * Rules are not copy pasted between layers, but created with a loop
|
The things I want to still add in the release is a clean isosub implementation. Some issues were found with the sscs chipathon, and I'm in talks with KLayout/klayout#2345 One thing to add to a later release is proper resistor extraction in lvs. Currently the resistors are extracted, but the actual resistance is not. The pr repository will also need to be updated to implement the drc changes exposed in this PR |
|
Interesting read! And great that there seems to be a proper solution to the problem in the future. Good point about resistance extraction. Could you open an issue so that we don't forget about it? I think we should go ahead and merge this PR as soon as _pr has been updated. Then I can start integrating the new DRC method into LibreLane. |
Why rework the DRC?
Currently, the DRC stack is hard to work with or not ideal for various reasons:
run_drc.py, and ruby APIWhat does this PR do?
This work extends on the gf180mcu.drc introduction. Extraction and general layer definition are made in their own functions/files. A context object is made to hold runtime options (like FEOL, ...), as well as a hash containing all the generic layers.
A registry is defined at a global level (due to klayout implementation) to hold all rule files available. Rule filtering is implemented at that level (and can be easily extended).
Rule files are lightly edited to be
loaded. This means that they execute a function to register themselves with the registry.In order to avoid manual work, or cumbersome logic, if a symbol is not found during the execution of the file's rule, the generic layer hash is consulted, and then the drc function exposed by klayout. This is implemented through the DeckEnv object.
While this is not the most elegant approach, it allows a smooth transition without needing heavy modifications on every single rule file.
Tests and CI were updated to run the new deck.
Extras
rule_decksnow only contain rules filesOutlook
In my opinion, this work not only improves the current maintainability of the PDK, but also paves the way for implementing functionality a lot more easily. More advanced DRC runners could be made, such as a simple parallel forking one, or a dependency-based one.
It also simplifies the current approach of needing to deal with run_drc.py, which is not ideal from a klayout point of view (e.g: some missing python packages prevent running the DRC check with klayout flatpak) and complexifies the stack for minimal improvements.
What is left to be done?