-
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
frontend: json: parse negative values #2567
Conversation
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
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.
So what happens if the input is something like 123-456
?
It will break here https://github.com/YosysHQ/yosys/blob/master/frontends/json/jsonparse.cc#L91 |
Actually, is this even the right approach? Is there a |
I think we should ping @eddiehung in here too, since this is from the eddie/abc9_scc_fixes2 branch, and it would be a good idea to roll it up into his next round of ABC9 fixes. |
Right or not, negative offsets are valid in Verilog either way, so this patch should be merged regardless. |
As in, currently converting the following to JSON and trying to read it back just fails:
|
data_number = ch - '0'; | ||
if (ch == '-') { | ||
data_number = 0; | ||
negative = true; |
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.
whitespace error.
I'm not sure the |
When scc breaks logic loops with
$__ABC9_SCC_BREAKER
module it adds the following entry to resulting json:reading the json back to yosys results in:
in the
"offset": -1,
lineThis PR fixes that