class GenericBackend[T <: Module] extends BackendInstance[T] with ThreadedBackend[T]
Chiseltest threaded backend using the generic SimulatorContext abstraction from chiseltest.simulator
- Alphabetic
- By Inheritance
- GenericBackend
- ThreadedBackend
- BackendInstance
- BackendInterface
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new GenericBackend(dut: T, dataNames: Map[Data, String], combinationalPaths: Map[Data, Set[Data]], tester: SimulatorContext, coverageAnnotations: AnnotationSeq)
Type Members
- sealed abstract class BaseTimescope extends AnyRef
- Definition Classes
- ThreadedBackend
- sealed trait HasOverridingPokes extends BaseTimescope
- Definition Classes
- ThreadedBackend
- sealed trait HasParent extends BaseTimescope
- Definition Classes
- ThreadedBackend
- case class PeekRecord(timescope: Timescope, time: TimeRegion, actionId: Int, deps: Map[Data, Option[Timescope]], trace: Throwable) extends Product with Serializable
- Definition Classes
- ThreadedBackend
- case class PokeRecord(time: TimeRegion, actionId: Int, value: BigInt, trace: Throwable) extends Product with Serializable
- Definition Classes
- ThreadedBackend
- class RootTimescope extends BaseTimescope with HasOverridingPokes
- Definition Classes
- ThreadedBackend
- class TesterThread extends AbstractTesterThread
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- case class ThreadRootTimescope(parentTimescope: BaseTimescope, openedTime: TimeRegion, parentActionId: Int, thread: TesterThread) extends BaseTimescope with HasParent with Product with Serializable
- Definition Classes
- ThreadedBackend
- case class TimeRegion(timeslot: Int, region: Region) extends Product with Serializable
- Definition Classes
- ThreadedBackend
- class Timescope extends BaseTimescope with HasOverridingPokes with HasParent
- Definition Classes
- ThreadedBackend
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 clockCounter: HashMap[Clock, Int]
- Attributes
- protected
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def closeTimescope(timescope: Timescope): Map[Data, Option[BigInt]]
Closes the specified timescope, returns a map of wires to values of any signals that need to be updated.
Closes the specified timescope, returns a map of wires to values of any signals that need to be updated.
- Definition Classes
- ThreadedBackend
- val combinationalPaths: Map[Data, Set[Data]]
- Definition Classes
- GenericBackend → ThreadedBackend
- val currentThread: Option[TesterThread]
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- def currentTime: TimeRegion
- Definition Classes
- ThreadedBackend
- val currentTimestep: Int
- Definition Classes
- ThreadedBackend
- val dataNames: Map[Data, String]
- def debugLog(str: => String): Unit
- def doFork(runnable: () => Unit, name: Option[String], region: Option[Region]): TesterThread
- Definition Classes
- ThreadedBackend → BackendInterface
- def doJoin(threads: Seq[AbstractTesterThread], stepAfter: Option[Clock]): Unit
- Definition Classes
- ThreadedBackend → BackendInterface
- def doPeek(signal: Data, trace: Throwable): Unit
Logs a peek operation for later checking.
Logs a peek operation for later checking.
- Definition Classes
- ThreadedBackend
- def doPoke(signal: Data, value: BigInt, trace: Throwable): Unit
Logs a poke operation for later checking.
Logs a poke operation for later checking. Returns whether to execute it, based on priorities compared to other active pokes.
- Definition Classes
- ThreadedBackend
- def doTimescope(contents: () => Unit): Unit
- Definition Classes
- GenericBackend → BackendInterface
- val driverSemaphore: Semaphore
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- val dut: T
- Definition Classes
- GenericBackend → ThreadedBackend
- 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 getClock(clk: Clock): Boolean
- Attributes
- protected
- def getClockCycle(clk: Clock): Int
- Attributes
- protected
- def getModule: T
- def getParentTraceElements: Seq[StackTraceElement]
Returns the stack trace elements of parent threads.
Returns the stack trace elements of parent threads. If currently in the root thread, returns empty. TODO: refactor this, figure out how to do this in a structurally cleaner way
- Definition Classes
- ThreadedBackend → BackendInterface
- def getSinkClocks(signal: Data): Set[Clock]
Returns set of clocks associated with sinks of the signal
Returns set of clocks associated with sinks of the signal
- Definition Classes
- GenericBackend → BackendInterface
- def getSourceClocks(signal: Data): Set[Clock]
Returns set of clocks associated with sources of the signal
Returns set of clocks associated with sources of the signal
- Definition Classes
- GenericBackend → BackendInterface
- def getVar(key: Any): Option[Any]
Returns the value associated with the key in a per-test map.
Returns the value associated with the key in a per-test map.
- Definition Classes
- BackendInterface
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val idleCycles: Map[Clock, Int]
- Definition Classes
- ThreadedBackend
- val idleLimits: Map[Clock, Int]
- Definition Classes
- ThreadedBackend
- val interruptedException: ConcurrentLinkedQueue[Throwable]
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val lastClockValue: HashMap[Clock, Boolean]
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newTimescope(): Timescope
Creates a new timescope in the current thread.
Creates a new timescope in the current thread.
- Definition Classes
- ThreadedBackend
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def peekBits(signal: Data): BigInt
Returns the current value on a wire.
Returns the current value on a wire. Returns the current combinational value (after previous pokes have taken effect).
- Definition Classes
- GenericBackend → BackendInterface
- def peekClock(signal: Clock): Boolean
Read the value of a clock.
Read the value of a clock.
- Definition Classes
- GenericBackend → BackendInterface
- def pokeBits(signal: Data, value: BigInt): Unit
Writes a value to a writable wire.
Writes a value to a writable wire. Throws an exception if write is not writable.
- Definition Classes
- GenericBackend → BackendInterface
- def pokeClock(signal: Clock, value: Boolean): Unit
Writes a value to a clock.
Writes a value to a clock.
- Definition Classes
- GenericBackend → BackendInterface
- def resolveName(signal: Data): String
Returns a human readable name of a signal.
Returns a human readable name of a signal.
- Definition Classes
- GenericBackend → BackendInterface
- val rootTimescope: Option[RootTimescope]
- Definition Classes
- ThreadedBackend
- def run(testFn: (T) => Unit): AnnotationSeq
Runs of tests are wrapped in this, for any special setup/teardown that needs to happen.
Runs of tests are wrapped in this, for any special setup/teardown that needs to happen. Takes the test function, which takes the module used as the testing interface. TesterContext setup is done externally.
- returns
coverage annotations Internal API
- Definition Classes
- GenericBackend → BackendInstance
- def runThreads(clocks: Set[Clock]): Unit
Runs the specified threads, blocking this thread while those are running.
Runs the specified threads, blocking this thread while those are running. Newly formed threads or unblocked join threads will also run. Returns a list of threads run (either passed in, newly forked, or joined) that are waiting on a clock edge.
TODO: uses shared schedule state, as an optimization (so that control doesn't need to return to the driver thread between runs. But control still needs to return to the calling thread between timesteps. TODO: this provides a separation which isolates the threading infrastructure from clock control, but there are other structures which accomplish the same thing.
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- def scheduler(): Unit
Invokes the thread scheduler, which should be done anytime a thread needs to pass time.
Invokes the thread scheduler, which should be done anytime a thread needs to pass time. Prior to this call: caller should add itself to the blocked / joined threads list (unless terminating). After this call: caller should block on its semaphore (unless terminating). currentThread will no longer be valid.
Unblocks the next thread to be run, possibly also also stepping time via advanceTime(). When there are no more active threads, unblocks the driver thread via driverSemaphore.
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- def setTimeout(signal: Clock, cycles: Int): Unit
Sets the timeout of the clock: the number of cycles the clock can advance without some non-nop poke operation.
Sets the timeout of the clock: the number of cycles the clock can advance without some non-nop poke operation. Setting cycles=0 disables the timeout. Setting cycles=1 means every cycle must have some non-nop poke operation. Resets the idle counter associated with the specified clock.
- Definition Classes
- ThreadedBackend → BackendInterface
- def setVar(key: Any, value: Any): Unit
Sets the value associated with a key in a per-test map.
Sets the value associated with a key in a per-test map.
- Definition Classes
- BackendInterface
- def step(signal: Clock, cycles: Int): Unit
Advances the target clock by one cycle.
Advances the target clock by one cycle.
- Definition Classes
- GenericBackend → BackendInterface
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val testMap: HashMap[Any, Any]
- Attributes
- protected
- Definition Classes
- BackendInterface
- def threadFinished(thread: TesterThread): Unit
Called on thread completion to remove this thread from the running list.
Called on thread completion to remove this thread from the running list. Does not terminate the thread, does not schedule the next thread.
- Attributes
- protected
- Definition Classes
- ThreadedBackend
- def timestep(): Unit
Starts a new timestep, checking if there were any conflicts on the previous timestep (and throwing exceptions if there were).
Starts a new timestep, checking if there were any conflicts on the previous timestep (and throwing exceptions if there were).
- Definition Classes
- ThreadedBackend
- def toString(): String
- Definition Classes
- AnyRef → Any
- val verbose: Boolean
- 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])
- object TimescopeUtils
- Definition Classes
- ThreadedBackend
- object schedulerState
- Definition Classes
- ThreadedBackend
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated