-
Notifications
You must be signed in to change notification settings - Fork 458
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
Conversation
There was a problem hiding this 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.
debug/gdbserver.py
Outdated
# 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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
debug/gdbserver.py
Outdated
# Disable timer interrupt | ||
for hart in self.target.harts: | ||
self.gdb.select_hart(hart) | ||
self.gdb.interrupt() | ||
self.gdb.p("$mie=$mie & ~0x80") |
There was a problem hiding this comment.
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().
There was a problem hiding this comment.
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.
Signed-off-by: liangzhen <[email protected]>
Turn off the timer interrupt after the test case (such as InterruptTest) ends to avoid interference with other test cases.