-
Notifications
You must be signed in to change notification settings - Fork 855
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
0.9 generates .json parameter that nextpnr can't parse due to extra <space> character (worked in 0.8) #1341
Comments
The space is deliberate to disambiguate between strings used to bit vectors and actual strings that contain only |
Incidentally, I don't think the value for pullup should be inside a string in the first place, the vendor examples show |
Ran with nextpnr at |
I'll try to see if I can use this moment to learn more about nMigen, but suspect that I'll need some help to address the |
Right, having looked into the code a bit more it isn't a bug at all. As per my second comment, PULLUP is supposed to be an actual number not a number inside a string (at least the vendor examples and Yosys cell library seem to use this), which is as good a reference as any). This is no longer ambiguous (previously the JSON format didn't differentiate between numbers in strings and bit vectors in some cases, but this was a horrible bug) so nextpnr now catches it as an error. |
OK, Got it. I think I can change the PULLUP in https://github.com/m-labs/nmigen-boards/blob/master/nmigen_boards/icebreaker.py#L30. I'll open a note in nMigen and see if we can address this in the board definitions (more than iCEBreaker). |
Steps to reproduce the issue
See gist files to help reproduce.
The issue is present in
Yosys 0.9+1 (git sha1 a0b666f2, clang 10.0.1 -fPIC -Os)
. Worked inYosys 0.8+ 615 (git sha1 a02d1720, clang 10.0.1 -fPIC -Os)
Expected behavior
No extra spaces in .json parameter (PULLUP), i.e.
"1"
.Actual behavior
Extra space
"1 "
in .json parameter (PULLUP), whichnextpnr
fails on.Details
Yosys 0.9+1 (git sha1 a0b666f2, clang 10.0.1 -fPIC -Os)
produces an extra space in"1 "
for thePULLUP
parameter below:This trips up nextpnr to error out with
ERROR: expected numeric value for parameter 'PULLUP' on cell 'uart_0__rx_0'
Version
Yosys 0.8+ 615 (git sha1 a02d1720, clang 10.0.1 -fPIC -Os)
did not produce the extra space:Reverting 15fae35 removes the problem (as a workaround).
I believe https://github.com/YosysHQ/yosys/blob/master/backends/json/json.cc#L102 may be the problematic line and will send a separate pull request to change it to add the space only if
state == 1
.The text was updated successfully, but these errors were encountered: