Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 L1 Benchmarking #1
base: master
Are you sure you want to change the base?
Add L1 Benchmarking #1
Changes from 18 commits
55365ed
284dabe
afa397a
60aef70
a1338a5
7e529e2
16d82c6
a2402d9
d500223
8220621
67b14f1
e5e981c
7715229
c8b36e4
fb3174d
0dc6bf0
94d31cc
0707243
db320de
65307dd
5115d59
3d90bde
ddfcafd
1db88dc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 try to use python's argparse thing? https://docs.python.org/3/library/argparse.html
Notably, it lets you specify a "help" message, and makes it easier to add more arguments down the line.
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 think its easier to convert to float with
float(misses_prevented)
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.
Nit: This is relatively brittle. What happens if the config you build has other printfs inside it that have
Resp/Snoop
in it. IMO you should use Pythonre
to create a regex match.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.
Nit: I would shift the
int()
casting to be right when you access the string (i.e.resp_cycles = int(resp[1])
)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.
How did you determine 5/3 as the consts here? I would add a small comment here for other code readers.
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.
Make this pythonic:
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.
Nit: Depending on where this script is run the
../../../
may not lead where you expect. Here is an example of having this work in all cases:https://github.com/ucb-bar/chipyard/blob/dcf8da4b2d3a4deead95462fce36a6db5693ed45/scripts/build-toolchains.sh#L9-L18
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 don't think this file should be committed to this repo, as
Prefetch2SaturnConfig
andPassthroughPrefetchSaturnConfig
aren't defined for most people.Really its just wrapping
python3 L1-benchmarking.py <path-to-prefetch.out> <path-to-no-prefetch.out>
.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 think an option is to give as the arguments two configs that are compared against one another. Then it is up to the script caller to give two configs that are roughly equiv.
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.
Instead of using a statically assigned boolean to control printing, this should be enabled by a
plusArg
.Then when running the sim just set
EXTRA_SIM_FLAGS=+prefetcher_print_stats=1
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.
Leave the original block, and add a separate block for the prefetch print statements, gated by a config option.
You'll need to add a new parameter
printPrefetcherStats
to the config classWithHellaCachePrefetcher
,HellaCachePrefetchWrapperFactory.apply
, andHellaCachePrefetchWrapper
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.
Instead of having
Prefetch Addr, Snoop Addr, Resp Addr, Prefetch Resp Addr
, I suggest you remove the spaces to havePrefetchAddr, SnoopAddr, RespAddr, PrefetchRespAddr
. This makes your parsing in the python script uniform for all the cases.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.
This also (marginally) speeds up simulation since prints are semi-costly.
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.
If you don't want a person to read this output and instead have the script parse/understand it only, you can simplify this to print a bit faster (i.e. a schema like "type, addr, cycle")