Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

How to add options while using treadle to make random validif answer? #2611

Open
@wky17

Description

when I running a validif lofirrtl statement like:
io_out <= validif(UInt<1>("h0"), io_in)
I always get io_out equals toio_in, even the answer should be invalid. I've found that there is an option on this validlf, named ValidIfIsRandomAnnotation.
I added this annotation to treadle tester like this:

object TreadleTestHarness {
  val shell: Shell = new Shell("tr-validif-random") with FirrtlCli
  def apply(
             annotationSeq: AnnotationSeq = Seq.empty,
             flags:         Array[String] = Array.empty
           )(thunk:         TreadleTester => Unit
           ): Unit = {
    val allAnnotations = shell.parse(flags, annotationSeq)
    Logger.makeScope(allAnnotations) {
      val tester = TreadleTester(annotationSeq)
      thunk(tester)
      tester.finish
    }
  }
}

TreadleTestHarness(annotationSeq = Seq(FirrtlSourceAnnotation(file), ValidIfIsRandomAnnotation)) { tester => ...}

but nothing happens, I still get io_out equals to io_in, so how can I get random value when the variable is invalid?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions