Add force jump when PC exception occurs in Trace branch

This commit is contained in:
Miical 2024-09-14 18:27:36 +08:00
parent 08d78d15b4
commit 44851f1b35
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ class Executor:
inst_len = self._current_branch["pc"] - self._current_pc
self._current_pc = self._current_branch["pc"]
elif (self._current_branch["pc"] == self._current_pc):
elif (self._current_branch["pc"] <= self._current_pc):
# When current pc < next branch pc, force to execute next branch
inst_len = Executor.branch_inst_len(self._current_branch)
self._current_pc = self._current_branch["target"] if self._current_branch["taken"] \
else self._current_pc + inst_len