summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/MultiAssign.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/chiselTests/MultiAssign.scala')
-rw-r--r--src/test/scala/chiselTests/MultiAssign.scala19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/test/scala/chiselTests/MultiAssign.scala b/src/test/scala/chiselTests/MultiAssign.scala
index d5e9b998..fc6c5edc 100644
--- a/src/test/scala/chiselTests/MultiAssign.scala
+++ b/src/test/scala/chiselTests/MultiAssign.scala
@@ -12,29 +12,30 @@ class LastAssignTester() extends BasicTester {
val cnt = Counter(2)
val test = Wire(UInt(width=4))
- assert(test === UInt.Lit(7)) // allow read references before assign references
+ assert(test === 7.U) // allow read references before assign references
- test := UInt.Lit(13)
- assert(test === UInt.Lit(7)) // output value should be position-independent
+ test := 13.U
+ assert(test === 7.U) // output value should be position-independent
- test := UInt.Lit(7)
- assert(test === UInt.Lit(7)) // this obviously should work
+ test := 7.U
+ assert(test === 7.U) // this obviously should work
- when(cnt.value === UInt.Lit(1)) {
+ when(cnt.value === 1.U) {
stop()
}
}
class ReassignmentTester() extends BasicTester {
- val test = UInt.Lit(15)
- test := UInt.Lit(7)
+ val test = 15.U
+ test := 7.U
}
class MultiAssignSpec extends ChiselFlatSpec {
"The last assignment" should "be used when multiple assignments happen" in {
assertTesterPasses{ new LastAssignTester }
}
- "Reassignments to non-wire types" should "be disallowed" in {
+ intercept[chisel3.internal.ChiselException] {
+// "Reassignments to non-wire types" should "be disallowed" in {
assertTesterFails{ new ReassignmentTester }
}
}