get outmux test working with nose3
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 2 May 2019 23:29:21 +0000 (00:29 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 2 May 2019 23:29:21 +0000 (00:29 +0100)
src/nmutil/test/test_outmux_pipe.py

index 768d9d9a09e6efb1e76c2217e27d2e5192c8778e..9daffac9c8a39c459b3deae515e91adf5570d735 100644 (file)
@@ -61,10 +61,10 @@ class OutputTest:
             self.do[mid].append(data)
 
     def send(self):
-        for i in range(self.tlen * dut.num_rows):
+        for i in range(self.tlen * self.dut.num_rows):
             op2 = self.di[i][0]
             mid = self.di[i][1]
-            rs = dut.p
+            rs = self.dut.p
             yield rs.valid_i.eq(1)
             yield rs.data_i.data.eq(op2)
             yield rs.data_i.mid.eq(mid)
@@ -148,7 +148,7 @@ class TestSyncToPriorityPipe(Elaboratable):
         return res
 
 
-if __name__ == '__main__':
+def test1():
     dut = TestSyncToPriorityPipe()
     vl = rtlil.convert(dut, ports=dut.ports())
     with open("test_outmux_pipe.il", "w") as f:
@@ -160,3 +160,5 @@ if __name__ == '__main__':
                          test.send()],
                    vcd_name="test_outmux_pipe.vcd")
 
+if __name__ == '__main__':
+    test1()