Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jack Koenig
    @jackkoenig
    so even though chiseltest only accepts annotations, we can make our own chiseltest CLI
    Here's a simple example just inheriting all of Chisel's options: https://scastie.scala-lang.org/VFsHSvFTQDGwwriIs4fJHg
    Timothy Chong
    @timothychong
    But.. isn't that the same thing?
    Jack Koenig
    @jackkoenig
    It's an example
    Timothy Chong
    @timothychong
    I don't know how to run it inside an "App"
    Jack Koenig
    @jackkoenig
    App is just a main function
    I was just showing how to reproduce Chisel's CLI, we can extend it
    So you can use that to parse your args, then you can pass those annotations to chisel-test stuff
    Timothy Chong
    @timothychong
    I think I semi undersand what you mean. Any example somewhere how to get those args within a AnyFlatSpec
    Jack Koenig
    @jackkoenig
    chisel3.iotesters.Driver.execute(Array("--fint-write-vcd"), () => new RealGCD2) { c =>
      new GCDPeekPokeTester(c)
    } should be(true)
    In that style?
    Timothy Chong
    @timothychong
    yeah. or how do I get those args from CLI within an AnyFlatSpec
    I'm just trying to connect what you said about CLI to the AnyFlatSpec code
    It seems liek the idea here is that the CLI will get all those args, and then somehow I'll be able to get those args within AnyFlatSpec
    when I start the sim
    Jack Koenig
    @jackkoenig
    I honestly don't know how to get CLI arguments into an AnyFlatSpec, that's a ScalaTest question I've never known the answer to
    But a conversion of the above is:
    test(new RealGCD2).withAnnotations((new ChiselTestShell).parse(Array("--fint-write-vcd"))) { c =>
      // test body here
    }
    matrixbot
    @matrixbot
    Schuyler Eldridge This may be a bit of an anti-pattern, though? If you have an App, you can then just do runMain MyApp --foo bar --baz ? I don't think you'd want to be passing args through and into testing?
    Chick Markley
    @chick
    I’ll second that.
    Jack Koenig
    @jackkoenig
    Yeah I agree that ScalaTest stuff probably shouldn't have CLI arguments, but mains should (which is why chiseltest should still provide a main, at least it provides a CLI!)
    Timothy Chong
    @timothychong

    Schuyler Eldridge This may be a bit of an anti-pattern, though? If you have an App, you can then just do runMain MyApp --foo bar --baz ? I don't think you'd want to be passing args through and into testing?

    I think I'm probably missing somehting. How do you run a simulation without using test?

    Without a peekpoketester
    Let me try to build a complete example, I think that's missing lol
    matrixbot
    @matrixbot
    Schuyler Eldridge Jack Koenig (Gitter): 👍️
    Jack Koenig
    @jackkoenig
    Lol well, I have something very close but am getting a linkage error: https://scastie.scala-lang.org/gdDNgFnJRtOB95nRdUOJCA
    Anyway I think that sketch is still right
    Jack Koenig
    @jackkoenig
    There's something weird in the transitive dependencies, but there's your CLI chiseltest example
    (And for some reason Chisel 3.4.0 always warns about clonetype in Scastie templates, I don't know why)
    Timothy Chong
    @timothychong

    Lol well, I have something very close but am getting a linkage error: https://scastie.scala-lang.org/gdDNgFnJRtOB95nRdUOJCA

    I updated my code to this as well and i got the same error

    Jack Koenig
    @jackkoenig
    See the update, you just need to add scalatest 3.2.2 as a dependency
    The transitive dep is wrong and it's pulling in scalatest 3.0.8, thus the linkage error
    (click Build Settings on the left of a Scastie worksheet to see the SBT stuff)
    Timothy Chong
    @timothychong
    Finally at least got it to run. still seeing that match error. Let met try to fix other deprecations
    thanks
    Jack Koenig
    @jackkoenig
    I think you're hitting a real bug that's probably not fixed by fixing the deprecations (can't be sure though) so if you can get us a .fir maybe we can figure it out
    Like if you run (new ChiselStage).emitVerilog(new MyModule) do you see the same problem?
    Timothy Chong
    @timothychong
    yes I do
    It's really strange. BEcaus eI'm using RRArbiter everywhere, and it's only that one single place that it doesn't work
    Jack Koenig
    @jackkoenig
    Crazy
    Okay try (new ChiselStage).emitChirrtl(new MyModule), that should plop a .fir down in your current working directory
    (If you can share this with us)
    Timothy Chong
    @timothychong
    Can I have email addres to send it to?
    chirrtl finishes succesfully
    Jack Koenig
    @jackkoenig
    jack <dot> koenig 3 <at> gmail (no spaces, replace <symbol>s)