Minor changes to alu_hier.py to allow it to be used in proof
authorMichael Nolan <mtnolan2640@gmail.com>
Mon, 25 May 2020 18:10:54 +0000 (14:10 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Mon, 25 May 2020 18:10:54 +0000 (14:10 -0400)
src/soc/experiment/alu_hier.py

index 04ecfa366461dcc1374fd0e672c271512d114055..23c60100c2fb41ac0bff3ef8f85cfe508d82d9c9 100644 (file)
@@ -120,7 +120,7 @@ class DummyALU(Elaboratable):
                 # we didn't say "ready" yet, so say so and initialise
                 m.d.sync += self.p.ready_o.eq(1)
 
-                m.d.sync += self.o.eq(self.i.a)
+                m.d.sync += self.o.eq(self.a)
                 m.d.comb += go_now.eq(1)
                 m.d.sync += self.counter.eq(1)
 
@@ -367,8 +367,8 @@ def run_op(dut, a, b, op, inv_a=0):
     yield
     while True:
         yield
-        dut.n.valid_o = yield dut.n.valid_o
-        if dut.n.valid_o:
+        vld = yield dut.n.valid_o
+        if vld:
             break
     yield
 
@@ -396,7 +396,7 @@ def alu_sim(dut):
 
 def test_alu():
     alu = ALU(width=16)
-    run_simulation(alu, alu_sim(alu), vcd_name='test_alusim.vcd')
+    run_simulation(alu, {"sync": alu_sim(alu)}, vcd_name='test_alusim.vcd')
 
     vl = rtlil.convert(alu, ports=alu.ports())
     with open("test_alu.il", "w") as f:
@@ -406,8 +406,8 @@ def test_alu():
 if __name__ == "__main__":
     test_alu()
 
-    alu = BranchALU(width=16)
-    vl = rtlil.convert(alu, ports=alu.ports())
-    with open("test_branch_alu.il", "w") as f:
-        f.write(vl)
+    alu = BranchALU(width=16)
+    vl = rtlil.convert(alu, ports=alu.ports())
+    with open("test_branch_alu.il", "w") as f:
+        f.write(vl)