Trait

chiseltest.internal

ThreadedBackend

Related Doc: package internal

Permalink

trait ThreadedBackend[T <: MultiIOModule] extends BackendInterface

Base trait for backends implementing concurrency by threading.

Implements these BackendInterface methods: - doFork - doJoin

Provides these methods for use by subclasses: - doPoke, doPeek, which logs peek and poke actions for cross-thread-interaction checking - newTimescope, closeTimescope: provides record-keeping for timescopes - runThreads: runs all threads waiting on a set of clocks - scheduler: called from within a test thread, suspends the current thread and runs the next one

Linear Supertypes
BackendInterface, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ThreadedBackend
  2. BackendInterface
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class BaseTimescope extends AnyRef

    Permalink
  2. sealed trait HasOverridingPokes extends BaseTimescope

    Permalink
  3. sealed trait HasParent extends BaseTimescope

    Permalink
  4. case class PeekRecord(timescope: Timescope, time: TimeRegion, actionId: Int, deps: Map[Data, Option[Timescope]], trace: Throwable) extends Product with Serializable

    Permalink
  5. case class PokeRecord(time: TimeRegion, actionId: Int, value: BigInt, trace: Throwable) extends Product with Serializable

    Permalink
  6. class RootTimescope extends BaseTimescope with HasOverridingPokes

    Permalink
  7. class TesterThread extends AbstractTesterThread

    Permalink
    Attributes
    protected
  8. case class ThreadRootTimescope(parentTimescope: BaseTimescope, openedTime: TimeRegion, parentActionId: Int, thread: TesterThread) extends BaseTimescope with HasParent with Product with Serializable

    Permalink
  9. case class TimeRegion(timeslot: Int, region: Region) extends Product with Serializable

    Permalink
  10. class Timescope extends BaseTimescope with HasOverridingPokes with HasParent

    Permalink

Abstract Value Members

  1. abstract val combinationalPaths: Map[Data, Set[Data]]

    Permalink
  2. abstract def doTimescope(contents: () ⇒ Unit): Unit

    Permalink
    Definition Classes
    BackendInterface
  3. abstract def dut: T

    Permalink
  4. abstract def expectBits(signal: Data, value: BigInt, message: Option[String], stale: Boolean): Unit

    Permalink
    Definition Classes
    BackendInterface
  5. abstract def getSinkClocks(signal: Data): Set[Clock]

    Permalink

    Returns set of clocks associated with sinks of the signal

    Returns set of clocks associated with sinks of the signal

    Definition Classes
    BackendInterface
  6. abstract def getSourceClocks(signal: Data): Set[Clock]

    Permalink

    Returns set of clocks associated with sources of the signal

    Returns set of clocks associated with sources of the signal

    Definition Classes
    BackendInterface
  7. abstract def peekBits(signal: Data, stale: Boolean): BigInt

    Permalink

    Returns the current value on a wire.

    Returns the current value on a wire. If stale is true, returns the current combinational value (after previous pokes have taken effect). If stale is false, returns the value at the beginning of the current cycle.

    Definition Classes
    BackendInterface
  8. abstract def peekClock(signal: Clock): Boolean

    Permalink

    Read the value of a clock.

    Read the value of a clock.

    Definition Classes
    BackendInterface
  9. abstract def pokeBits(signal: Data, value: BigInt): Unit

    Permalink

    Writes a value to a writable wire.

    Writes a value to a writable wire. Throws an exception if write is not writable.

    Definition Classes
    BackendInterface
  10. abstract def pokeClock(signal: Clock, value: Boolean): Unit

    Permalink

    Writes a value to a clock.

    Writes a value to a clock.

    Definition Classes
    BackendInterface
  11. abstract def step(signal: Clock, cycles: Int): Unit

    Permalink

    Advances the target clock by one cycle.

    Advances the target clock by one cycle.

    Definition Classes
    BackendInterface

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object TimescopeUtils

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def closeTimescope(timescope: Timescope): Map[Data, Option[BigInt]]

    Permalink

    Closes the specified timescope, returns a map of wires to values of any signals that need to be updated.

  8. var currentThread: Option[TesterThread]

    Permalink
    Attributes
    protected
  9. def currentTime: TimeRegion

    Permalink
  10. var currentTimestep: Int

    Permalink
  11. def doFork(runnable: () ⇒ Unit, name: Option[String], region: Option[Region]): TesterThread

    Permalink
    Definition Classes
    ThreadedBackendBackendInterface
  12. def doJoin(threads: Seq[AbstractTesterThread], stepAfter: Option[Clock]): Unit

    Permalink
    Definition Classes
    ThreadedBackendBackendInterface
  13. def doPeek(signal: Data, trace: Throwable): Unit

    Permalink

    Logs a peek operation for later checking.

  14. def doPoke(signal: Data, value: BigInt, trace: Throwable): Unit

    Permalink

    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.

  15. val driverSemaphore: Semaphore

    Permalink
    Attributes
    protected
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def getParentTraceElements: Seq[StackTraceElement]

    Permalink

    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
    ThreadedBackendBackendInterface
  21. def getVar(key: Any): Option[Any]

    Permalink

    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
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. val idleCycles: Map[Clock, Int]

    Permalink
  24. val idleLimits: Map[Clock, Int]

    Permalink
  25. val interruptedException: ConcurrentLinkedQueue[Throwable]

    Permalink
    Attributes
    protected
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. def newTimescope(): Timescope

    Permalink

    Creates a new timescope in the current thread.

  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. var rootTimescope: Option[RootTimescope]

    Permalink
  32. def runThreads(clocks: Set[Clock]): Unit

    Permalink

    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
  33. def scheduler(): Unit

    Permalink

    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
  34. object schedulerState

    Permalink
  35. def setTimeout(signal: Clock, cycles: Int): Unit

    Permalink

    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
    ThreadedBackendBackendInterface
  36. def setVar(key: Any, value: Any): Unit

    Permalink

    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
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. val testMap: HashMap[Any, Any]

    Permalink
    Attributes
    protected
    Definition Classes
    BackendInterface
  39. def threadFinished(thread: TesterThread): Unit

    Permalink

    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
  40. def timestep(): Unit

    Permalink

    Starts a new timestep, checking if there were any conflicts on the previous timestep (and throwing exceptions if there were).

  41. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  42. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from BackendInterface

Inherited from AnyRef

Inherited from Any

Ungrouped