Skip to content

Commit

Permalink
Support limits_icount_to_one in IcountTest
Browse files Browse the repository at this point in the history
This is taking into account that the hardware limits count to 1.

Signed-off-by: liangzhen <[email protected]>
  • Loading branch information
lz-bro committed Oct 18, 2023
1 parent d020e20 commit 812f318
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2129,9 +2129,13 @@ def setup(self):
def test(self):
# Execute 2 instructions.
output = self.gdb.command("monitor riscv icount set m 2")
assertNotIn("Failed", output)
if self.target.limits_icount_to_one:
assertIn("Failed", output)
self.gdb.b("main_post_csrr")
else:
assertNotIn("Failed", output)
output = self.gdb.c()
assertIn("breakpoint", output)
assertIn("main_post_csrr", output)
main_post_csrr = self.gdb.p("&main_post_csrr")
assertEqual(self.gdb.p("$pc"), main_post_csrr)

Expand Down
3 changes: 3 additions & 0 deletions debug/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ class Target:
# Supports controlling hart availability through DMCUSTOM.
support_unavailable_control = False

# When true it indicates that the hardware limits icount set to 1
limits_icount_to_one = False

# Internal variables:
directory = None
temporary_files = []
Expand Down

0 comments on commit 812f318

Please sign in to comment.