summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/WidthSpec.scala
blob: 9a5b18608e2963637a301d5be94f03ac346d33be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// See LICENSE for license details.

package chiselTests

import chisel3._

class WidthSpec extends ChiselFlatSpec {
  "Literals without specified widths" should "get the minimum legal width" in {
    "hdeadbeef".U.getWidth should be (32)
    "h_dead_beef".U.getWidth should be (32)
    "h0a".U.getWidth should be (4)
    "h1a".U.getWidth should be (5)
    "h0".U.getWidth should be (1)
    1.U.getWidth should be (1)
    1.S.getWidth should be (2)
  }
}