mirror of
https://github.com/lowRISC/ibex.git
synced 2025-04-24 13:57:19 -04:00
The `pcount_enable` function can be used to selectively enable performance counters only for a specific code segment. For example: ```c pcount_enable(0); pcount_reset(); pcount_enable(1); /* code to be measured */ pcount_enable(0); ``` The `pcount_enable` function consists of a single CSR instruction, so the overhead and thus the impact on the measurement is potentially low. When the function is called, however, many instructions have to be executed in addition to the single CSR instruction, which influences measurements. This commit moves the `pcount_enable` function to the `simple_system_common.h` header file and declares it as `inline` (and `static`, to prevent link-time collisions when the header file is included in multiple compilation units). This helps the compiler inline the function even without LTO. Signed-off-by: Andreas Kurth <adk@lowrisc.org> |
||
---|---|---|
.. | ||
simple_system | ||
sw |