From 7e67611e5e273ae3abeb2606c5cb5f71695ae5bd Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 22 Jul 2024 09:58:26 +0200 Subject: [PATCH] test: Remove deprecated `interrupt` test --- sw/tests/interrupt.c | 82 ------------------------------- target/snitch_cluster/sw/run.yaml | 1 - 2 files changed, 83 deletions(-) delete mode 100644 sw/tests/interrupt.c diff --git a/sw/tests/interrupt.c b/sw/tests/interrupt.c deleted file mode 100644 index 3d1ef907a8..0000000000 --- a/sw/tests/interrupt.c +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2020 ETH Zurich and University of Bologna. -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 - -#include "snrt.h" - -// Test output printf -#define tprintf(...) printf(__VA_ARGS__) - -// Progress printf -#define pprintf(...) printf(__VA_ARGS__) - -volatile static int32_t global_flag; - -void sleep_loop(uint32_t cluster_core_idx, volatile int32_t *flag) { - snrt_interrupt_enable(IRQ_M_CLUSTER); - for (unsigned i = 8; i; --i) { - snrt_wfi(); - snrt_int_cluster_clr(1 << cluster_core_idx); - __atomic_add_fetch(flag, 1, __ATOMIC_RELAXED); - while (__atomic_load_n(flag, __ATOMIC_RELAXED)) - ; - snrt_cluster_hw_barrier(); - } - snrt_interrupt_disable(IRQ_M_CLUSTER); -} - -int main() { - unsigned cluster_idx = snrt_cluster_idx(); - unsigned core_idx = snrt_global_core_idx(); - unsigned core_num = snrt_global_core_num(); - - // Test1: Core 0 sends interrupts to each hart sequentially and - // polls the flag and checks for correctness - if (core_idx == 0) { - for (unsigned i = 1; i < core_num; i++) { - tprintf("IRQ %d ..", i); - global_flag = -1; - snrt_int_sw_set(snrt_global_core_base_hartid() + i); - while (global_flag != (int)i) - ; - tprintf("OK\n", global_flag); - } - } else { - snrt_interrupt_enable(IRQ_M_SOFT); - snrt_interrupt_global_enable(); - asm volatile("wfi"); - snrt_interrupt_global_disable(); - } - snrt_global_barrier(); - if (core_idx == 0) pprintf("Test 1 complete\n"); - - // Test2: Enable software interrupt wihout jumping to the exception - // address - if (core_idx == 0) { - for (unsigned i = 1; i < core_num; i++) { - tprintf("trig %d..", i); - global_flag = -1; - snrt_int_sw_set(snrt_global_core_base_hartid() + i); - while (global_flag != ((int)i << 8)) - ; - tprintf("OK\n", global_flag); - } - } else { - snrt_interrupt_enable(IRQ_M_SOFT); - asm volatile("wfi"); - // interrupts are disabled so the mcause register is not updated - if (snrt_int_sw_get(snrt_hartid())) { - snrt_int_sw_clear(snrt_global_core_base_hartid() + core_idx); - global_flag = core_idx << 8; - } - } - snrt_global_barrier(); - if (core_idx == 0) pprintf("Test 2 complete\n"); - - return 0; -} - -void irq_m_soft(uint32_t core_idx) { - snrt_int_sw_clear(snrt_global_core_base_hartid() + core_idx); - global_flag = core_idx; -} diff --git a/target/snitch_cluster/sw/run.yaml b/target/snitch_cluster/sw/run.yaml index 45af517b1a..181d96ab7b 100644 --- a/target/snitch_cluster/sw/run.yaml +++ b/target/snitch_cluster/sw/run.yaml @@ -55,7 +55,6 @@ runs: simulators: [vsim, vcs, verilator] # banshee fails with illegal instruction # - elf: tests/build/fp64_conversions_scalar.elf # simulators: [vsim, vcs, verilator] - # - elf: tests/build/interrupt.elf - elf: tests/build/interrupt_local.elf - elf: tests/build/multi_cluster.elf - elf: tests/build/openmp_parallel.elf