aws / aws-fpga-f1-u200

Other
6 stars 4 forks source link

Interrupts after the first are not generated in software #8

Open darius-bluespec opened 2 years ago

darius-bluespec commented 2 years ago

The example design cl_dram_dma tests interrupts by triggering each interrupt number a single time. This works properly, as shown by various messages similar to the following:

2022-09-22T01:13:50.515123Z, test_dram_dma, INFO, test_dram_dma.c +173: interrupt_example(): Starting MSI-X Interrupt test
2022-09-22T01:13:50.520285Z, test_dram_dma, INFO, test_dram_dma.c +177: interrupt_example(): Polling device file: /dev/xdma0_events_0 for interrupt events
2022-09-22T01:13:50.520303Z, test_dram_dma, INFO, test_dram_dma.c +185: interrupt_example(): Triggering MSI-X Interrupt 0
2022-09-22T01:13:50.521298Z, test_dram_dma, INFO, test_dram_dma.c +199: interrupt_example(): Interrupt present for Interrupt 0, events 1. It worked!

And so on for each of the 16 interrupt numbers.

The follow change to test_dram_dma.c will cause each interrupt test to be run twice.

diff --git a/hdk/cl/examples/cl_dram_dma/software/runtime/test_dram_dma.c b/hdk/cl/examples/cl_dram_dma/software/runtime/test_dram_dma.c
index 9aa8606..18cb896 100644
--- a/hdk/cl/examples/cl_dram_dma/software/runtime/test_dram_dma.c
+++ b/hdk/cl/examples/cl_dram_dma/software/runtime/test_dram_dma.c
@@ -63,6 +63,7 @@ int main(int argc, char **argv) {
     fail_on(rc, out, "DMA example failed");

     /* run interrupt examples */
+    for (int i = 0; i < 2; i++)
         for (interrupt_n = 0; interrupt_n < USER_INTERRUPTS_MAX; interrupt_n++) {
             rc = interrupt_example(slot_id, interrupt_n);
            fail_on(rc, out, "Interrupt example failed");

Withe test_dram_dma modified as above, the first interrupt for each interrupt number occurs properly. However, the second results in the following messages:

2022-09-22T01:13:50.658388Z, test_dram_dma, INFO, test_dram_dma.c +173: interrupt_example(): Starting MSI-X Interrupt test
2022-09-22T01:13:50.663499Z, test_dram_dma, INFO, test_dram_dma.c +177: interrupt_example(): Polling device file: /dev/xdma0_events_0 for interrupt events
2022-09-22T01:13:50.663512Z, test_dram_dma, INFO, test_dram_dma.c +185: interrupt_example(): Triggering MSI-X Interrupt 0
2022-09-22T01:13:51.664709Z, test_dram_dma, ERROR, test_dram_dma.c +207: interrupt_example(): No interrupt generated- something went wrong.
2022-09-22T01:13:51.664738Z, test_dram_dma, ERROR, test_dram_dma.c +208: interrupt_example(): Interrupt generation failed

I have also seen similar behavior (first interrupt is generated in software as expected, subsequent interrupts are not) with a different design (different CL, different software) that works properly on an AWS F1 instance.

AWScsaralay commented 2 years ago

Hello, thank you for bringing this to our attention. We will try to reproduce the issue at our end and reach back shortly.