xref: /XiangShan/src/main/scala/utils/NamedUInt.scala (revision 195ef4a53ab54326d879e884c4e1568f424f2668)
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