You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hw/vendor/lowrisc_ibex/doc/03_reference/performance_counters.rst
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,13 @@
3
3
Performance Counters
4
4
====================
5
5
6
-
Ibex implements performance counters according to the RISC-V Privileged Specification, version 1.11 (see Hardware Performance Monitor, Section 3.1.11).
6
+
Ibex implements performance counters according to the RISC-V Privileged Specification, version 1.11 (see Hardware Performance Monitor, Section 3.1.11) and supports the **Zihpm** (Hardware Performance Counters) extension.
7
7
The performance counters are placed inside the Control and Status Registers (CSRs) and can be accessed with the ``CSRRW(I)`` and ``CSRRS/C(I)`` instructions.
8
8
9
-
Ibex implements the clock cycle counter ``mcycle(h)``, the retired instruction counter ``minstret(h)``, as well as the 29 event counters ``mhpmcounter3(h)`` - ``mhpmcounter31(h)`` and the corresponding event selector CSRs ``mhpmevent3`` - ``mhpmevent31``, and the ``mcountinhibit`` CSR to individually enable/disable the counters.
9
+
Ibex implements the machine-mode clock cycle counter ``mcycle(h)``, the retired instruction counter ``minstret(h)``, as well as the 29 event counters ``mhpmcounter3(h)`` - ``mhpmcounter31(h)`` and the corresponding event selector CSRs ``mhpmevent3`` - ``mhpmevent31``, and the ``mcountinhibit`` CSR to individually enable/disable the counters.
10
+
11
+
Additionally, Ibex implements the Zicntr and Zihpm extensions which provide User-mode (U-mode) aliases for these performance counters: ``cycle(h)``, ``instret(h)``, and ``hpmcounter3(h)`` - ``hpmcounter31(h)``. These aliases provide read-only access to the exact same underlying hardware counters configured in M-mode.
12
+
10
13
``mcycle(h)`` and ``minstret(h)`` are always available and 64 bit wide.
11
14
The ``mhpmcounter`` performance counters are optional (unavailable by default) and parametrizable in width.
12
15
@@ -60,6 +63,19 @@ In particular, to enable/disable ``mcycle(h)``, bit 0 must be written. For ``min
60
63
The lower 32 bits of all counters can be accessed through the base register, whereas the upper 32 bits are accessed through the ``h``-register.
61
64
Reads to all these registers are non-destructive.
62
65
66
+
User-Mode Counter Access (mcounteren)
67
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68
+
69
+
Access to the U-mode counter aliases (``cycle(h)``, ``instret(h)``, and ``hpmcounterX(h)``) is controlled via the Machine Counter-Enable CSR (``mcounteren``). This register can gate access to the counters from less privileged modes to prevent benchmarking the core if desired.
70
+
71
+
* **Bit 0** controls access to ``cycle(h)``.
72
+
* **Bit 2** controls access to ``instret(h)``.
73
+
* **Bit X** controls access to ``hpmcounterX(h)``.
74
+
75
+
When a bit in ``mcounteren`` is clear (0), any attempt to read the corresponding counter alias from U-mode will trigger an illegal instruction exception.
76
+
77
+
To secure this mechanism, the ``mcounteren`` register can be locked against software modifications using a MUBI input signal called ``mcounteren_writeable``. When this signal disables writes, any attempt by software to modify the contents of ``mcounteren`` is ignored.
Copy file name to clipboardExpand all lines: hw/vendor/lowrisc_ibex/doc/04_developer/concierge.rst
+15-26Lines changed: 15 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,7 @@ The Ibex Concierge
8
8
The Ibex Concierge is the friendly caretaker of the Ibex project.
9
9
It's a rotating duty shared by experienced contributors to help newcomers find their way around the project, and to stay on top of the various small tasks necessary to keep the project going.
10
10
11
-
The Ibex CPU project is a reasonably large open source project.
12
-
Like all projects we experience two challenges:
13
-
we want to lend a helping hand to new developers, answering their questions or helping them with code contributions.
14
-
And we need to stay on top of our "caretaker" tasks, like fixing problems with our continuous integration setup, triaging issues and pull requests, etc.
15
-
The Ibex Concierge combines these two duties in one person.
16
-
17
-
Please reach out to the Ibex Concierge if you have trouble finding your way around the Ibex project.
18
-
You can find today's Ibex Concierge in the calendar below.
11
+
The best way to reach the Ibex Concierge team is by creating an issue on our repository.
19
12
20
13
21
14
Who is Ibex Concierge today?
@@ -24,14 +17,11 @@ Who is Ibex Concierge today?
24
17
The concierge duties rotate between several core developers on a weekly basis.
25
18
You can find today's concierge on duty in a `public calendar <https://calendar.google.com/calendar/embed?src=lowrisc.org_s0pdodkddnggdp40jusjij27h4%40group.calendar.google.com>`_.
26
19
27
-
Besides the concierge on duty you can also contact the following people for urgent matters:
20
+
Besides the concierge on duty you can also contact the following people for urgent matters and for prioritisation:
28
21
29
22
* Marno van der Maas (`@marnovandermaas <https://github.com/marnovandermaas>`_)
0 commit comments