diff options
| author | Jiuyang Liu | 2021-11-14 12:43:01 +0800 |
|---|---|---|
| committer | GitHub | 2021-11-14 12:43:01 +0800 |
| commit | 6c5ea6781b0850888e7d0d44439df07146665534 (patch) | |
| tree | d7a7a028cecbbe3bbcb1c91984b7db250cc4b606 /docs/src/cookbooks/cookbook.md | |
| parent | 74ebcbca5a7394b67cd8c0d9fd35e32426759500 (diff) | |
| parent | 64ad1c06b588ba75839e2629fbf889d7b8604953 (diff) | |
Merge branch 'master' into update/sbt-unidoc-0.5.0
Diffstat (limited to 'docs/src/cookbooks/cookbook.md')
| -rw-r--r-- | docs/src/cookbooks/cookbook.md | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/src/cookbooks/cookbook.md b/docs/src/cookbooks/cookbook.md index ce49b668..4b2b088e 100644 --- a/docs/src/cookbooks/cookbook.md +++ b/docs/src/cookbooks/cookbook.md @@ -88,13 +88,14 @@ you are tying off, you can use `chiselTypeOf`: ```scala mdoc:silent:reset import chisel3._ +import chisel3.stage.ChiselStage class MyBundle extends Bundle { val foo = UInt(4.W) val bar = Vec(4, UInt(1.W)) } -class Foo(typ: Data) extends RawModule { +class Foo(typ: MyBundle) extends RawModule { val bundleA = IO(Output(typ)) val bundleB = IO(Output(typ)) @@ -107,9 +108,7 @@ class Foo(typ: Data) extends RawModule { bundleB := 0.U.asTypeOf(chiselTypeOf(bundleB)) } -class Bar extends RawModule { - val foo = Module(new Foo(new MyBundle())) -} +ChiselStage.emitVerilog(new Foo(new MyBundle)) ``` ### How do I create a Vec of Bools from a UInt? |
