-
Notifications
You must be signed in to change notification settings - Fork 78
Fix Encoding for addiw Instruction #243
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
Conversation
|
Thanks for the contribution. @AFOliveira, this reminds me that we should get the checker that validates against |
We surely do. How do you prefer this done? I can create a script that simply prints the matches from riscv-opcodes by instruction. The thing is will all parts need to be done in ruby? Or can the match be generated from a python script and the comparison in ruby? |
|
Python is fine. The only Ruby part that will be needed is a task to run the python script with the rest of the regression tests. Look for # this will fail if the python script exists with non-zero
task :rv_op_check do
sh "python BLAH BLAH"
end |
|
I'd argue that verifying against riscv-opcodes is short-lived, as we really want to generate the content in risv-opcodes from the content in riscv-unified-db, but it could be a decent intermediate effort. (I think it'll eventually be thrown away, though.) We've got a similar, but more challenging effort underway: to verify the content of riscv-unified-db from the content in the Sail model. That's how this issue was discovered. Unfortunately, our task is currently showing more errors in our JSON than the YAML, but we're working on it. ;-) I've got a mentee looking at generating the content in riscv-opcodes from the YAML here, just started. 🤞 |
I think the take in that what goes in favor of that are two thing
IMO checking from SAIL will be better of course, but since this won't take much time, it still has it's short-time purpose. I guess while it exists, we can double check. In the long-term I would suggest aditionally checking from binutils. This kind of checks will be great not only fot the udb, but also for SAIL, binutils and riscv-opcodes. By actually checking them all against each other, we'll ultimately enhace the whole ecossystem.
There is a branch in this repo called pr/AFOliveira/21 where I do the exact opposite. It is not fully up to date, but I'll try to make it soon. Alhtough, it's not the best written and careful code, it might be worth the check. If there is something I can help with that, feel free to hit me up! |

The encoding for the addiw instruction did not match the specification.
Previously, we had:
[imm:12][rs1:5]000[rd:5]0001011Corrected to:
[imm:12][rs1:5]000[rd:5]0011011Please refer to page 575 of the specification for more details.
Thank you!