Packages

  • package root

    This is the documentation for Chisel.

    This is the documentation for Chisel.

    Package structure

    The chisel3 package presents the public API of Chisel. It contains the concrete core types UInt, SInt, Bool, Clock, and Reg, the abstract types Bits, Aggregate, and Data, and the aggregate types Bundle and Vec.

    The Chisel package is a compatibility layer that attempts to provide chisel2 compatibility in chisel3.

    Utility objects and methods are found in the util package.

    The testers package defines the basic interface for chisel testers.

    Definition Classes
    root
  • package chiseltest

    ChiselTest Compatibility Layer for Chisel 7

    ChiselTest Compatibility Layer for Chisel 7

    This package provides a drop-in replacement for the ChiselTest library that was removed in Chisel 7. It preserves the familiar ChiselTest API while delegating to Chisel 7's ChiselSim underneath.

    Usage:

    import chiseltest._
    import org.scalatest.flatspec.AnyFlatSpec
    
    class MyTest extends AnyFlatSpec with ChiselScalatestTester {
      it should "work" in {
        test(new MyModule) { dut =>
          dut.io.in.poke(42.U)
          dut.clock.step()
          dut.io.out.expect(42.U)
        }
      }
    }

    Key Components: - testableData, testableUInt, testableBoolExt: Implicit conversions for poke/peek/expect - testableClock: Clock stepping and control - DecoupledIOOps: Utilities for Decoupled interface testing - ChiselScalatestTester: ScalaTest integration trait

    See README.md for detailed documentation.

    Definition Classes
    root
  • package formal

    Formal compatibility API placeholders.

    Formal compatibility API placeholders.

    Formal verification is currently unsupported in this compatibility layer. Any usage should fail at compile time to avoid vacuously passing tests.

  • ChiselScalatestTester
  • DecoupledDriver
  • DecoupledIOOps
  • ForkHandle
  • VerilatorBackendAnnotation
  • WriteVcdAnnotation
  • testableBoolExt
  • testableClock
  • testableData
  • testableReset
  • testableUInt
p

chiseltest

package chiseltest

ChiselTest Compatibility Layer for Chisel 7

This package provides a drop-in replacement for the ChiselTest library that was removed in Chisel 7. It preserves the familiar ChiselTest API while delegating to Chisel 7's ChiselSim underneath.

Usage:

import chiseltest._
import org.scalatest.flatspec.AnyFlatSpec

class MyTest extends AnyFlatSpec with ChiselScalatestTester {
  it should "work" in {
    test(new MyModule) { dut =>
      dut.io.in.poke(42.U)
      dut.clock.step()
      dut.io.out.expect(42.U)
    }
  }
}

Key Components: - testableData, testableUInt, testableBoolExt: Implicit conversions for poke/peek/expect - testableClock: Clock stepping and control - DecoupledIOOps: Utilities for Decoupled interface testing - ChiselScalatestTester: ScalaTest integration trait

See README.md for detailed documentation.

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. chiseltest
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package formal

    Formal compatibility API placeholders.

    Formal compatibility API placeholders.

    Formal verification is currently unsupported in this compatibility layer. Any usage should fail at compile time to avoid vacuously passing tests.

Type Members

  1. trait ChiselScalatestTester extends AnyRef

    ChiselTest-compatible API that delegates to ChiselSim (Chisel 7)

    ChiselTest-compatible API that delegates to ChiselSim (Chisel 7)

    This trait provides the ChiselTest API that users are familiar with from Chisel 6, but internally uses ChiselSim from Chisel 7 to perform the actual testing.

    VCD GENERATION SUPPORT: This compatibility layer supports VCD generation when WriteVcdAnnotation is used. VCD files are generated in: build/chiselsim/<timestamp>/workdir-verilator/trace.vcd

    AUTOMATIC RESET FEATURE: By default, this trait automatically resets the module before running tests, mimicking ChiselTest's behavior from Chisel 6.

    To disable auto-reset or customize the reset duration:

    class MyTest extends AnyFlatSpec with ChiselScalatestTester {
      override def autoResetEnabled: Boolean = false  // Disable auto-reset
      override def resetCycles: Int = 5               // Or change duration
    }

    Example usage with VCD:

    import chiseltest._
    import org.scalatest.flatspec.AnyFlatSpec
    
    class MyModuleSpec extends AnyFlatSpec with ChiselScalatestTester {
      behavior of "MyModule"
    
      it should "generate waveforms" in {
        test(new MyModule).withAnnotations(Seq(WriteVcdAnnotation)) { dut =>
          dut.io.in.poke(42.U)
          dut.clock.step()
          dut.io.out.expect(42.U)
        }
        // VCD file: build/chiselsim/<timestamp>/workdir-verilator/trace.vcd
      }
    }
  2. final class DecoupledDriver extends AnyRef

    Compatibility placeholder for ChiselTest's DecoupledDriver class.

    Compatibility placeholder for ChiselTest's DecoupledDriver class.

    Decoupled enqueue/dequeue helpers are provided via implicit extensions in package object chiseltest. Use import chiseltest._ to access: - enqueueNow, enqueueSeq - expectDequeueNow, expectDequeueSeq - initSource, initSink

  3. implicit final class DecoupledIOOps[T <: Data] extends AnyVal
  4. class ForkHandle extends AnyRef
  5. implicit final class testableBoolExt extends AnyVal
  6. implicit final class testableClock extends AnyVal
  7. implicit final class testableData[T <: Data] extends AnyVal
  8. implicit final class testableReset extends AnyVal
  9. implicit final class testableUInt extends AnyVal

Value Members

  1. def fork(body: => Unit): ForkHandle
  2. case object VerilatorBackendAnnotation extends Product with Serializable
  3. case object WriteVcdAnnotation extends Product with Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped