Skip to content

Commit bf9cfe7

Browse files
committed
add exit function to mbox-ext-freertos test for simulation
1 parent a451721 commit bf9cfe7

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

sw/tests/control-pulp-tests/clic/clic-mbox-ext-freertos/clic-mbox-ps-freertos.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ void vApplicationTickHook(void);
5757

5858
#define MBOX_START_ADDRESS 0xFFFF0000
5959

60-
// #define INTR_ID 32
6160
#define INTR_ID 35
6261

6362
#define CLIC_BASE_ADDR 0x1A200000
@@ -81,6 +80,10 @@ void vApplicationTickHook(void);
8180
} \
8281
} while (0)
8382

83+
int first = 0;
84+
uint32_t ft = 1;
85+
volatile int set_cnt = 0;
86+
8487
void clic_setup_mtvec(void);
8588
void clic_setup_mtvt(void);
8689

@@ -93,9 +96,13 @@ void exit_fail(void)
9396
exit(1);
9497
}
9598

96-
int first = 0;
97-
uint32_t ft = 1;
98-
volatile int set_cnt = 0;
99+
void exit_success(void)
100+
{
101+
printf("someone wrote to mailbox!");
102+
exit(0); //---------------------------REMOVE THIS LINE IF IT IS NOT A SIMULATION
103+
callee_scmi_handler();
104+
}
105+
99106

100107
void complete_msg(uint32_t header, uint32_t agent_id){
101108
// write the header back
@@ -111,9 +118,10 @@ void complete_msg(uint32_t header, uint32_t agent_id){
111118

112119
void callee_scmi_handler(void)
113120
{
121+
114122
// set_cnt++;
115123
// printf("set_cnt: %d\r\n", set_cnt);
116-
printf("callee_scmi_handler");
124+
117125

118126
uint32_t agent_id = 0x0;
119127
uint32_t data = 0x0;
@@ -610,12 +618,6 @@ void callee_scmi_handler(void)
610618

611619
}
612620

613-
/* need void functions for isr table entries */
614-
void exit_success(void)
615-
{
616-
printf("someone wrote to mailbox! Precharged FW");
617-
callee_scmi_handler();
618-
}
619621

620622

621623
int main(void)
@@ -640,8 +642,6 @@ int main(void)
640642

641643
/* TODO: hook illegal insn handler to exit(1) */
642644

643-
644-
645645
printf("test csr accesses\r\n");
646646
uint32_t thresh = 0xffaa;
647647
uint32_t cmp = 0;
@@ -687,9 +687,7 @@ int main(void)
687687

688688
// printf("enable interrupt\n");
689689

690-
691690
// int *timestamp1 = (int *)(DRAM_BASE_ADDR);
692-
693691

694692
/* enable interrupt globally */
695693
irq_clint_global_enable();
@@ -701,7 +699,8 @@ int main(void)
701699
clic_isr_hook[0] = exit_success;
702700
csr_write(CSR_MINTTHRESH, 0); /* 0 < 0xaa */
703701

704-
for(volatile int i=0; i < 1000000; i++);
702+
703+
for(volatile int i=0; i < 1000000; i++);
705704

706705
return 1;
707706
}

0 commit comments

Comments
 (0)