Last active
November 2, 2022 17:22
-
-
Save carlosedp/9214c1a8893a43017a5472be4e8016a8 to your computer and use it in GitHub Desktop.
Chisel + Circt test with args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//> 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