diff options
| author | Jack Koenig | 2021-01-21 17:07:45 -0800 |
|---|---|---|
| committer | Jack Koenig | 2021-01-21 17:19:39 -0800 |
| commit | 7e4d1eeb03fddff735e67e3fe36b6efbfac39711 (patch) | |
| tree | 2a4d3c34f1c660579c28440fdb246c8b401b89d6 /docs/src/wiki-deprecated | |
| parent | 6c6ec7161e8f046fff1cfc68a468ce2f053fdb7f (diff) | |
Update docs for the removal of val io and MultiIOModule
Diffstat (limited to 'docs/src/wiki-deprecated')
| -rw-r--r-- | docs/src/wiki-deprecated/cookbook.md | 4 | ||||
| -rw-r--r-- | docs/src/wiki-deprecated/modules.md | 26 | ||||
| -rw-r--r-- | docs/src/wiki-deprecated/ports.md | 6 | ||||
| -rw-r--r-- | docs/src/wiki-deprecated/reset.md | 12 |
4 files changed, 21 insertions, 27 deletions
diff --git a/docs/src/wiki-deprecated/cookbook.md b/docs/src/wiki-deprecated/cookbook.md index 7fa97579..9a10a689 100644 --- a/docs/src/wiki-deprecated/cookbook.md +++ b/docs/src/wiki-deprecated/cookbook.md @@ -282,12 +282,12 @@ class ModuleWithOptionalIOs(flag: Boolean) extends Module { } ``` -The following is an example for a `MultiIOModule` where an entire `IO` is optional: +The following is an example where an entire `IO` is optional: ```scala mdoc:silent:reset import chisel3._ -class ModuleWithOptionalIO(flag: Boolean) extends MultiIOModule { +class ModuleWithOptionalIO(flag: Boolean) extends Module { val in = if (flag) Some(IO(Input(Bool()))) else None val out = IO(Output(Bool())) diff --git a/docs/src/wiki-deprecated/modules.md b/docs/src/wiki-deprecated/modules.md index 1d85b88e..23006c9c 100644 --- a/docs/src/wiki-deprecated/modules.md +++ b/docs/src/wiki-deprecated/modules.md @@ -10,8 +10,8 @@ The hierarchical module namespace is accessible in downstream tools to aid in debugging and physical layout. A user-defined module is defined as a *class* which: - - inherits from ```Module```, - - contains an interface wrapped in a Module's ```IO()``` method and stored in a port field named ```io```, and + - inherits from `Module`, + - contains at least one interface wrapped in a Module's `IO()` method (traditionally stored in a port field named ```io```), and - wires together subcircuits in its constructor. As an example, consider defining your own two-input multiplexer as a @@ -86,24 +86,18 @@ new object. We then wire them up to one another and to the ports of the ```Mux4``` interface. Note: Chisel `Module`s have an implicit clock (called `clock`) and -an implicit reset (called `reset`). For different behavior, Chisel -provides both `MultiIOModule` and `RawModule`. +an implicit reset (called `reset`). To create modules without implicit +clock and reset, Chisel provides `RawModule`. -### `MultiIOModule` - -A `MultiIOModule` allows you to define as many different `IO` as needed -and does not require you to implement an abstract member `io`. -This can be useful when programmatically adding `IO` or adding `IO` via inheritance. -An artifact of this is that Verilog generated from a `MultiIOModule` will -*not* have the `io_` prefix. `MultiIOModule`s still have an implicit -clock and reset like `Module`. - -<!-- TODO: Some example --> +> Historical Note: Prior to Chisel 3.5, Modules were restricted to only +having a single user-defined port named `io`. There was also a type called +`MultiIOModule` that provided implicit clock and reset while allowing the +user to define as many ports as they want. This is now the functionality +of `Module`. ### `RawModule` -A `RawModule` is a module that allows you to define as much `IO` as needed -(like `MultiIOModule`) but **does not provide an implicit clock and reset.** +A `RawModule` is a module that **does not provide an implicit clock and reset.** This can be useful when interfacing a Chisel module with a design that expects a specific naming convention for clock or reset. diff --git a/docs/src/wiki-deprecated/ports.md b/docs/src/wiki-deprecated/ports.md index f8c30b7a..e2b70050 100644 --- a/docs/src/wiki-deprecated/ports.md +++ b/docs/src/wiki-deprecated/ports.md @@ -30,21 +30,21 @@ provide powerful wiring constructs described later. (Chisel 3.2+) -Chisel 3.2+ introduces an API `DataMirror.modulePorts` which can be used to inspect the IOs of any Chisel module, including MultiIOModules, RawModules, and BlackBoxes. +Chisel 3.2+ introduces an API `DataMirror.modulePorts` which can be used to inspect the IOs of any Chisel module, including Modules, RawModules, and BlackBoxes. Here is an example of how to use this API: ```scala import chisel3.experimental.DataMirror -class Adder extends MultiIOModule { +class Adder extends Module { val a = IO(Input(UInt(8.W))) val b = IO(Input(UInt(8.W))) val c = IO(Output(UInt(8.W))) c := a +& b } -class Test extends MultiIOModule { +class Test extends Module { val adder = Module(new Adder) // for debug only adder.a := DontCare diff --git a/docs/src/wiki-deprecated/reset.md b/docs/src/wiki-deprecated/reset.md index 3aafeccd..f5e4a24a 100644 --- a/docs/src/wiki-deprecated/reset.md +++ b/docs/src/wiki-deprecated/reset.md @@ -7,7 +7,7 @@ section: "chisel3" ```scala mdoc:invisible import chisel3._ -class Submodule extends MultiIOModule +class Submodule extends Module ``` As of Chisel 3.2.0, Chisel 3 supports both synchronous and asynchronous reset, @@ -60,13 +60,13 @@ rather than relying on _Reset Inference_, you can mixin one of the following tra For example: ```scala mdoc:silent -class MyAlwaysSyncResetModule extends MultiIOModule with RequireSyncReset { +class MyAlwaysSyncResetModule extends Module with RequireSyncReset { val mySyncResetReg = RegInit(false.B) // reset is of type Bool } ``` ```scala mdoc:silent -class MyAlwaysAsyncResetModule extends MultiIOModule with RequireAsyncReset { +class MyAlwaysAsyncResetModule extends Module with RequireAsyncReset { val myAsyncResetReg = RegInit(false.B) // reset is of type AsyncReset } ``` @@ -123,7 +123,7 @@ See ["Multiple Clock Domains"](../explanations/multi-clock) for more information The following will make `myReg` as well as both `resetAgnosticReg`s synchronously reset: ```scala mdoc:silent -class ForcedSyncReset extends MultiIOModule { +class ForcedSyncReset extends Module { // withReset's argument becomes the implicit reset in its scope withReset (reset.asBool) { val myReg = RegInit(0.U) @@ -140,7 +140,7 @@ class ForcedSyncReset extends MultiIOModule { The following will make `myReg` as well as both `resetAgnosticReg`s asynchronously reset: ```scala mdoc:silent -class ForcedAysncReset extends MultiIOModule { +class ForcedAysncReset extends Module { // withReset's argument becomes the implicit reset in its scope withReset (reset.asAsyncReset){ val myReg = RegInit(0.U) @@ -164,7 +164,7 @@ It is **not** legal to override the reset type using last-connect semantics unless you are overriding a `DontCare`: ```scala mdoc:silent -class MyModule extends MultiIOModule { +class MyModule extends Module { val resetBool = Wire(Reset()) resetBool := DontCare resetBool := false.B // this is fine |
