riscv-platform-specs icon indicating copy to clipboard operation
riscv-platform-specs copied to clipboard

Inconsistent mtime requirements

Open jrtc27 opened this issue 3 years ago • 1 comments

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.

jrtc27 avatar Aug 08 '21 16:08 jrtc27

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

kumarsankaran avatar Mar 19 '22 00:03 kumarsankaran