Skip to content

Commit 254c178

Browse files
committed
feat: check_for_err: show DMA halted/idle state
Also check for errors when example demo finishes
1 parent 02e9341 commit 254c178

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

example/demo_cpp/src/axi_dma_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int main(int argc, char* argv[]) {
150150
break;
151151
}
152152
}
153-
153+
axi_dma->check_for_errors();
154154
traffic_gen->stop();
155155

156156
auto [counter_ok, counter_total] = fut.get();

src/UioAxiDmaIf.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ bool UioAxiDmaIf::check_for_errors() {
6262
bool has_errors = false;
6363

6464
auto sr = s2mm_dmasr.rd();
65+
if (sr.halted) {
66+
BOOST_LOG_SEV(_lg, bls::warning) << "DMA Halted";
67+
}
68+
69+
if (sr.idle) {
70+
BOOST_LOG_SEV(_lg, bls::warning) << "DMA Idle";
71+
}
72+
6573
if (sr.dma_int_err) {
6674
has_errors = true;
6775
BOOST_LOG_SEV(_lg, bls::fatal) << "DMA Internal Error";

0 commit comments

Comments
 (0)