Skip to content

Commit

Permalink
Let simulator return executed cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
wallento committed Jun 25, 2020
1 parent 4e993dc commit 534fc87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion riscvmodel/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ def load_data(self, data = "", *, address=0):

def run(self, *, pc=0):
self.model.reset(pc=pc)
cnt = 0
while True:
try:
self.model.issue(self.program[int(self.model.state.pc)>>2])
cnt += 1
except IndexError as e:
return
return cnt
return cnt

def dump_data(self, *, address=0, size=None):
data = b""
Expand Down

0 comments on commit 534fc87

Please sign in to comment.