Skip to content

Commit 0d8c8ce

Browse files
authored
Merge pull request #126 from ucb-bar/lessVerbose
Less verbose
2 parents 041c837 + b4e0c25 commit 0d8c8ce

8 files changed

+85
-67
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ install:
2323
- verilator --version
2424

2525
script:
26-
- set -o pipefail && sbt -Dchisel3Version=$CHISEL3 -Dchisel-iotestersVersion=$CHISEL_TESTERS test | sed '/info/,+1 d'
26+
- set -o pipefail && sbt -Dchisel3Version=$CHISEL3 -Dchisel-iotestersVersion=$CHISEL_TESTERS test
2727

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ libraryDependencies ++= Seq(
6767
)
6868

6969
javacOptions ++= javacOptionsVersion(scalaVersion.value)
70-
70+
7171
publishMavenStyle := true
7272

7373
publishArtifact in Test := false

src/test/scala/dsptools/ShiftRegisterDelaySpec.scala

+13-9
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ class CircuitWithDelaysTester[T <: Data : Signed](c: AbsCircuitWithDelays[T]) ex
6767
}
6868
}
6969

70-
reset()
71-
poke(c.io.in, 0.0)
72-
step(10)
73-
oneTest()
70+
updatableDspVerbose.withValue(false) {
71+
reset()
72+
poke(c.io.in, 0.0)
73+
step(10)
74+
oneTest()
75+
}
7476
}
7577

7678
class CeilTruncateTester(c: CeilTruncateCircuitWithDelays) extends DspTester(c) {
@@ -101,11 +103,13 @@ class CeilTruncateTester(c: CeilTruncateCircuitWithDelays) extends DspTester(c)
101103
}
102104
}
103105

104-
poke(c.io.inFixed, 0.0)
105-
poke(c.io.inReal, 0.0)
106-
reset()
107-
step(10)
108-
oneTest(c.io.inFixed, c.io.outFixedCeil, c.io.inReal, c.io.outRealCeil, delaySize)
106+
updatableDspVerbose.withValue(false) {
107+
poke(c.io.inFixed, 0.0)
108+
poke(c.io.inReal, 0.0)
109+
reset()
110+
step(10)
111+
oneTest(c.io.inFixed, c.io.outFixedCeil, c.io.inReal, c.io.outRealCeil, delaySize)
112+
}
109113
}
110114

111115
class ShiftRegisterDelaySpec extends FreeSpec with Matchers {

src/test/scala/dsptools/VerboseDspTesterSpec/SimpleTBwGenTypeOption.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ object TestSetup {
338338
dspTesterOptions = DspTesterOptions(
339339
fixTolLSBs = 1,
340340
genVerilogTb = false,
341-
isVerbose = true)
341+
isVerbose = false)
342342
testerOptions = testerOptionsGlobal
343343
}
344344

src/test/scala/dsptools/numbers/FixedPointSpec.scala

