Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable timer interrupt to fix some bugs #503

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

lz-bro
Copy link
Contributor

@lz-bro lz-bro commented Sep 26, 2023

Turn off the timer interrupt after the test case (such as InterruptTest) ends to avoid interference with other test cases.

Copy link
Collaborator

@timsifive timsifive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate you're looking at these tests.

Comment on lines 1042 to 1047
# Disable timer interrupt
for hart in self.target.harts:
self.gdb.select_hart(hart)
self.gdb.p("$mie")
self.gdb.p("$mie=$mie & ~0x80")
self.gdb.p("$mie")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this a helper function in GdbTest, and call that from the various places that need it?

You can probably remove the extra prints of $mie, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the changes as you suggested and conducted debug testing.

Comment on lines 1196 to 1200
# Disable timer interrupt
for hart in self.target.harts:
self.gdb.select_hart(hart)
self.gdb.interrupt()
self.gdb.p("$mie=$mie & ~0x80")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For more refactoring, can you make this a call to disable_timer() as well?

Probably you need a new interrupt=False argument to disable_timer(), and if it's True then it does the interrupt().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your suggestions are very helpful and I have adopted it.

@timsifive timsifive merged commit 34fb040 into riscv-software-src:master Oct 11, 2023
2 checks passed
@lz-bro lz-bro deleted the dis_timer branch January 23, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants