Closed smunaut closed 1 year ago
@smunaut Could you share the script you've used to create the existing signal route? Also, is the attached DEF file the output from your script?
These errors are generated because the paths of these routings are non-orthogonal. Here's an example:
Note that the last endpoint creates an "L" shape with the others. I understand that DRT expects the paths to be fully vertical or horizontal. @maliberty do you know more about it?
So the script looks like this :
wire = odb.dbWire.create(net)
encoder = odb.dbWireEncoder()
encoder.begin(wire)
# Create vertical spine
# (split in 2 segments to help RCX be more correct)
encoder.newPath(self.layer_v, 'FIXED')
encoder.addPoint(x_spine, y_min)
encoder.addPoint(x_spine, y_ctrl[0])
encoder.newPath(self.layer_v, 'FIXED')
encoder.addPoint(x_spine, y_ctrl[1])
encoder.addPoint(x_spine, y_max)
# Create horizontal link for each mux
for y in y_mux:
encoder.newPath(self.layer_h, 'FIXED')
encoder.addPoint(x_min, y)
encoder.addPoint(x_spine, y)
encoder.addPoint(x_max, y)
encoder.newPath(self.layer_v, 'FIXED')
encoder.addPoint(x_spine, y)
encoder.addTechVia(self.via)
encoder.end()
I also tried a bunch of different possibilites and couldn't figure out one that works. The only think I could make work is remove the final part that adds the via and then it works fine. (and I re-run my script after detailled routing to add the vias afterward).
What it must generate is vertical segment in the middle and then a bunhc of branches going left and right. I start a new path every time and the DEF also reflects that AFAICT so it should be valid.
Your script looks fine to me. When I run DRT with the DEF file you've attached, it ends without errors. But running from the ODB file, the errors happen.
At what stage of the flow are you running your script? Is it right before the global router? Perhaps something is changing the paths in the encoder before the detailed routing stage.
Yes, just right before global routing step.
This is how it look in OpenLane 2, my list of steps :+1:
Steps: List[Type[Step]] = [
# ....
CustomRoute,
OpenROAD.GlobalRouting,
OpenROAD.DetailedRouting,
# ....
The DEF and ODB get written both at the output of the custom script from the internal state :
DesignFormat.DEF: lambda reader, file: odb.write_def(reader.block, file),
DesignFormat.ODB: lambda reader, file: odb.write_db(reader.db, file),
It's just that the ODB gets fed to the GloblaRouting step to continue and the DEF is just "informational". But maybe something is wrong when saving the ODB and internal state is mis-represented somehow.
This is a dumb question, but does removing the write to DEF change the db? I think there might be a known issue that writing files can corrupt the wire encoder.
Write def should not affect the DB
I tried forcing the ODB write before the DEF write, no changes.
Also attached is the exact ODB and DEF written at the output of my script. (i.e. before it gets altered by GlobalRouting)
@smunaut Could you try removing the check_antennas/repair_antennas commands in the global route script? These commands run order_wires for the nets when looking for antenna violations so these commands may be changing the routing.
@smunaut Could you also create a reproducible for the global routing stage?
repair_antenna
is already disabled.
I'm trying to figure out if/how I can generate a same reproducible build for the GRT step (they're made automatically when the step fails but of course GRT works :sweat: )
repair_antenna
is already disabled.I'm trying to figure out if/how I can generate a same reproducible build for the GRT step (they're made automatically when the step fails but of course GRT works 😓 )
OpenLane have this read the docs page. This part in specific might be helpful: https://openlane.readthedocs.io/en/latest/for_developers/using_or_issue.html#odd-behavior
That's for OpenLane "original". Here I'm using OpenLane 2 ( https://github.com/efabless/openlane2 ) which apparently doesn't support such things yet :/
Did you check the ODB I posted above ? (which hasn't gone through global routing), are the routes correct in that ODB ?
@smunaut Could you try this: https://github.com/The-OpenROAD-Project/OpenROAD/pull/3411? We noticed that your DEF and ODB files were not wrong, but the way the detailed router read the existing routing was incorrect. My PR should fix the false non-orthogonal wires error. It worked in the test case you've attached, could you try it at your end?
@eder-matheus Yup seems to work for me !
@eder-matheus Yup seems to work for me !
That's great! We're finishing the reviews in my PR. It should be in the master branch soon.
Describe the bug
When trying to use OpenLane2 with a custom routing script that manually routes some signal before the Global+Detailled router passes, it fails with tons of
If in my custom routing script I leave the wires but remove the vias, then it works.
Test case data can be found on : https://people.osmocom.org/tnt/stuff/tt/bug_data.zip
It contains the reproductable test case from OpenLane2 directly and the DEF output. ( Athough apparently it uses the ODB data directly rather than going through DEF between the different steps and the DEF is just "informational" ).
Expected Behavior
Routing complete
Environment
To Reproduce
run ./run.sh from the tcl_reproductible directory
Relevant log output
No response
Screenshots
No response
Additional Context
No response