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