-
Notifications
You must be signed in to change notification settings - Fork 241
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
Improve InstructionCounter and InstructionStatistics #21
Comments
Hello, |
@esperz2019, you are correct; Instruction Statistics is not working properly. The tool was never updated from using MIPS. It reads the RISC-V instructions as if they were MIPS instructions and therefore incorrectly categorizes them. The snippet I linked above shows exactly how the classification of instructions according to MIPS works. I haven't yet fixed it because its a nice self contained issue that a new contributor could solve. |
@TheThirdOne Thanks, I'd like to have a try if I have some time later. |
I'm currently modifying the Instruction Statistics tool to properly categorize the A extension instructions as part of #75. rars/src/rars/tools/InstructionStatistics.java Lines 238 to 241 in 0695981
After referring to the RISC-V Reference Datasheet, I believe the variables opCode and funct are reversed, as funct7 is in 25-31 and opcode is in 0-6. Furthermore, since opcode is 7 bits long, the bitmask to obtain it should be 0x7F , not 0x1F .
|
@giancarlopernudisegura, The code in InstructionStatistics is almost entirely wrong for RISC-V. I would recommend using |
This is officially fixed now. Thanks to @esperz2019 and @giancarlopernudisegura. |
InstructionCounter could be updated to also have counts for B and J. This would require copying some extra UI elements, adding some state to track counts and changing this
if
. This would only require understanding the code in InstructionCounter.rars/rars/tools/InstructionCounter.java
Lines 225 to 237 in 9ff2b88
InstructionStatistics is was never updated from MIPS. Updating this requires more work that InstructionCounter. You will need to update
getInstructionCategory(...)
; that will probably involve a fair amount ofinstanceof
checks. This requires understanding code inrars.riscv.instructions
.rars/rars/tools/InstructionStatistics.java
Lines 238 to 274 in 4b2d4b6
If you want to try to solve either of these and have trouble, feel free to ask for advice.
The text was updated successfully, but these errors were encountered: