# issue/valid/busy signalling
self.ivalid_i = self.pdecode2.e.valid # instruction is valid
self.issue_i = Signal(reset_less=True)
- self.busy_o = Signal(reset_less=True)
+ self.busy_o = Signal(name="corebusy_o", reset_less=True)
# instruction input
self.bigendian_i = self.pdecode2.dec.bigendian
# got the instruction: start issue
with m.State("INSN_READ"):
- sync += core_ivalid_i.eq(1) # say instruction is valid
- sync += core_issue_i.eq(1) # and issued (ivalid_i redundant)
- sync += core_be_i.eq(0) # little-endian mode
- sync += core_opcode_i.eq(current_insn) # actual opcode
+ comb += core_ivalid_i.eq(1) # say instruction is valid
+ comb += core_issue_i.eq(1) # and issued (ivalid_i redundant)
+ comb += core_be_i.eq(0) # little-endian mode
+ comb += core_opcode_i.eq(current_insn) # actual opcode
m.next = "INSN_ACTIVE" # move to "wait for completion" phase
# instruction started: must wait till it finishes
with m.State("INSN_ACTIVE"):
- sync += core_issue_i.eq(0) # issue raises for only one cycle
+ comb += core_ivalid_i.eq(1) # say instruction is valid
+ comb += core_opcode_i.eq(current_insn) # actual opcode
+ #sync += core_issue_i.eq(0) # issue raises for only one cycle
with m.If(~core_busy_o): # instruction done!
- sync += core_ivalid_i.eq(0) # say instruction is invalid
- sync += core_opcode_i.eq(0) # clear out (no good reason)
+ #sync += core_ivalid_i.eq(0) # say instruction is invalid
+ #sync += core_opcode_i.eq(0) # clear out (no good reason)
# ok here we are not reading the branch unit. TODO
# this just blithely overwrites whatever pipeline updated
# the PC
dut.assertEqual(e_ca, ca, "ca mismatch %s" % (repr(code)))
-def set_issue(core, dec2, sim):
- yield core.issue_i.eq(1)
- yield
- yield core.issue_i.eq(0)
+def wait_for_busy_hi(cu):
while True:
- busy_o = yield core.busy_o
+ busy_o = yield cu.busy_o
if busy_o:
break
print("!busy",)
yield
+def set_issue(core, dec2, sim):
+ yield core.issue_i.eq(1)
+ yield
+ yield core.issue_i.eq(0)
+ yield from wait_for_busy_hi(core)
+
def wait_for_busy_clear(cu):
while True:
if __name__ == "__main__":
unittest.main(exit=False)
suite = unittest.TestSuite()
- suite.addTest(TestRunner(LDSTTestCase.test_data))
- suite.addTest(TestRunner(CRTestCase.test_data))
- suite.addTest(TestRunner(ShiftRotTestCase.test_data))
- suite.addTest(TestRunner(LogicalTestCase.test_data))
+ #suite.addTest(TestRunner(LDSTTestCase.test_data))
+ #suite.addTest(TestRunner(CRTestCase.test_data))
+ #suite.addTest(TestRunner(ShiftRotTestCase.test_data))
+ #suite.addTest(TestRunner(LogicalTestCase.test_data))
suite.addTest(TestRunner(ALUTestCase.test_data))
- suite.addTest(TestRunner(BranchTestCase.test_data))
+ #suite.addTest(TestRunner(BranchTestCase.test_data))
runner = unittest.TextTestRunner()
runner.run(suite)
from soc.experiment.compalu_multi import find_ok # hack
from soc.simple.test.test_core import (setup_regs, check_regs,
- wait_for_busy_clear)
+ wait_for_busy_clear,
+ wait_for_busy_hi)
from soc.fu.compunits.test.test_compunit import (setup_test_memory,
check_sim_memory)
yield go_insn_i.eq(0) # and don't issue a new insn
# wait until executed
+ yield from wait_for_busy_hi(core)
yield from wait_for_busy_clear(core)
print ("sim", code)