-
Notifications
You must be signed in to change notification settings - Fork 167
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
mcycle value does not increment in sail #193
Comments
Hi. this looks like a problem with the integration of your tool (riscof?) with the Sail model. In the c emulator there is a call here to the Sail function |
@rmn30 within riscof, the C emulator is simply run as a command line similar to below (see this):
where riscv_sim_RV32 is the c emulator binary built from this repo. Do you suggest we build the emulator differently or use other flags in the cli for the mcycle issue ? |
Ah, on second thoughts the issue is more likely the So maybe we should add a new command line argument to the simulator to set rv_insns_per_tick and perhaps change the default value? |
Another potential solution would be to move the call to tick_clock outside the if statement, assuming the clock should increment once per instruction. |
Just curious - any reason why its 100 as of now ? would making the default to 1 break anything internally ? A cli arg would definitely be best way forward. |
I'm not really sure. Looks like @pmundkur wrote it. Maybe something to do with what spike did or with booting OS more quickly? |
FYI: I intend to make this configurable at some point in the future (based on settings in the RISCV-Config file probably). Note: There are other counters/timers that suffer from a similar problem. The Sail model has no concept of clock cycles or of time (which is the main source of the problem). |
I don't think there is any value with making it anything but 1, actually.
DUTs will have nondeterministic values that could be both less than 1 (e.g.
superscale, so multiple ops per cycle) or >1 (stalls),
so there isn't much point in making it configurable that I can see.
For tests that care about timing, we will need to use instret as a
reference, not cycle (or time).
…On Wed, Nov 23, 2022 at 7:23 AM Bill McSpadden ***@***.***> wrote:
FYI: I intend to make this configurable at some point in the future (based
on settings in the RISCV-Config file probably).
Note: There are other counters/timers that suffer from a similar problem.
The Sail model has no concept of clock cycles or of time (which is the main
source of the problem).
—
Reply to this email directly, view it on GitHub
<#193 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJQUQS2GEGB2EYG3GV3WJYZF7ANCNFSM6AAAAAASI3F3U4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I am writing test that checks mcycle value increments. For Spike, the value of mcycle increases, whereas for Sail, the value of mcycle remains constant. Here is the test result screenshot and the assembly code for the test.
LI(x1,0)
LI(a5,-1) // ALL 1's
LI(x5, 1)
csrw mcycle, a5
nop
csrr a4, mcycle
nop // nop in case of trap
RVTEST_SIGUPD(x13, a4) // Putting updated value in signature file
The text was updated successfully, but these errors were encountered: