replace sim._state.timeline.now with sim._engine.now
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 17 Sep 2020 21:30:36 +0000 (14:30 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 17 Sep 2020 21:30:36 +0000 (14:30 -0700)
src/soc/fu/div/test/helper.py
src/soc/fu/div/test/test_fsm.py

index 4c6bb5a7f51d11582a92197207d57d9f7c694386..d9c8a718721569d80890d91b28b387bd43d2d052 100644 (file)
@@ -139,10 +139,10 @@ class DivTestHelper(unittest.TestCase):
             while not vld:
                 yield
                 yield Delay(0.1e-6)
-                # XXX sim._state is an internal variable
+                # XXX sim._engine is an internal variable
                 # Waiting on https://github.com/nmigen/nmigen/issues/443
                 try:
-                    print(f"time: {sim._state.timeline.now * 1e6}us")
+                    print(f"time: {sim._engine.now * 1e6}us")
                 except AttributeError:
                     pass
                 vld = yield alu.n.valid_o
@@ -167,10 +167,10 @@ class DivTestHelper(unittest.TestCase):
                 print("")
 
             yield Delay(0.1e-6)
-            # XXX sim._state is an internal variable
+            # XXX sim._engine is an internal variable
             # Waiting on https://github.com/nmigen/nmigen/issues/443
             try:
-                print(f"check time: {sim._state.timeline.now * 1e6}us")
+                print(f"check time: {sim._engine.now * 1e6}us")
             except AttributeError:
                 pass
             msg = "%s: %s" % (div_pipe_kind.name, code)
index fce8418bbf8272cdbecbcb9faacda350d97285ca..f18d5d7e41c269adc2da8649cc736293c1ba0dbc 100644 (file)
@@ -235,8 +235,8 @@ class TestDivState(unittest.TestCase):
                 try:
                     # FIXME(programmerjake): replace with public API
                     # see https://github.com/nmigen/nmigen/issues/443
-                    now = sim._state.timeline.now
-                except KeyError:
+                    now = sim._engine.now
+                except AttributeError:
                     pass
                 if divisor != 0:
                     quotient = dividend // divisor