Scale

chisel3.simulator.scalatest.Cli.Scale
trait Scale

Adds -Dscale=<double>

This adds an option which can be used to control the "scaling factor" of the test. This option can be used by the test author to "scale" the test to make it longer or shorter.

This is inteded to be used with randomized testing or some testing which does not have a natural end point or an end point which may be dependent on execution context. E.g., you can use this to make a test which runs for briefly in a pre-merge Continuous Integration (CI) flow, but runs for much longer in nightly CI.

Note that the interpretation of the "scaling factor" is test dependent. In order to document this and help end users, this trait has an abstract member scaleHelpText which must be overridden to document what the scale affects in the test. E.g., if the scale is used to lengthen a test, a test author could write:

override protected def scaleHelpText = "scales the runtime of a test"

While this adds the low-level scale option. A user of this should use the member functions that this trait adds, e.d., scaled.

Attributes

Source
Cli.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Abstract methods

protected def scaleHelpText: String

Help text that describes what the -Dscale parameter does for this test.

Help text that describes what the -Dscale parameter does for this test.

This is used to populate the help text that an end user sees when invoking this test with -Dhelp=1.

Attributes

Source
Cli.scala

Concrete methods

final def scaled(a: Int): Int

Scale an integer by the scaling factor, if set.

Scale an integer by the scaling factor, if set.

If no scaling factor is set, this will scale by 1.0, i.e., the input is unchanged.

Attributes

Source
Cli.scala