Skip to content

Commit

Permalink
[sw/example] add SLINK routing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed May 21, 2024
1 parent d04f154 commit 599b7dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sw/example/processor_check/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ int main() {
neorv32_cpu_csr_write(CSR_MIE, 1 << SLINK_RX_FIRQ_ENABLE);

// send RX_FIFO/2 data words
neorv32_slink_set_dst(0b1010);
for (tmp_b=0; tmp_b<(tmp_a/2); tmp_b++) {
neorv32_slink_put_last(0xAABBCCDD); // mark as end-of-stream
}
Expand All @@ -1592,6 +1593,7 @@ int main() {
if ((neorv32_cpu_csr_read(CSR_MCAUSE) == SLINK_RX_TRAP_CODE) && // correct trap code
(neorv32_slink_rx_status() == SLINK_FIFO_HALF) && // RX FIFO is at least half full
(neorv32_slink_get() == 0xAABBCCDD) && // correct RX data
(neorv32_slink_get_src() == 0b1010) && // correct routing information
(neorv32_slink_check_last())) { // is marked as "end of stream"
test_ok();
}
Expand Down Expand Up @@ -1621,6 +1623,7 @@ int main() {
neorv32_cpu_csr_write(CSR_MIE, 1 << SLINK_TX_FIRQ_ENABLE);

// send single data word
neorv32_slink_set_dst(0b1100);
neorv32_slink_put(0x11223344);

// wait for interrupt
Expand All @@ -1633,6 +1636,7 @@ int main() {
if ((neorv32_cpu_csr_read(CSR_MCAUSE) == SLINK_TX_TRAP_CODE) && // correct trap code
(neorv32_slink_tx_status() == SLINK_FIFO_EMPTY) && // TX FIFO is empty
(neorv32_slink_get() == 0x11223344) && // correct RX data
(neorv32_slink_get_src() == 0b1100) && // correct routing information
(neorv32_slink_check_last() == 0)) { // is NOT marked as "end of stream"
test_ok();
}
Expand Down

0 comments on commit 599b7dd

Please sign in to comment.