-
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
CSR time and timeh registers #61
Comments
I am totally willing to implement time and timeh; because I was unsure of what behavior was best I was leaving off actually implementing it until someone needed it. So now that you need it I should implement it in some form. Technically speaking, just using system time is a very simple solution that would take a total of ~10 lines. Another solution of similar complexity would just be mirroring instret or cycles. Those two potential solutions would have different behavior when interactively debugging. I would leave it to you to decide between those two or suggest a third option. I see pros and cons to both options for various people, but you have a concrete use case so it should be more clear. |
Since Chapter 10 of the RISC-V Instruction Set Manual (version 20190608) defines the time and timeh registers as a real-time clock, I think using a millisecond counter and keeping them independent of the cycle and instret registers (in rather than mirroring them) is the best choice. |
I don't believe the specification defines anything about how long a single tick for the time register is. While 1ms / tick seems reasonable, I think a wide range of periods would be compliant.
I believe making time = cycles would only restrict it to a hypothetical single stage, fixed frequency processor. |
time and timeh are now implemented by just using system time. Rather than update only when read, they update their values at the end of each cycle. You should be able to check it out in the latest continuous release. If you would like a stable release I can do that, but I would like to make the next release include support for doubles which will probably take at least a week. |
Hi, |
Some tools were not updated correctly because of forced colors on them (Issue TheThirdOne#61 ). This fixes half of them. The rest is still do be done.
Last tool that needed modification for dark mode ( issue TheThirdOne#61 ) was the memory reference visualization that is updated here.
Hi,
I think it would be very nice if the CSR registers time (3073) and timeh (3201) could be implemented, as simple as
long csr_time = System.currentTimeMillis();
Suggestion:
Maybe, to reduce the computational complexity, instead of continuously showing their values in the register bank panel, these values can be updated only when these registers are read by csrr t0, 3073 or csrr t0, 3201 instructions.
We are implementing these registers on RISC-V hardware (FPGA), and this improvement in Rars would be nice to maintain the "compatibility".
Of course, there are many other issues involved, such as step-by-step execution and back step tracking, as you said before, but we can deal with this in sequence. :)
The text was updated successfully, but these errors were encountered: