ThinkOpenly / sail-riscv

Sail RISC-V model
Other
11 stars 14 forks source link

Add more extension as described in Issue #4 #18

Closed jriyyya closed 5 months ago

jriyyya commented 5 months ago

This PR aims to continue the remaining work from commit https://github.com/ThinkOpenly/sail-riscv/commit/7c1eae725f945a30a41ab84eee000ec85dcafb0f of issue #4 converting all uses of haveZdinx(), haveZhinx(), haveZfinx() to extension("Zdinx"), extension("Zhinx"), extension("Zfinx") respectively to facilitate parsing.

ThinkOpenly commented 5 months ago

Thanks, @jriyyya! The code looks fine to me. It compiles and produces the same output as before, as expected. You've marked this PR as "draft", so I will hold off merging it for now.

Really minor comments:

With or without any of those suggestions implemented (as I said it's fine as-is), remove the "draft" marking when you are ready for me to merge this!

jriyyya commented 5 months ago

Thanks for the Review. I was actually planning to continue this PR and further add extension function for D and F. We can also open another PR for the same, So removing the draft here.

Sorry about the commit message. Should Squash these three commits into to a single commit as "Utilize extension() instead of haveZdinx(), haveZfinx(), haveZhinx" ?

I thought of adding a description when I would have removed the draft tag, I have added it now. I will keep in mind to add it beforehand next time 😅.

ThinkOpenly commented 5 months ago

grepping through the code, I see a need to make similar changes for haveSupMode, haveUsrMode, haveNExt, haveZmmul, and haveZkr (at least).

(A good test might be to comment out all of the have* functions in model/riscv_sys_regs.sail, and see what errors are produced when building. I have not done this.)

For now, what you have posted is great. I'll merge this, and you can continue with those, at your option, when you are able. Thanks, again!

jriyyya commented 5 months ago

(A good test might be to comment out all of the have* functions in model/riscv_sys_regs.sail, and see what errors are produced when building. I have not done this.)

Quite a nice idea, I will give it a try!