from soc.decoder.decode2execute1 import Data
from soc.experiment.l0_cache import TstL0CacheBuffer # test only
from soc.config.test.test_loadstore import TestMemPspec
+from soc.decoder.power_enums import InternalOp
import operator
# start/stop signalling
with m.If(self.core_start_i):
- m.d.sync += core_stopped.eq(1)
- with m.If(self.core_stop_i):
m.d.sync += core_stopped.eq(0)
+ with m.If(self.core_stop_i):
+ m.d.sync += core_stopped.eq(1)
m.d.comb += self.core_terminated_o.eq(core_stopped)
# connect up Function Units, then read/write ports
# run this FunctionUnit if enabled, except if the instruction
# is "attn" in which case we HALT.
with m.If(enable):
- with m.If(dec2.e.op.internal_op == InternalOp.OP_ATTN):
+ with m.If(dec2.e.do.insn_type == InternalOp.OP_ATTN):
# check for ATTN: halt if true
m.d.sync += core_stopped.eq(1)
with m.Else():
from soc.fu.branch.test.test_pipe_caller import BranchTestCase
from soc.fu.spr.test.test_pipe_caller import SPRTestCase
from soc.fu.ldst.test.test_pipe_caller import LDSTTestCase
-from soc.simulator.test_sim import GeneralTestCases
+from soc.simulator.test_sim import (GeneralTestCases, AttnTestCase)
def setup_i_memory(imem, startaddr, instructions):
pdecode2 = core.pdecode2
l0 = core.l0
- # get core going
- yield core.core_start_i.eq(1)
- yield
- yield core.core_start_i.eq(0)
-
comb += issuer.pc_i.data.eq(pc_i)
comb += issuer.go_insn_i.eq(go_insn_i)
def process():
for test in self.test_data:
+
+ # get core going
+ yield core.core_start_i.eq(1)
+ yield
+ yield core.core_start_i.eq(0)
+ yield Settle()
+
print(test.name)
program = test.program
self.subTest(test.name)
yield
yield issuer.pc_i.ok.eq(0) # don't change PC from now on
yield go_insn_i.eq(0) # and don't issue a new insn
+ yield Settle()
# wait until executed
yield from wait_for_busy_hi(core)
# Memory check
yield from check_sim_memory(self, l0, sim, code)
+ terminated = yield core.core_terminated_o
+ if terminated:
+ break
+
sim.add_sync_process(process)
with sim.write_vcd("issuer_simulator.vcd",
traces=[]):
if __name__ == "__main__":
unittest.main(exit=False)
suite = unittest.TestSuite()
- suite.addTest(TestRunner(GeneralTestCases.test_data))
+ suite.addTest(TestRunner(AttnTestCase.test_data))
+ #suite.addTest(TestRunner(GeneralTestCases.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(ALUTestCase.test_data))
#suite.addTest(TestRunner(BranchTestCase.test_data))
#suite.addTest(TestRunner(SPRTestCase.test_data))