Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Inconsistent mtime requirements #38

Open
jrtc27 opened this issue Aug 8, 2021 · 1 comment
Open

Inconsistent mtime requirements #38

jrtc27 opened this issue Aug 8, 2021 · 1 comment

Comments

@jrtc27
Copy link
Contributor

jrtc27 commented Aug 8, 2021

Currently the spec says:

  • Platforms are required to provide an at least 10ns resolution 64-bit counter with strictly monotonic updates.

  • The hardware clock that drives the counter is required to operate at a minimum frequency of 10MHz.

but also:

For a counter with 10ns resolution the timebase-frequency value would be 100000000 (100 MHz) which would also be the minimum possible value for timebase-frequency. From the software perspective a unit increment of the mtime value would correspond to a 10ns interval. However the hardware clock driving the counter could operate at a lower frequency, thereby incrementing the mtime value by more than one unit per clock tick.

These are all contradictory; a 10MHz clock doesn't give a resolution of 10ns, and similarly if the clock is at a lower frequency than timebase-frequency, with the latter still reporting 100 MHz, and steps multiple values at a time then you're not going to have a resolution of 10ns since you never see an individual step.

@kumarsankaran
Copy link
Collaborator

@jrtc27 Is this issue still there in the latest spec version? The timer requirements have been modified.

AlexGhiti pushed a commit to AlexGhiti/riscv-platform-specs that referenced this issue Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants