Skip to content

Commit

Permalink
sw: Make tests agnostic of core num
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Jul 27, 2024
1 parent 54aeece commit 5e09528
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
2 changes: 1 addition & 1 deletion sw/tests/caq.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <snrt.h>

#define NUM_WORKERS 8
#define NUM_WORKERS 4

// To prevent X reads on non-CAQ-proofed systems, we need a sync
inline void fp_sync() {
Expand Down
7 changes: 6 additions & 1 deletion sw/tests/non_null_exitcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
// Should be used as a test to check that the simulator or whoever
// is running the program actually captures an error when it occurs.

int main() { return 14; }
// Minimum number of cores the hardware must have for this test to pass
#define MIN_CORES 4

int main() {
if (snrt_cluster_core_idx() < MIN_CORES) return 14;
}
2 changes: 1 addition & 1 deletion sw/tests/openmp_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ unsigned __attribute__((noinline)) parallel_section(void) {
tx = read_csr(minstret) - tx;
__atomic_add_fetch(&sum, 10, __ATOMIC_RELAXED);
}
return sum != 8 * 10;
return sum != snrt_cluster_compute_core_num() * 10;
}

int main() {
Expand Down
23 changes: 0 additions & 23 deletions sw/tests/team_global.c

This file was deleted.

2 changes: 1 addition & 1 deletion target/snitch_cluster/sw/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ runs:
- elf: tests/build/varargs_2.elf
- elf: tests/build/zero_mem.elf
- elf: tests/build/non_null_exitcode.elf
retcode: 126
retcode: 56
- elf: tests/build/caq.elf
- elf: tests/build/caq_frep.elf
simulators: [vsim, vcs, verilator] # banshee does not model FREP timing
Expand Down

0 comments on commit 5e09528

Please sign in to comment.