from collections import OrderedDict
from nmigen import *
+from nmigen.asserts import Assert, Assume
from nmigen.hdl.rec import *
from nmigen.utils import log2_int
m.d.sync += count.eq(count-1)
with m.If(count == 1):
m.d.sync += self.ready.eq(1)
+
+ if platform == "formal":
+ if self._txxd is not None and self._txxd > 0:
+ hasSeenValid = Signal()
+ with m.If(self.valid):
+ m.d.sync += hasSeenValid.eq(1)
+
+ m.d.sync += Assert((hasSeenValid & (count == 0)).implies(self.ready == 1))
+
return m
+#nmigen: UnusedElaboratable=no
from nmigen import *
from nmigen.hdl.ast import Past
-from gram.common import DQSPattern
+from gram.common import DQSPattern, tXXDController
from utils import *
class DQSPatternTestCase(FHDLTestCase):
self.assertEqual((yield dut.o), 0b01010101)
runSimulation(m, process, "test_dqspattern_async.vcd")
+
+class tXXDControllerTestCase(FHDLTestCase):
+ def test_formal(self):
+ def generic_test(txxd):
+ dut = tXXDController(txxd)
+ self.assertFormal(dut, mode="bmc", depth=4)
+
+ generic_test(None)
+ generic_test(0)
+ generic_test(1)
+ generic_test(5)
+ generic_test(10)
\ No newline at end of file