File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ sealed trait FixedIOBaseModule[A <: Data] extends BaseModule {
2828 */
2929class FixedIORawModule [A <: Data ](final val ioGenerator : A ) extends RawModule with FixedIOBaseModule [A ]
3030
31+ /** A Chisel module whose IO (in addition to [[clock ]] and [[reset ]]) is determined
32+ * by an IO generator. This module cannot have additional IO created by modules that
33+ * extend it.
34+ *
35+ * @param ioGenerator
36+ */
37+ class FixedIOModule [A <: Data ](final val ioGenerator : A ) extends Module with FixedIOBaseModule [A ]
38+
3139/** A Chisel blackbox whose IO is determined by an IO generator. This module
3240 * cannot have additional IO created by modules that extend it.
3341 *
Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ sealed trait FixedIOBaseModule[A <: Data] extends BaseModule {
2525 */
2626class FixedIORawModule [A <: Data ](final val ioGenerator : A ) extends RawModule with FixedIOBaseModule [A ]
2727
28+ /** A Chisel module whose IO (in addition to [[clock ]] and [[reset ]]) is determined
29+ * by an IO generator. This module cannot have additional IO created by modules that
30+ * extend it.
31+ *
32+ * @param ioGenerator
33+ */
34+ class FixedIOModule [A <: Data ](final val ioGenerator : A ) extends Module with FixedIOBaseModule [A ]
35+
2836/** A Chisel blackbox whose IO is determined by an IO generator. This module
2937 * cannot have additional IO created by modules that extend it.
3038 *
Original file line number Diff line number Diff line change @@ -320,4 +320,20 @@ class FixedIOModuleSpec extends AnyFlatSpec with Matchers with FileCheck {
320320 ChiselStage .emitCHIRRTL(new Bar ) should include(" module Foo :" )
321321 }
322322
323+ " FixedIOModule" should " create a module with flattened IO with clock and reset" in {
324+ class Foo (width : Int ) extends FixedIOModule [UInt ](UInt (width.W )) {
325+ override def resetType = Module .ResetType .Synchronous
326+ io :<>= DontCare
327+ }
328+
329+ ChiselStage
330+ .emitCHIRRTL(new Foo (8 ))
331+ .fileCheck()(
332+ """ | CHECK: module Foo :
333+ | CHECK: input clock : Clock
334+ | CHECK: input reset : UInt<1>
335+ | CHECK: output io : UInt<8>
336+ |""" .stripMargin
337+ )
338+ }
323339}
You can’t perform that action at this time.
0 commit comments