Skip to content

Commit

Permalink
feat: check_for_err: show DMA halted/idle state
Browse files Browse the repository at this point in the history
Also check for errors when example demo finishes
  • Loading branch information
patrislav1 committed May 29, 2024
1 parent 02e9341 commit 254c178
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/demo_cpp/src/axi_dma_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char* argv[]) {
break;
}
}

axi_dma->check_for_errors();
traffic_gen->stop();

auto [counter_ok, counter_total] = fut.get();
Expand Down
8 changes: 8 additions & 0 deletions src/UioAxiDmaIf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ bool UioAxiDmaIf::check_for_errors() {
bool has_errors = false;

auto sr = s2mm_dmasr.rd();
if (sr.halted) {
BOOST_LOG_SEV(_lg, bls::warning) << "DMA Halted";
}

if (sr.idle) {
BOOST_LOG_SEV(_lg, bls::warning) << "DMA Idle";
}

if (sr.dma_int_err) {
has_errors = true;
BOOST_LOG_SEV(_lg, bls::fatal) << "DMA Internal Error";
Expand Down

0 comments on commit 254c178

Please sign in to comment.