summaryrefslogtreecommitdiff
path: root/docs/src/cookbooks/cookbook.md
diff options
context:
space:
mode:
authormergify[bot]2023-01-11 22:40:32 +0000
committerGitHub2023-01-11 22:40:32 +0000
commitd4570fb9d29371c35641ba79b76662f99677f192 (patch)
tree4be8bcb00e0cdbc8307eb7d2ad5e951189f0c7fe /docs/src/cookbooks/cookbook.md
parent9a7945fd86fcad02da0556d8f4a30daa4b005f9d (diff)
Promote ChiselEnum user APIs from experimental (backport #2929) (#2931)
* Promote ChiselEnum user APIs from experimental (#2929) They are commonly used and if we were ever to change them, we will need to go through a deprecation process anyway. Note that the EnumAnnotations remain in chisel3.experimental because, like all Chisel annotation support, they are slated to be deprecated and removed. (cherry picked from commit 424e9446f1675fe0168e22bdfbbe85db997376e6) # Conflicts: # docs/src/cookbooks/verilog-vs-chisel.md # docs/src/explanations/chisel-enum.md * Maintain binary compatbility, use aliases in chisel3 package * Deprecate the actual classes in chisel3.experimental * Also fix backport conflicts Co-authored-by: Jack Koenig <koenig@sifive.com>
Diffstat (limited to 'docs/src/cookbooks/cookbook.md')
-rw-r--r--docs/src/cookbooks/cookbook.md5
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/src/cookbooks/cookbook.md b/docs/src/cookbooks/cookbook.md
index e7485e66..5b8239a7 100644
--- a/docs/src/cookbooks/cookbook.md
+++ b/docs/src/cookbooks/cookbook.md
@@ -445,13 +445,12 @@ getVerilogString(new Top(new UsingCloneTypeBundle(UInt(8.W))))
### How do I create a finite state machine (FSM)?
-The advised way is to use [`ChiselEnum`](https://www.chisel-lang.org/api/latest/chisel3/experimental/index.html#ChiselEnum=chisel3.experimental.EnumFactory) to construct enumerated types representing the state of the FSM.
-State transitions are then handled with [`switch`](https://www.chisel-lang.org/api/latest/chisel3/util/switch$.html)/[`is`](https://www.chisel-lang.org/api/latest/chisel3/util/is$.html) and [`when`](https://www.chisel-lang.org/api/latest/chisel3/when$.html)/[`.elsewhen`](https://www.chisel-lang.org/api/latest/chisel3/WhenContext.html#elsewhen(elseCond:=%3Echisel3.Bool)(block:=%3EUnit)(implicitsourceInfo:chisel3.internal.sourceinfo.SourceInfo,implicitcompileOptions:chisel3.CompileOptions):chisel3.WhenContext)/[`.otherwise`](https://www.chisel-lang.org/api/latest/chisel3/WhenContext.html#otherwise(block:=%3EUnit)(implicitsourceInfo:chisel3.internal.sourceinfo.SourceInfo,implicitcompileOptions:chisel3.CompileOptions):Unit).
+The advised way is to use `ChiselEnum` to construct enumerated types representing the state of the FSM.
+State transitions are then handled with `switch`/`is` and `when`/`.elsewhen`/`.otherwise`.
```scala mdoc:silent:reset
import chisel3._
import chisel3.util.{switch, is}
-import chisel3.experimental.ChiselEnum
object DetectTwoOnes {
object State extends ChiselEnum {