-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
abc9: tolerate &mfs failure by writing output file before calling it (and using that if it fails) #1974
Conversation
Can sometimes fire an assertion, e.g. #1962
Horrible suggestion: given &mfs only rarely breaks and does give a QoR improvement, what about detecting the failure and only then rerunning abc without &mfs in the script? |
Less horrible: write out the result before and after EDIT: This would only make sense if using an ABC9 script that calls Lines 45 to 76 in ae115fa
|
Re-enable mfs for xilinx/ecp5 speculatively -- if it fails, use pre-mfs result
@daveshah1 What do you think of 3d7b983? I've left the I've tested it by forcing an assert inside my out-of-tree ABC build as I don't have a sufficiently small testcase... |
Seems reasonable to me, I don't have a testcase to hand either though. |
Just tested and can confirm it works. I have used 215ac18f736cff06a4186e11b9abaa3d669f32e7 commit hash of dev branch of https://github.com/SpinalHDL/SaxonSoc.git which is known to cause this issue. |
Thanks @kost! Would you mind uploading the Verilog somewhere, I can't seem to get it working. Even better would be if you could minimise the design to find a small testcase that triggers it -- in my experience that can be quite hit-or-miss so don't worry if you're not successful. |
@eddiehung managed to extract the generated verilog and it is located here: Just untar it and run make. Just tested that it generates the error reported. Minimisation of the Verilog I would leave to experts like you. If you're able to document how you do it, i'll be happy to do it myself next time. |
Thanks @kost, really appreciate you doing that. I can reproduce the assertion fail on latest master (db27f2f). I'm in the process of minimising it right now, once it succeeds I'll explain my process (which I've made much less ad-hoc now that I have to explain it to someone!) However, even after all that, the problem I've run into the past and am running into here is that any testcase for this is very brittle. The same case doesn't fire an assertion on 57d6bd3 of #1926 which applies ABC9 in a slightly different way. |
Okay, here's my method, which uses Use:
Where
The first command runs This gives an output like this:
The current setup is naive and slow, and despite running it overnight it didn't reach a fixed point so I gave up. But if I was to refine the script, parallelise |
Guys, is &mfs in ABC still broken ? I cannot compile my two year old project based on VexRiscV (pretty basic one), it asserts at this very same please with -abc9 option enabled . If I disable -abc9, it passes synth ok, but the design does not fit into ECP5 (25k). Two years ago it worked fine, -abc9 worked and it did a load of optimization producing working bitstream. Please advise. |
Hi, it seems to be still broken : 68.21.5. Executing ABC9. |
Will try to report it upstream. |
|
Since
&mfs
can give a decent QoR improvement, I'm loathe to flat out disable it (my first approach). This PR does two things:(a) write the output file before every
&mfs
call(b) tolerate ABC9 with nonzero exit code (downgrading error to a warning) if output file exists
The idea is that even if
&mfs
fails -- at least with the default script -- we can still use the pre-&mfs
result as if it was disabled. This approach makes less sense when using some more complex scripts like:yosys/passes/techmap/abc9.cc
Lines 45 to 76 in ae115fa
in which multiple mapping rounds using
&save
/&load
may be superior to one round with&mfs
.In those cases, you may wish to disable
&mfs
explicitly using:scratchpad -set abc9.nomfs 1
before:
synth_{ecp5,xilinx} -abc9
(the two architectures known to trigger it so far)