-
Notifications
You must be signed in to change notification settings - Fork 637
[chiselsim] Allow command line options to be passed to ChiselSim tests #4773
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
Conversation
Testing this a bit more, I may need another approach as the |
I was able to workaround this problem with #4774. That provides the ability to get a new |
Add a new, stackable trait called `HasConfigMap` which exposes Scalatest's `configMap` [[1]] in an easy-to-use way. This allows for users to pass arguments on the command line to Scalatest via the `-D<key>=<foo>` option and have access to them in a `Map[String, Any]` in their test. While I am generally not hugely in favor of this pattern, as it can be abused to make tests pass or fail via options when I would prefer that tests were self-contained, there are some internal usages of this for doing things like changing the simulator, turning on waveforms, or extending the length of randomized testing. Given that, it's a useful feature to have and I would prefer if users went rolling their own solutions to this. [1]: https://www.scalatest.org/scaladoc/3.1.0/org/scalatest/ConfigMap.html Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Add a `configMap` to all `ChiselSim` tests so that users have a mechanism to get `-D<key>=<value>` command line options to their tests. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
/easycla |
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.
LGTM but a couple of suggestions
943e726
to
ef325d3
Compare
This is three commits that should be reviewed independently. This builds towards and then adds a
HasConfigMap
trait which allows for-D<key>=<value>
options to be exposed tochisel3.simulator.scalatest.ChiselTest
. In order to do this, and without starting to add functionality directly toChiselSim
, the existingTestingDirectory
trait is refactored to be made stackable.Release Notes
Add the ability for users to pass command-line options, via
-D<key>=<value>
, to anychisel3.simulator.scalatest.ChiselTest
test for them to customize the execution of the test.