From 3d734a67e22497a583fb7998038f24a15809354c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Wed, 11 Sep 2024 18:47:33 -0300 Subject: [PATCH] decode-reg: fix misleading pos_calc output. Using the decode mode with pos_calc::Core would print register fields belonging to the amplitude FIFO (both status and values), but read from zeroed-out memory, instead of from the hardware. Beyond being misleading, it's incomplete information. Therefore, we force the core to read amplitude FIFO information from the hardware. --- app/decode-reg.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/decode-reg.cc b/app/decode-reg.cc index 386ea8a..bb933cf 100644 --- a/app/decode-reg.cc +++ b/app/decode-reg.cc @@ -241,6 +241,14 @@ int main(int argc, char *argv[]) } dec->get_data(); + + if (type == "pos_calc") { + /* force module to actually read these registers */ + auto dec_pos_calc = dynamic_cast(dec.get()); + dec_pos_calc->fifo_empty(); + dec_pos_calc->get_fifo_amps(); + } + dec->print(stdout, verbose); } while (watch); } else {