xref: /XiangShan/src/main/scala/utils/NamedUInt.scala (revision 3f6c8c2c7f193660d0823208dbcd36d7cec65f50)
1package utils
2
3import chisel3._
4
5/**
6  * Produce named UInt(x.W)
7  *
8  * @example {{{
9  *   object Fflags extends NamedUInt(5)
10  *   val fflags = Fflags()
11  * }}}
12  */
13abstract class NamedUInt(int : Int) {
14  def apply(): UInt = UInt(width.W)
15
16  def width: Int = int
17}
18