SimulationTest

chisel3.SimulationTest

Attributes

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

Members list

Value members

Concrete methods

def apply(module: BaseModule & SimulationTestHarnessInterface, params: MapTestParam = ..., name: String = ...)(implicit sourceInfo: SourceInfo): Unit

Mark a module as a simulation test.

Mark a module as a simulation test.

Other tools can use this information to, for example, collect all modules marked as simulation tests and run them in a simulator. This is particularly useful in combination with the UnitTest trait.

Value parameters

module

The module to be marked.

name

Optional name for the test. Uses the module name by default.

params

Optional user-defined test parameters.

Attributes

Example

The following creates a module marked as a simulation test:

class TestHarness extends RawModule {
 SimulationTest(this)
}

Additional parameters may be passed to the test, which other tools may use to control how the test is interpreted or executed:

class TestHarness extends RawModule {
 SimulationTest(
   this,
   MapTestParam(Map(
     "a" -> IntTestParam(9001),
     "b" -> DoubleTestParam(13.37),
     "c" -> StringTestParam("hello"),
     "d" -> ArrayTestParam(Seq(
       IntTestParam(9001),
       StringTestParam("hello")
     )),
     "e" -> MapTestParam(Map(
       "x" -> IntTestParam(9001),
       "y" -> StringTestParam("hello"),
     ))
   ))
 )
}
Source
TestMarker.scala