From 5ae098ebc613d7513c7b1cdfdb4f3539d69f1e9d Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Fri, 5 Apr 2024 12:29:51 +1100 Subject: [PATCH] test/spi_mmap: be less verbose don't print miso/mosi changes with -v --- test/test_spi_mmap.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/test_spi_mmap.py b/test/test_spi_mmap.py index dc8c705e1..f4d36eeb4 100644 --- a/test/test_spi_mmap.py +++ b/test/test_spi_mmap.py @@ -50,6 +50,14 @@ def vprint(*args): print(*args) +def vvprint(*args): + global verbose + if verbose is None: + verbose = unittest_verbosity() + if verbose > 2: + print(*args) + + class TestSPIMMAP(unittest.TestCase): def test_spi_master(self): pads = Record([("clk", 1), ("cs_n", 4), ("mosi", 1), ("miso", 1)]) @@ -219,9 +227,9 @@ class TestSPIMMAP(unittest.TestCase): if tx_empty != (tx_empty := (yield dut_tx_status.empty)): vprint(f"tx_empty:{tx_empty}") if mosi != (mosi := (yield dut.tx_rx_engine.spi.mosi)): - vprint(f"mosi => {mosi:0{width}x}") + vvprint(f"mosi => {mosi:0{width}x}") if miso != (miso := (yield dut.tx_rx_engine.spi.miso)): - vprint(f"miso <= {miso:0{width}x}") + vvprint(f"miso <= {miso:0{width}x}") yield yield