diff options
| author | ducky | 2018-05-09 17:07:13 -0700 |
|---|---|---|
| committer | Richard Lin | 2018-07-04 18:39:28 -0500 |
| commit | 7834f0ada9f8bcfc28c1d6124f63acdcaa2d4755 (patch) | |
| tree | f086a643a249a04e4929bf12c9d508cf3fea2087 /src/main/scala/chisel3/util/Conditional.scala | |
| parent | b74034446223db6731c7e4f2eb362b3349efc8be (diff) | |
work on new style literal accessors
Diffstat (limited to 'src/main/scala/chisel3/util/Conditional.scala')
| -rw-r--r-- | src/main/scala/chisel3/util/Conditional.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/chisel3/util/Conditional.scala b/src/main/scala/chisel3/util/Conditional.scala index 860ffde3..f558b7ba 100644 --- a/src/main/scala/chisel3/util/Conditional.scala +++ b/src/main/scala/chisel3/util/Conditional.scala @@ -28,8 +28,8 @@ class SwitchContext[T <: Bits](cond: T, whenContext: Option[WhenContext], lits: def is(v: Iterable[T])(block: => Unit): SwitchContext[T] = { if (!v.isEmpty) { val newLits = v.map { w => - require(w.isLit, "is conditions must be literals!") - val value = w.litValue + require(w.litToBigIntOption != None, "is condition must be literal") + val value = w.litToBigInt require(!lits.contains(value), "all is conditions must be mutually exclusive!") value } |
