ibex/examples
Andreas Kurth 93c8e92c0d [sw/simple_system] Declare pcount_enable function as inline
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>
2023-03-17 13:04:37 +00:00
..
simple_system [rtl] Protect core_busy_o with a multi-bit encoding 2022-10-25 12:52:01 +02:00
sw [sw/simple_system] Declare pcount_enable function as inline 2023-03-17 13:04:37 +00:00