Skip to content

Instantly share code, notes, and snippets.

@carlosedp
Last active November 2, 2022 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosedp/9214c1a8893a43017a5472be4e8016a8 to your computer and use it in GitHub Desktop.
Save carlosedp/9214c1a8893a43017a5472be4e8016a8 to your computer and use it in GitHub Desktop.
Chisel + Circt test with args
//> using scala "2.13.8"
//> using lib "edu.berkeley.cs::chisel3::3.5.4"
//> using lib "com.sifive::chisel-circt::0.6.0"
//> using plugin "edu.berkeley.cs:::chisel3-plugin::3.5.4"
import chisel3._
import circt.stage.ChiselStage
import chisel3.stage.ChiselGeneratorAnnotation
class FooBundle extends Bundle {
val a = Input(Bool())
val b = Output(Bool())
}
class Foo extends RawModule {
val a = IO(new FooBundle)
val b = IO(Flipped(new FooBundle))
b <> a
}
object Main extends App {
val chiselArgs =
Array(
"--target",
"systemverilog",
"--target-dir",
"generated",
)
(new ChiselStage).execute(
chiselArgs,
Seq(ChiselGeneratorAnnotation(() => new Foo))
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment