debugging termination (OP_ATTN)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 7 Jul 2020 15:02:24 +0000 (16:02 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 7 Jul 2020 15:02:24 +0000 (16:02 +0100)
src/soc/decoder/power_decoder2.py
src/soc/simple/test/test_core.py
src/soc/simple/test/test_issuer.py

index 45b60fb9da2fa2a81abee144c9f4f28da86bbd8e..4f814cf7caa00daf11c13f941a5c69ac7014ed3d 100644 (file)
@@ -588,8 +588,11 @@ class PowerDecode2(Elaboratable):
         # set up instruction, pick fn unit
         comb += e.nia.eq(0)    # XXX TODO (or remove? not sure yet)
         fu = op.function_unit
-        itype = Mux(fu == Function.NONE, InternalOp.OP_ILLEGAL, op.internal_op)
-        comb += do.insn_type.eq(itype)
+        with m.If((fu == Function.NONE) |
+                   (op.internal_op == InternalOp.OP_ATTN)):
+            comb += do.insn_type.eq(op.internal_op)
+        with m.Else():
+            comb += do.insn_type.eq(InternalOp.OP_ILLEGAL)
         comb += do.fn_unit.eq(fu)
 
         # registers a, b, c and out and out2 (LD/ST EA)
index 6e2ab94c8f100baed038fd39bfedc6779aac0daa..6944554807b18e7aa5a2afb6ed37018798d1ccfb 100644 (file)
@@ -149,7 +149,9 @@ def set_issue(core, dec2, sim):
 def wait_for_busy_clear(cu):
     while True:
         busy_o = yield cu.busy_o
-        if not busy_o:
+        terminated_o = yield cu.core_terminated_o
+        if not busy_o or terminated_o:
+            print("busy/terminated:", busy_o, terminated_o)
             break
         print("busy",)
         yield
index 8b80613b61cef699c49bea3d084d71f8e21cc4d9..e679fcd2a2197df36e42d840eb1d783078ecfec9 100644 (file)
@@ -140,6 +140,9 @@ class TestRunner(FHDLTestCase):
                     yield from wait_for_busy_hi(core)
                     yield from wait_for_busy_clear(core)
 
+                    terminated = yield core.core_terminated_o
+                    print ("terminated", terminated)
+
                     print ("sim", code)
                     # call simulated operation
                     opname = code.split(' ')[0]