Skip to content

Commit d65a116

Browse files
author
Andrea Belano
committed
Update RedMulE tests to use interrupts
1 parent c3a4451 commit d65a116

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

target/snitch_cluster/sw/apps/redmule/data/data.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define REDMULE_MCFG1_PTR 0x10
7171
#define REDMULE_ARITH_PTR 0x14
7272

73+
#define HWPE_EVT_OFFS 0x94
7374
#define CK_GATE_OFFS 0x9C
7475

7576
// OPs definition
@@ -138,6 +139,10 @@ static inline void hwpe_soft_clear() {
138139
HWPE_WRITE(0, REDMULE_SOFT_CLEAR);
139140
}
140141

142+
static inline void hwpe_evt_clear(int value) {
143+
HWPE_WRITE(value, HWPE_EVT_OFFS);
144+
}
145+
141146
static inline void hwpe_cg_enable() { HWPE_WRITE(1, CK_GATE_OFFS); }
142147

143148
static inline void hwpe_cg_disable() { HWPE_WRITE(0, CK_GATE_OFFS); }

target/snitch_cluster/sw/apps/redmule/src/redmule.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ int main() {
6767
snrt_cluster_hw_barrier();
6868

6969
if (core_idx == 0) {
70-
printf("Checking RedMulE from core %d\n", core_idx);
70+
int status;
71+
snrt_interrupt_enable(IRQ_M_HWPE);
72+
while ((status = hwpe_get_status()) != 0) snrt_wfi();
73+
hwpe_evt_clear(1 << core_idx);
74+
snrt_interrupt_disable(IRQ_M_HWPE);
7175

7276
// Disable RedMulE
7377
hwpe_cg_disable();

0 commit comments

Comments
 (0)