-
Notifications
You must be signed in to change notification settings - Fork 647
Add ChiselSim Settings.defaultTest for SimulationTestHarnessInterface modules #5192
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 ChiselSim Settings.defaultTest for SimulationTestHarnessInterface modules #5192
Conversation
| elaboratedModule: ElaboratedModule[A] | ||
| ) = { | ||
| val port = elaboratedModule.portMap(get(elaboratedModule.wrapped)).name | ||
| val port = lookupSignal(get(elaboratedModule.wrapped), elaboratedModule) |
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 guess this is technically a behavior change. Lmk if you'd like me to land this separately @jackkoenig.
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.
It's more of a bugfix than behavior change, but it's fine.
| chiselOpts: Array[String] = Array.empty, | ||
| firtoolOpts: Array[String] = Array.empty, | ||
| settings: Settings[T] = Settings.defaultRaw[T], | ||
| settings: Settings[T] = Settings.defaultTest[T], |
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.
Behavior change here 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.
This I missed, what's the change in behavior?
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.
Before this PR, STOP_COND, PRINTF_COND, etc. will not be set due to the use of defaultRaw. Now, they will be set to !init. As you point out, maybe a this is more of a bug fix than a behavior change but I feel like the the line is blurry 😄
jackkoenig
left a comment
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.
Nice tests and good catch with the view support.
| io.Source | ||
| .fromFile( | ||
| FileSystems | ||
| .getDefault() | ||
| .getPath(implicitly[HasTestingDirectory].getDirectory.toString, "workdir-verilator", "Makefile") | ||
| .toFile | ||
| ) | ||
| .mkString | ||
| .fileCheck()( |
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.
A nit but,
FilesSystems.getDefault().getPath is the same as just Paths.get and I think the latter is much nicer generally speaking.
The split line is also a bit ugly, I'd use a val for the makefile path and this should be a lot simpler:
| io.Source | |
| .fromFile( | |
| FileSystems | |
| .getDefault() | |
| .getPath(implicitly[HasTestingDirectory].getDirectory.toString, "workdir-verilator", "Makefile") | |
| .toFile | |
| ) | |
| .mkString | |
| .fileCheck()( | |
| val makefile = Paths.get(implicitly[HasTestingDirectory].getDirectory.toString, "workdir-verilator", "Makefile") | |
| io.Source.fromFile(makefile).mkString.fileCheck()( |
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.
After writing this comment, I see that it follows the style of the rest of the file. So I think it's fine, but consider yourself on notice @seldridge 👀
|
Whoops look like some Scala 3-related changes have landed since I branch. Will fix those. EDIT: Nvm, just missing fields in Settings. |
Contributor Checklist
docs/src?Type of Improvement
Desired Merge Strategy
Release Notes
Settings.defaultTest[A <: RawModule with SimulationTestHarnessInterface]. This is useful for specifyingSTOP_COND,ASSERT_VERBOSE_COND, andPRINTF_CONDautomatically for simulations of aSimulationTestHarnessInterfacemodule.Reviewer Checklist (only modified by reviewer)
3.6.x,5.x, or6.xdepending on impact, API modification or big change:7.0)?Enable auto-merge (squash)and clean up the commit message.Create a merge commit.