ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

time

T1 riscv register register
Timer for RDTIME Instruction
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (Zicntr)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeU
ExtensionsZicntr

Summary

Privilege mode access is controlled with mcounteren.TM, scounteren.TM, and hcounteren.TM as follows:

Syntax / Encoding

CSR 0xc01 (U-mode, RO)

Bitfields (1)

BitsFieldDescription
63:0COUNTReports the current wall-clock time from the timer device. Alias of the mtime memory-mapped CSR.

Reference Notes

[when,"TIME_CSR_IMPLEMENTED == false"]
This CSR does not exist, and access will cause an IllegalInstruction exception.

[when,"TIME_CSR_IMPLEMENTED == true"]
--
Shadow of the memory-mapped M-mode CSR `mtime`.

Privilege mode access is controlled with `mcounteren.TM`, `scounteren.TM`, and `hcounteren.TM` as follows:

[%autowidth,cols="1,1,1,1,1,1,1",separator="!"]
!===
.2+h![.rotate]#`mcounteren.TM`# .2+h! [.rotate]#`scounteren.TM`# .2+h! [.rotate]#`scounteren.TM`#
4+^.>h! `time` behavior
.^h! S-mode .^h! U-mode .^h! VS-mode .^h! VU-mode

! 0 ! - ! - ! `Illegal Instruction` ! `Illegal Instruction` ! `Illegal Instruction` ! `Illegal Instruction`
! 1 ! 0 ! 0 ! read-only ! `Illegal Instruction` ! `Illegal Instruction` ! `Illegal Instruction`
! 1 ! 1 ! 0 ! read-only ! read-only ! `Illegal Instruction` ! `Illegal Instruction`
! 1 ! 0 ! 1 ! read-only ! `Illegal Instruction` ! read-only ! `Illegal Instruction`
! 1 ! 1 ! 1 ! read-only ! read-only ! read-only ! read-only
!===
--