+41-33
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ class FixedRing1(val width: Int, val binaryPoint: Int) extends Module {
2929

3030
class FixedRing1Tester(c: FixedRing1) extends DspTester(c) {
3131
val increment: Double = if(c.binaryPoint == 0) 1.0 else 1.0 / (1 << c.binaryPoint)
32-
for(i <- -2.0 to 3.0 by increment) {
33-
poke(c.io.in, i)
34-
35-
expect(c.io.floor, breeze.numerics.floor(i), s"floor of $i should be ${breeze.numerics.floor(i)}")
36-
expect(c.io.ceil, breeze.numerics.ceil(i), s"ceil of $i should be ${breeze.numerics.ceil(i)}")
37-
expect(c.io.isWhole, breeze.numerics.floor(i) == i , s"isWhole of $i should be ${breeze.numerics.floor(i) == i}")
38-
expect(c.io.round, breeze.numerics.round(i), s"round of $i should be ${breeze.numerics.round(i)}")
39-
step(1)
32+
updatableDspVerbose.withValue(false) {
33+
for(i <- -2.0 to 3.0 by increment) {
34+
poke(c.io.in, i)
35+
36+
expect(c.io.floor, breeze.numerics.floor(i), s"floor of $i should be ${breeze.numerics.floor(i)}")
37+
expect(c.io.ceil, breeze.numerics.ceil(i), s"ceil of $i should be ${breeze.numerics.ceil(i)}")
38+
expect(c.io.isWhole, breeze.numerics.floor(i) == i , s"isWhole of $i should be ${breeze.numerics.floor(i) == i}")
39+
expect(c.io.round, breeze.numerics.round(i), s"round of $i should be ${breeze.numerics.round(i)}")
40+
step(1)
41+
}
4042
}
4143
}
4244

@@ -95,34 +97,38 @@ class FixedPointShiftTester(c: FixedPointShifter) extends DspTester(c) {
9597
val z = y / factor
9698
z
9799
}
98-
poke(c.io.dynamicShiftValue, 0)
100+
updatableDspVerbose.withValue(false) {
99101

100-
private val (minSIntValue, maxSIntValue) = firrtl_interpreter.extremaOfSIntOfWidth(c.width)
102+
poke(c.io.dynamicShiftValue, 0)
101103

102-
private val minValue = minSIntValue.toDouble * increment
103-
private val maxValue = maxSIntValue.toDouble * increment
104+
val (minSIntValue, maxSIntValue) = firrtl_interpreter.extremaOfSIntOfWidth(c.width)
104105

105-
for(value <- minValue to maxValue by increment) {
106-
poke(c.io.inValue, value)
107-
expect(c.io.shiftLeftResult, expectedValue(value, left = true, c.fixedShiftSize),
108-
s"shift left ${c.fixedShiftSize} of $value should be ${expectedValue(value, left = true, c.fixedShiftSize)}")
109-
c.io.shiftRightResult.foreach { sro =>
110-
expect(sro, expectedValue(value, left = false, c.fixedShiftSize),
111-
s"shift right ${c.fixedShiftSize} of $value should be ${expectedValue(value, left = false, c.fixedShiftSize)}")
112-
}
106+
val minValue = minSIntValue.toDouble * increment
107+
val maxValue = maxSIntValue.toDouble * increment
113108

114-
step(1)
109+
for(value <- minValue to maxValue by increment) {
110+
poke(c.io.inValue, value)
111+
expect(c.io.shiftLeftResult, expectedValue(value, left = true, c.fixedShiftSize),
112+
s"shift left ${c.fixedShiftSize} of $value should be ${expectedValue(value, left = true, c.fixedShiftSize)}")
113+
c.io.shiftRightResult.foreach { sro =>
114+
expect(sro, expectedValue(value, left = false, c.fixedShiftSize),
115+
s"shift right ${c.fixedShiftSize} of $value should be ${expectedValue(value, left = false, c.fixedShiftSize)}")
116+
}
115117

116-
for(dynamicShiftValue <- 0 until c.width) {
117-
poke(c.io.dynamicShiftValue, dynamicShiftValue)
118118
step(1)
119-
expect(c.io.dynamicShiftLeftResult, expectedValue(value, left = true, dynamicShiftValue),
120-
s"dynamic shift left $dynamicShiftValue of $value should " +
121-
s"be ${expectedValue(value, left = true, dynamicShiftValue)}")
122-
expect(c.io.dynamicShiftRightResult, expectedValue(value, left = false, dynamicShiftValue),
123-
s"dynamic shift right $dynamicShiftValue of $value should" +
124-
s"be ${expectedValue(value, left = false, dynamicShiftValue)}")
119+
120+
for(dynamicShiftValue <- 0 until c.width) {
121+
poke(c.io.dynamicShiftValue, dynamicShiftValue)
122+
step(1)
123+
expect(c.io.dynamicShiftLeftResult, expectedValue(value, left = true, dynamicShiftValue),
124+
s"dynamic shift left $dynamicShiftValue of $value should " +
125+
s"be ${expectedValue(value, left = true, dynamicShiftValue)}")
126+
expect(c.io.dynamicShiftRightResult, expectedValue(value, left = false, dynamicShiftValue),
127+
s"dynamic shift right $dynamicShiftValue of $value should" +
128+
s"be ${expectedValue(value, left = false, dynamicShiftValue)}")
129+
}
125130
}
131+
126132
}
127133
}
128134

@@ -138,10 +144,12 @@ class BrokenShifter(n: Int) extends Module {
138144
}
139145

140146
class BrokenShifterTester(c: BrokenShifter) extends DspTester(c) {
141-
poke(c.io.i, 1.5)
142-
peek(c.io.o)
143-
poke(c.io.si, 6)
144-
peek(c.io.so)
147+
updatableDspVerbose.withValue(false) {
148+
poke(c.io.i, 1.5)
149+
peek(c.io.o)
150+
poke(c.io.si, 6)
151+
peek(c.io.so)
152+
}
145153
}
146154

147155
class FixedPointSpec extends FreeSpec with Matchers {

src/test/scala/dsptools/numbers/ParameterizedOpSpec.scala

+14-10
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ class ParameterizedOpTester[T<:Data:Ring](c: ParameterizedNumberOperation[T]) ex
5050
case "*" => i * j
5151
case _ => i + j
5252
}
53-
poke(c.io.a1, i)
54-
poke(c.io.a2, j)
55-
step(1)
53+
updatableDspVerbose.withValue(false) {
54+
poke(c.io.a1, i)
55+
poke(c.io.a2, j)
56+
step(1)
5657

57-
val result = peek(c.io.c)
58+
val result = peek(c.io.c)
5859

59-
expect(c.io.c, expected, s"$i ${c.op} $j => $result, should have been $expected")
60+
expect(c.io.c, expected, s"$i ${c.op} $j => $result, should have been $expected")
61+
}
6062
}
6163
}
6264

@@ -110,13 +112,15 @@ class ComplexOpTester[T<:DspComplex[_]](c: ParameterizedNumberOperation[T]) exte
110112
case "*" => c1 * c2
111113
case _ => c1 + c2
112114
}
113-
poke(c.io.a1, c1)
114-
poke(c.io.a2, c2)
115-
step(1)
115+
updatableDspVerbose.withValue(false) {
116+
poke(c.io.a1, c1)
117+
poke(c.io.a2, c2)
118+
step(1)
116119

117-
val result = peek(c.io.c)
120+
val result = peek(c.io.c)
118121

119-
expect(c.io.c, expected, s"$i ${c.op} $j => $result, should have been $expected")
122+
expect(c.io.c, expected, s"$i ${c.op} $j => $result, should have been $expected")
123+
}
120124
}
121125
}
122126

