Skip to content

Commit

Permalink
Ensure Status-type interrupts are disabled too
Browse files Browse the repository at this point in the history
Disable all interrupts after they've occurred, including Status
type interrupts, because leaving them enabled can lead to spurious
failures of subsequent tests or a re-run of test_runner.
  • Loading branch information
alees24 committed Oct 11, 2024
1 parent efc6e4d commit 91b891f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sw/cheri/tests/plic_tests.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ struct PlicTest {
if (plic_test->is_irq_clearable) {
uart->interruptState = plic_test->ip_irq_id;
} else {
uart->interrupt_disable(static_cast<OpenTitanUart::OpenTitanUartInterrupt>(plic_test->ip_irq_id));
// Ensure that the `intr_test` bit does not keep the Status-type interrupt asserted.
uart->interruptTest = 0;
}
uart->interrupt_disable(static_cast<OpenTitanUart::OpenTitanUartInterrupt>(plic_test->ip_irq_id));
};
uart->interrupt_enable(uartMap[i].first.id);
uart->interruptTest = ip_irq_id;
Expand Down Expand Up @@ -137,10 +137,10 @@ struct PlicTest {
if (plic_test->is_irq_clearable) {
i2c->interruptState = 0x1 << plic_test->ip_irq_id;
} else {
i2c->interrupt_disable(static_cast<OpenTitanI2cInterrupt>(plic_test->ip_irq_id));
// Ensure that the `intr_test` bit does not keep the Status-type interrupt asserted.
i2c->interruptTest = 0;
}
i2c->interrupt_disable(static_cast<OpenTitanI2cInterrupt>(plic_test->ip_irq_id));
};
i2c->interruptTest = 0x01 << ip_irq_id;
wfi();
Expand Down

0 comments on commit 91b891f

Please sign in to comment.