code comments
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 12 Sep 2021 13:24:00 +0000 (14:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 12 Sep 2021 13:24:00 +0000 (14:24 +0100)
src/soc/simple/test/test_core.py

index 0be2a292e8b0c7ab29e11474c24f764913d1fba0..0c7bda122366b44f8a3886bf853a2f98153db86d 100644 (file)
@@ -154,9 +154,12 @@ def teststate_check_regs(dut, states, test, code):
     to check if they have the same "state" (registers only, at the moment)
     """
     slist = []
+    # create one TestState per "thing"
     for stype, totest in states.items():
         state = yield from TestState(stype, totest, dut, code)
         slist.append(state)
+    # compare each "thing" against the next "thing" in the list.
+    # (no need to do an O(N^2) comparison here, they *all* have to be the same
     for i in range(len(slist)-1):
         state, against = slist[i], slist[i+1]
         state.compare(against)