From ef78c48a8a39a1fac83d7833db5fdfdd989ecf52 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Tue, 30 May 2023 12:29:18 +0100 Subject: [PATCH] Add info to testbench debug output --- test_saw2sin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test_saw2sin.py b/test_saw2sin.py index 7941e84..a4cac2a 100644 --- a/test_saw2sin.py +++ b/test_saw2sin.py @@ -12,9 +12,10 @@ async def test_new_cordic(dut): await Timer(1, units='ps') e_sin = 32768 * (sin((cycle * pi) / (2**15)) + 1) error = e_sin - dut.o_sin.value - if abs(error) > 4: - dut._log.info("cycle %d: expected %d, got %d, error %d" - % (cycle, e_sin, dut.o_sin.value, error)) + if abs(error) > 2: + dut._log.info("cycle %5d, rev %d, inv %d, expected %5d, got %5d, error %d" + % (cycle, (cycle & 0x4000) != 0, (cycle & 0x8000) != 0, e_sin, dut.o_sin.value, error)) diff += abs(error) dut._log.info("Testbench finished, average error %f" % (diff / 65536)) +