diff options
Diffstat (limited to 'software')
-rw-r--r-- | software/coremark/.unsupported-boards | 6 | ||||
-rw-r--r-- | software/coreplexip_welcome/.unsupported-boards | 2 | ||||
-rw-r--r-- | software/double_tap_dontboot/.unsupported-boards | 3 | ||||
-rw-r--r-- | software/global_interrupts/.unsupported-boards | 2 | ||||
-rw-r--r-- | software/led_fade/.unsupported-boards | 3 | ||||
-rw-r--r-- | software/local_interrupts/.unsupported-boards | 2 | ||||
-rw-r--r-- | software/performance_counters/performance_counters.c | 24 |
7 files changed, 41 insertions, 1 deletions
diff --git a/software/coremark/.unsupported-boards b/software/coremark/.unsupported-boards new file mode 100644 index 0000000..9221334 --- /dev/null +++ b/software/coremark/.unsupported-boards @@ -0,0 +1,6 @@ +# We don't deliver the full coremark sources for license reasons, so this can't +# run in regression. +freedom-e300-hifive1 +freedom-e300-arty +coreplexip-e31-arty +coreplexip-e51-arty diff --git a/software/coreplexip_welcome/.unsupported-boards b/software/coreplexip_welcome/.unsupported-boards new file mode 100644 index 0000000..33cea3a --- /dev/null +++ b/software/coreplexip_welcome/.unsupported-boards @@ -0,0 +1,2 @@ +freedom-e300-arty +freedom-e300-hifive1 diff --git a/software/double_tap_dontboot/.unsupported-boards b/software/double_tap_dontboot/.unsupported-boards new file mode 100644 index 0000000..4e93148 --- /dev/null +++ b/software/double_tap_dontboot/.unsupported-boards @@ -0,0 +1,3 @@ +coreplexip-e31-arty +coreplexip-e51-arty + diff --git a/software/global_interrupts/.unsupported-boards b/software/global_interrupts/.unsupported-boards new file mode 100644 index 0000000..33cea3a --- /dev/null +++ b/software/global_interrupts/.unsupported-boards @@ -0,0 +1,2 @@ +freedom-e300-arty +freedom-e300-hifive1 diff --git a/software/led_fade/.unsupported-boards b/software/led_fade/.unsupported-boards new file mode 100644 index 0000000..4e93148 --- /dev/null +++ b/software/led_fade/.unsupported-boards @@ -0,0 +1,3 @@ +coreplexip-e31-arty +coreplexip-e51-arty + diff --git a/software/local_interrupts/.unsupported-boards b/software/local_interrupts/.unsupported-boards new file mode 100644 index 0000000..33cea3a --- /dev/null +++ b/software/local_interrupts/.unsupported-boards @@ -0,0 +1,2 @@ +freedom-e300-arty +freedom-e300-hifive1 diff --git a/software/performance_counters/performance_counters.c b/software/performance_counters/performance_counters.c index e7c12a3..8094128 100644 --- a/software/performance_counters/performance_counters.c +++ b/software/performance_counters/performance_counters.c @@ -18,6 +18,15 @@ // rollover with this routine as suggested by the // RISC-V Priviledged Architecture Specification. +#if __riscv_xlen == 64 +#define rdmcycle(x) { \ + uint64_t hi; \ + __asm__ __volatile__ ("1:\n\t" \ + "csrr %0, mcycle\n\t" \ + : "=r" (hi)) ; \ + *(x) = hi; \ + } +#else #define rdmcycle(x) { \ uint32_t lo, hi, hi2; \ __asm__ __volatile__ ("1:\n\t" \ @@ -28,12 +37,22 @@ : "=r" (hi), "=r" (lo), "=r" (hi2)) ; \ *(x) = lo | ((uint64_t) hi << 32); \ } +#endif // The minstret counter is 64-bit counter, but // Freedom E platforms use RV32, we must access it as // 2 32-bit registers, same as for mcycle. +#if __riscv_xlen == 64 +#define rdminstret(x) { \ + uint64_t hi; \ + __asm__ __volatile__ ("1:\n\t" \ + "csrr %0, minstret\n\t" \ + : "=r" (hi)) ; \ + *(x) = hi; \ + } +#else #define rdminstret(x) { \ uint32_t lo, hi, hi2; \ __asm__ __volatile__ ("1:\n\t" \ @@ -44,6 +63,7 @@ : "=r" (hi), "=r" (lo), "=r" (hi2)) ; \ *(x) = lo | ((uint64_t) hi << 32); \ } +#endif // Simple program to measure the performance of. @@ -90,9 +110,11 @@ int main() for (int ii = 0; ii < 3; ii++){ write_csr(mcycle, 0); - write_csr(mcycleh, 0); write_csr(minstret, 0); +#if __riscv_xlen == 32 + write_csr(mcycleh, 0); write_csr(minstreth, 0); +#endif volatile int result = factorial (100); |