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

Add configurable system bus access delay #1513

Merged
merged 3 commits into from
Dec 2, 2023
Merged

Add configurable system bus access delay #1513

merged 3 commits into from
Dec 2, 2023

Conversation

timsifive
Copy link
Collaborator

Add configurable SBA read/write delays with --dm-sba-write-busy and --dm-sba-read-busy. They default to no delay.

This lets me test OpenOCD behavior when this happens.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

I'm not wild about making this feature a part of mainline Spike, as it invites other timing-related features. Can you live with maintaining it on a branch that you use on occasion when changes are made to the relevant parts of OpenOCD?

@timsifive
Copy link
Collaborator Author

I guess I could do this on a branch, but it would be a branch we use for continuously regression testing OpenOCD. Relying on people to run some extra tests when they think they may have broken something is drastically less effective than simply getting as much coverage as is possible.

Presumably there is some way to use github actions to automate merging master into a test branch, but it sounds like a bunch of hassle to set up.

@aswaterman
Copy link
Collaborator

any thoughts @jerryz123 @scottj97?

@jerryz123
Copy link
Collaborator

Would it be reasonable to hard-code a fixed SBA delay? Does changing the delay values around substantially improve coverage of your tests?

@timsifive
Copy link
Collaborator Author

For test coverage hard coding the value is fine. But that does reduce performance if people are debugging with gdb and using system bus access for memory access. (By default system bus access is not used by gdb, but if you're using some different debugger then it's the only option that allows reading memory while the target is running.)

@aswaterman
Copy link
Collaborator

I don’t think perf of debugging a Spike target with SBA is a first-order constraint. I like Jerry’s idea if the coverage is good enough.

@timsifive
Copy link
Collaborator Author

OK. I'll remove the CLI options and hard-code the delay.

This is helpful to test OpenOCD behavior when sbbusyerror is set.
This is helpful to test OpenOCD behavior when sbbusyerror is set.
@timsifive
Copy link
Collaborator Author

I've hardcoded a reasonable delay for testing.

@aswaterman
Copy link
Collaborator

@jerryz123 OK with you, too?

@aswaterman aswaterman merged commit e46586e into master Dec 2, 2023
3 checks passed
@aswaterman aswaterman deleted the sbbusyerror branch December 2, 2023 01:49
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.

3 participants