trait ChiselUtestTester extends TestSuite with TestEnvInterface
Using utest as test framework
// define test spec in trait trait HasTestChipSpec { import chisel3.tester._ def testChipSpec(dut: TestChip): Unit = { c => // body of the unit test, c is a reference c.io.input.poke(1.U) c.io.output.expect(2.U) } } object SomeCircuitSpecTester extends ChiselUtestTester with HasSomeCircuitSpec { // define test by Tests macro val tests: Tests = Tests { // invoke test with test(""){} test("comments or name to a test"){ // test function runs here testCircuit(new SomeCircuit, Seq(WriteVcdAnnotation))(SomeCircuitSpec) } } }
- Alphabetic
- By Inheritance
- ChiselUtestTester
- TestEnvInterface
- TestSuite
- TestSuiteVersionSpecific
- Executor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def tests: Tests
- Definition Classes
- TestSuite
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val batchedFailures: ArrayBuffer[Exception]
- Attributes
- protected
- Definition Classes
- TestEnvInterface
- def checkpoint(): Unit
If there are any failures, reports them and end the test now.
If there are any failures, reports them and end the test now.
- Definition Classes
- TestEnvInterface
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getExpectDetailedTrace(trace: Seq[StackTraceElement], inFile: String): String
- Attributes
- protected
- Definition Classes
- TestEnvInterface
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def signalExpectFailure(message: String): Unit
Adds a failure message with correct stack trace to the batched failures.
Adds a failure message with correct stack trace to the batched failures. Failures queued until the next checkpoint.
- Definition Classes
- TestEnvInterface
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def testCircuit[T <: Module](dutGen: => T, annotationSeq: AnnotationSeq = Seq.empty)(testFn: (T) => Unit)(implicit testPath: TestPath): TestResult
Since utest.test collides with chisel3.tester.RawTester.test, it is renamed to testCircuit, Here is a example to constructs a unit test harness for the Chisel Module PlusOne generated as dutGen.
Since utest.test collides with chisel3.tester.RawTester.test, it is renamed to testCircuit, Here is a example to constructs a unit test harness for the Chisel Module PlusOne generated as dutGen.
testCircuit(new PlusOne) { c => // body of the unit test, c is a a reference c.io.input.poke(1.U) c.io.output.expect(2.U) }
If you need to add your own AnnotationSeq to this test, you can add it as second parameter.
For example:
// WriteVcdAnnotation will ask backend export VCD file testCircuit(new PlusOne, Seq(WriteVcdAnnotation)) { c => // body of the unit test, c is a a reference c.io.input.poke(1.U) c.io.output.expect(2.U) }
- T
The DUT type, must be a subclass of Module
- dutGen
A generator of a Chisel Module
- Note
This API is experimental and forward compatibility is not yet guaranteed
- def testerFail(msg: String): Unit
Logs a tester failure at this point.
Logs a tester failure at this point. Failures queued until the next checkpoint.
- Definition Classes
- TestEnvInterface
- def toString(): String
- Definition Classes
- AnyRef → Any
- val topFileName: Option[String]
- Definition Classes
- ChiselUtestTester → TestEnvInterface
- def utestAfterAll(): Unit
- Definition Classes
- Executor
- def utestAfterEach(path: Seq[String]): Unit
- Definition Classes
- Executor
- def utestBeforeEach(path: Seq[String]): Unit
- Definition Classes
- Executor
- def utestFormatter: Formatter
- Definition Classes
- ChiselUtestTester → TestSuite
- def utestWrap(path: Seq[String], runBody: => Future[Any])(implicit ec: ExecutionContext): Future[Any]
- Definition Classes
- Executor
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])