avoid interrupts while printing

This commit is contained in:
Stanislaw Kaushanski 2022-05-02 09:51:05 +02:00
parent 5f44f8df98
commit 0de438dc52
2 changed files with 5 additions and 1 deletions

Binary file not shown.

View File

@ -14,8 +14,10 @@ void run_xspn1(int in_addr, int out_addr, int num_samples, int in_beats, int out
spn_1::output_addr_reg() = out_addr;
spn_1::num_of_in_beats_reg() = in_beats; // Number of AXI4 burst beats needed to load all input data
spn_1::num_of_out_beats_reg() = out_beats; // Number of AXI4 burst beats needed to store all result data
spn_1::start_reg() = 1;
asm volatile ("csrrc x0, mie, %0; nop; nop" : : "r"(MIP_MEIP)); // Disable interrupts
printf("Starting first XSPN instance\n");
asm volatile ("csrrs x0, mie, %0; nop" : : "r"(MIP_MEIP)); // Enable interrupts
spn_1::start_reg() = 1;
}
void run_xspn2(int in_addr, int out_addr, int num_samples, int in_beats, int out_beats) {
@ -25,7 +27,9 @@ void run_xspn2(int in_addr, int out_addr, int num_samples, int in_beats, int out
spn_2::output_addr_reg() = out_addr;
spn_2::num_of_in_beats_reg() = in_beats; // Number of AXI4 burst beats needed to load all input data
spn_2::num_of_out_beats_reg() = out_beats; // Number of AXI4 burst beats needed to store all result data
asm volatile ("csrrc x0, mie, %0; nop; nop" : : "r"(MIP_MEIP)); // Disable interrupts
printf("Starting second XSPN instance\n");
asm volatile ("csrrs x0, mie, %0; nop" : : "r"(MIP_MEIP)); // Enable interrupts
spn_2::start_reg() = 1;
}