src/test/scala/examples/ParameterizedAdderSpec.scala

+13-11
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ class ParameterizedAdder[T <: Data:Ring](gen:() => T) extends Module {
2525
}
2626

2727
class ParameterizedAdderTester[T<:Data:Ring](c: ParameterizedAdder[T]) extends DspTester(c) {
28-
for {
29-
i <- -2.0 to 1.0 by 0.25
30-
j <- -2.0 to 4.0 by 0.5
31-
} {
32-
poke(c.io.a1, i)
33-
poke(c.io.a2, j)
34-
step(1)
35-
36-
val result = peek(c.io.c)
37-
38-
expect(c.io.c, i + j, s"parameterize adder tester $i + $j => $result should have been ${i + j}")
28+
updatableDspVerbose.withValue(false) {
29+
for {
30+
i <- -2.0 to 1.0 by 0.25
31+
j <- -2.0 to 4.0 by 0.5
32+
} {
33+
poke(c.io.a1, i)
34+
poke(c.io.a2, j)
35+
step(1)
36+
37+
val result = peek(c.io.c)
38+
39+
expect(c.io.c, i + j, s"parameterize adder tester $i + $j => $result should have been ${i + j}")
40+
}
3941
}
4042
}
4143

src/test/scala/examples/TransposedStreamFIRSpec.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class TransposedStreamFIRSpec extends FlatSpec with Matchers {
6161
"ConstantTapTransposedStreamingFIR" should "compute a running average like thing" in {
6262
val taps = 0 until 3
6363

64-
chisel3.iotesters.Driver.execute(Array("--is-verbose"),
64+
chisel3.iotesters.Driver.execute(Array[String](),
6565
() => new ConstantTapTransposedStreamingFIR(SInt(10.W), SInt(16.W), taps)) {
6666
c => new ConstantTapTransposedStreamingTester(c)
6767
} should be (true)

0 commit comments

Comments
 (0)