summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/BlackBox.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/chiselTests/BlackBox.scala')
-rw-r--r--src/test/scala/chiselTests/BlackBox.scala46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/test/scala/chiselTests/BlackBox.scala b/src/test/scala/chiselTests/BlackBox.scala
index d8821134..8b4cf157 100644
--- a/src/test/scala/chiselTests/BlackBox.scala
+++ b/src/test/scala/chiselTests/BlackBox.scala
@@ -37,11 +37,11 @@ class BlackBoxTester extends BasicTester {
val blackBoxPos = Module(new BlackBoxInverter)
val blackBoxNeg = Module(new BlackBoxInverter)
- blackBoxPos.io.in := UInt(1)
- blackBoxNeg.io.in := UInt(0)
+ blackBoxPos.io.in := 1.U
+ blackBoxNeg.io.in := 0.U
- assert(blackBoxNeg.io.out === UInt(1))
- assert(blackBoxPos.io.out === UInt(0))
+ assert(blackBoxNeg.io.out === 1.U)
+ assert(blackBoxPos.io.out === 0.U)
stop()
}
@@ -56,15 +56,15 @@ class MultiBlackBoxTester extends BasicTester {
val blackBoxPassPos = Module(new BlackBoxPassthrough)
val blackBoxPassNeg = Module(new BlackBoxPassthrough)
- blackBoxInvPos.io.in := UInt(1)
- blackBoxInvNeg.io.in := UInt(0)
- blackBoxPassPos.io.in := UInt(1)
- blackBoxPassNeg.io.in := UInt(0)
+ blackBoxInvPos.io.in := 1.U
+ blackBoxInvNeg.io.in := 0.U
+ blackBoxPassPos.io.in := 1.U
+ blackBoxPassNeg.io.in := 0.U
- assert(blackBoxInvNeg.io.out === UInt(1))
- assert(blackBoxInvPos.io.out === UInt(0))
- assert(blackBoxPassNeg.io.out === UInt(0))
- assert(blackBoxPassPos.io.out === UInt(1))
+ assert(blackBoxInvNeg.io.out === 1.U)
+ assert(blackBoxInvPos.io.out === 0.U)
+ assert(blackBoxPassNeg.io.out === 0.U)
+ assert(blackBoxPassPos.io.out === 1.U)
stop()
}
@@ -72,14 +72,14 @@ class BlackBoxWithClockTester extends BasicTester {
val blackBox = Module(new BlackBoxRegister)
val model = Reg(Bool())
- val (cycles, end) = Counter(Bool(true), 15)
+ val (cycles, end) = Counter(true.B, 15)
val impetus = cycles(0)
blackBox.io.clock := clock
blackBox.io.in := impetus
model := impetus
- when(cycles > UInt(0)) {
+ when(cycles > 0.U) {
assert(blackBox.io.out === model)
}
when(end) { stop() }
@@ -121,16 +121,16 @@ class BlackBoxWithParamsTester extends BasicTester {
val blackBoxTypeParamBit = Module(new BlackBoxTypeParam(1, "bit"))
val blackBoxTypeParamWord = Module(new BlackBoxTypeParam(32, "bit [31:0]"))
- val (cycles, end) = Counter(Bool(true), 4)
+ val (cycles, end) = Counter(true.B, 4)
- assert(blackBoxOne.io.out === UInt(1))
- assert(blackBoxFour.io.out === UInt(4))
- assert(blackBoxStringParamOne.io.out === UInt(1))
- assert(blackBoxStringParamTwo.io.out === UInt(2))
- assert(blackBoxRealParamOne.io.out === UInt(0x3ff0000000000000L))
- assert(blackBoxRealParamNeg.io.out === UInt(BigInt("bff0000000000000", 16)))
- assert(blackBoxTypeParamBit.io.out === UInt(1))
- assert(blackBoxTypeParamWord.io.out === UInt("hdeadbeef", 32))
+ assert(blackBoxOne.io.out === 1.U)
+ assert(blackBoxFour.io.out === 4.U)
+ assert(blackBoxStringParamOne.io.out === 1.U)
+ assert(blackBoxStringParamTwo.io.out === 2.U)
+ assert(blackBoxRealParamOne.io.out === 0x3ff0000000000000L.U)
+ assert(blackBoxRealParamNeg.io.out === BigInt("bff0000000000000", 16).U)
+ assert(blackBoxTypeParamBit.io.out === 1.U)
+ assert(blackBoxTypeParamWord.io.out === "hdeadbeef".U(32.W))
when(end) { stop() }
}