From 203726bc03bdd4389ef12e7ab4792be7d7970f59 Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Fri, 27 Oct 2023 13:05:14 +1100 Subject: [PATCH] test_csr: test cases for issue 'status' reads as 0 in simulation when CSRStatus has fields. --- test/test_csr.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_csr.py b/test/test_csr.py index 92b08ef35..c86e2350b 100644 --- a/test/test_csr.py +++ b/test/test_csr.py @@ -116,10 +116,17 @@ class TestCSR(unittest.TestCase): self.assertEqual((yield dut._storage.fields.foo), 0xa) self.assertEqual((yield dut._storage.fields.bar), 0x5a) self.assertEqual((yield dut._storage.storage), 0x5a000a) + self.assertEqual((yield from dut._storage.read()), 0x5a000a) yield yield self.assertEqual((yield dut._status.fields.foo), 0xa) self.assertEqual((yield dut._status.fields.bar), 0x5a) + try: + self.assertEqual((yield dut._status.status), 0x5a000a) + self.assertEqual((yield from dut._status.read()), 0x5a000a) + except self.failureException as exc: + print("Skipping:" + repr(exc)) + raise self.skipTest("skip known failure") from None class DUT(Module): def __init__(self):