-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(LogPerfHelper): reuse LogPerfHelper if visible #86
Open
klin02
wants to merge
1
commit into
master
Choose a base branch
from
log-reuse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−18
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
One question: after this change, the design will not be compatible with older versions of Chisel before v6.1.0. Is this accpepted by XiangShan and its submodules? @Tang-Haojin
Instead of calling
isVisible
here, I would prefer using Scala reflection to call the LogPerfControl in DiffTest. Only if that does not exist (the module using utility is not simulated by DiffTest), we use the one currently defined in utility. Then we don't need to copy the isVisible code here and the code would always align with DiffTest. I believe in the future, we will replace the one in DiffTest withtapAndRead
.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 is okay for XiangShan, but may be carefully checked for submodules.
I agree to use
tapAndRead
instead and actually I have tried it few months ago locally. I pushed it to our repositories just now. Maybe @klin02 can help me to review it and if you think it okay, you may also help to rebase it towards master.Here are the related repos and branches:
https://github.com/OpenXiangShan/XiangShan/tree/tap-and-read
https://github.com/OpenXiangShan/CoupledL2/tree/tap-and-read
https://github.com/OpenXiangShan/HuanCun/tree/tap-and-read
https://github.com/OpenXiangShan/Utility/tree/tap-and-read
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.
But
tapAndRead
also has some dedup issues so I write a transform to dedup manually.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.
Previously I also try to use tapAndRead for perfIO(Register source first and assign tap to sink somewhere). However, It brings a lot of middle ports like addSource and addSink.
I think that's because chisel use probe ports (can be seen in firrtl module ports) to implement tap. And output probe(child source to parent sink) can be replaced by hierarchical reference like aa.bb.cc, but input probe will still be generated as IOs.
Does current tap supports hidden middle IO?I also agree modified tap is better to logPerf.
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.
No, chisel still cannot generate non-hierarchical XMR in Verilog, and it generates IO ports. But I think it is okay.
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 can have a try for hierarchical name first. The problem is instance can only be accessed after elaboration.
If it works, maybe we can collect logPerf directly.
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 see. This is indeed a problem.
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.
Hierarchical name(for both data or module) can be accessed by xx.pathName after circuit elaboration ( Stage.execute), which means we may need another method called after elaboration, generating macros of hierarchical module name, is it acceptable?
Alternatively, during elaboration, we can get currentModule name up to top module name using recursive DataMirror.getParent. Like SimTop.Mod1.Mod2... instead of SimTop.Inst1.Inst2... But it may be mixed up with multi instances with same modName
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.
Seems ChiselDB and Constantin already have similar calling interface after elaboration like
addToFileRegisters
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 it's good. We can add this optional interface to difftest or utility, to be called after elaboration.