-
Notifications
You must be signed in to change notification settings - Fork 23
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
Make compile for Yosys 0.37 #2300
Conversation
Of course, the build will now fail as it assumes Yosys 0.36. |
Yosys version seems to be a variable in its Makefile: https://github.com/YosysHQ/yosys/blob/master/Makefile#L144 |
FYI @tgorochowik @kgugala |
@hzeller at this point I think it might be worth considering analyzing the yosys binary we're building with, extracting the mangled symbol and calling it with I pushed a simple PoC here: The implementation above works on my machine with both old and new yosys, but it's obviously not universal, because symbol mangling might differ between platforms, but the symbols could be checked with Another thought I have is using a weak symbol with all arguments that would call the original symbol with fewer arguments (and a weak empty symbol without the extra argument so it still compiles with new yosys), but I'm not sure this can be simply pushed to an external namespace, might be worth an experiment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hzeller , please update yosys in this PR too. It currently breaks as you are still using the previous yosys.
PS, I would not worry about backward compatibility.
Good point, in general I agree, however I think latest changes in yosys (before the API change) broke some regression tests in the plugin. These might need to be fixed before we can bump yosys |
Yosys added another parameter to AST::process(), which we have to track. Unfortunately, there is no easy way to #ifdef on a yosys version that I know of (there do not seem to be macros exposed), so this will not compile with old versions anymore. Fixes chipsalliance#2299
3dd46d4
to
69b407e
Compare
@hzeller all the failures probably require porting all the changes happening in: To: ./third_party/yosys_mod/synlig_simplify.cc BTW, this ./third_party/yosys_mod/synlig_simplify.cc is going to be an eternal problem. Check the existing diffs even before this new PR. Maintenance nightmare... tkdiff ./third_party/yosys/frontends/ast/simplify.cc ./third_party/yosys_mod/synlig_simplify.cc Bringing those changes in, might in turn require some minor changes in the rest of the plugin. I think that makes the point about trying to maintain backward compatibility based one function signature moot. |
Yeah, it looks like we can only strictly move forward with only marginal backward compatibility. I have not tracked that, how is synlig_simplify.cc different from the origin it was coming from ? Unfortunately, all version information is lost that it would be possible to see what is different. |
Discussed in NixOS#281384 This is filed as upstream issue chipsalliance/synlig#2299 ... and addressed in this pull request chipsalliance/synlig#2300 Patched into this nix package. Co-authored-by: Luflosi <luflosi@luflosi.de>
The problem is much larger than that. To checkout the repo before the file name change: git checkout 01111c5 The Antmicro guys had a methodology to merge-in changes as the one your pointed out above. Please check with them if they can help. |
It's possible that it's a matter of backporting the changes from simplify. It's not possible to say for certain without an actual analysis of the new errors (or without actually doing this). I still think having a slim compatibility layer to not have to deal with that each time API changes could be beneficial (of course I agree it'd be better to just fix those issues, but having sth to unblock you until this is done would be nice). @hzeller since you didn't like the dlsym approach, PTAL at a simple workaround with the use of weak linking: dc75266 - it works for me both with old and new yosys. Of course it has it's own limitations (i.e. not all platforms support weak linking), if something similar breaks in the future adding extra wrappers similar to this one should be super quick. |
I think I like the weak-linkage approach in Can you format it neatly like I did in this PR with comments on what these values are ? It is super-confusing and easy to miss what the n'th boolean means :) |
This uses a weak symbol which allows us to build and link with Yosys before and after the API change. Ref: #2300
Yosys added another parameter to AST::process(), which we have to track.
Unfortunately, there is no easy way to #ifdef on a yosys version that I know of (there do not seem to be macros exposed), so this will not compile with old versions anymore.
Fixes #2299