Skip to content
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

Question about measuring how many cycles the program takes with RISC-V "rdcycle" instruction. #30

Closed
nenjeff opened this issue Apr 16, 2018 · 2 comments

Comments

@nenjeff
Copy link

nenjeff commented Apr 16, 2018

Hello,

I have referenced issue #7.
(1). I use the method RISC-V "rdcycle" instruction to measure how many cycles the program takes.
And it gets:
image

(2). I have also checked out with .vcd file and make sure above method get correct result.
It complete in 86975(ns), and the clock period is 2(ns).
Therefor, the program takes about 43487 cycles to complete.
image
image

Why the results differ dramatically? Or there is something I misunderstand?

@zhemao
Copy link
Contributor

zhemao commented May 3, 2018

Are you saying that the simulation terminated 43487 cycles in?

The point at which the rdcycle instruction executes is long before the simulation terminates.

@nenjeff
Copy link
Author

nenjeff commented May 16, 2018

"Are you saying that the simulation terminated 43487 cycles in?"
->Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants