FormalTest

chisel3.FormalTest
object FormalTest

Attributes

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

Members list

Value members

Concrete methods

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

Mark a module as a formal test.

Mark a module as a formal test.

Other tools can use this information to, for example, collect all modules marked as formal tests and run formal verification on them. 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 formal test:

class TestHarness extends RawModule {
 FormalTest(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 {
 FormalTest(
   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