@@ -33,7 +33,7 @@ case class GCDTestBenchParameter(
3333
3434@ instantiable
3535class GCDTestBenchOM (parameter : GCDTestBenchParameter ) extends Class {
36- val gcd = IO (Output (Property [AnyClassType ]()))
36+ val gcd = IO (Output (Property [AnyClassType ]()))
3737 @ public
3838 val gcdIn = IO (Input (Property [AnyClassType ]()))
3939 gcd := gcdIn
@@ -48,18 +48,18 @@ class GCDTestBench(val parameter: GCDTestBenchParameter)
4848 extends FixedIORawModule (new GCDTestBenchInterface (parameter))
4949 with SerializableModule [GCDTestBenchParameter ]
5050 with ImplicitClock
51- with ImplicitReset {
52- override protected def implicitClock : Clock = verbatim.io.clock
53- override protected def implicitReset : Reset = verbatim.io.reset
51+ with ImplicitReset {
52+ override protected def implicitClock : Clock = verbatim.io.clock
53+ override protected def implicitReset : Reset = verbatim.io.reset
5454 // Instantiate Drivers
55- val verbatim : Instance [TestVerbatim ] = Instantiate (
55+ val verbatim : Instance [TestVerbatim ] = Instantiate (
5656 new TestVerbatim (parameter.testVerbatimParameter)
5757 )
5858 // Instantiate DUT.
59- val dut : Instance [GCD ] = Instantiate (new GCD (parameter.gcdParameter))
59+ val dut : Instance [GCD ] = Instantiate (new GCD (parameter.gcdParameter))
6060 // Instantiate OM
6161 val omInstance = Instantiate (new GCDTestBenchOM (parameter))
62- io.om := omInstance.getPropertyReference.asAnyClassType
62+ io.om := omInstance.getPropertyReference.asAnyClassType
6363 omInstance.gcdIn := dut.io.om
6464
6565 dut.io.clock := implicitClock
@@ -70,13 +70,13 @@ class GCDTestBench(val parameter: GCDTestBenchParameter)
7070 simulationTime := simulationTime + 1 .U
7171 // For each timeout ticks, check it
7272 val (_, callWatchdog) = Counter (true .B , parameter.timeout / 2 )
73- val watchdogCode = RawUnclockedNonVoidFunctionCall (" gcd_watchdog" , UInt (8 .W ))(callWatchdog)
73+ val watchdogCode = RawUnclockedNonVoidFunctionCall (" gcd_watchdog" , UInt (8 .W ))(callWatchdog)
7474 when(watchdogCode =/= 0 .U ) {
7575 stop(cf """ {"event":"SimulationStop","reason": ${watchdogCode},"cycle": ${simulationTime}}\n """ )
7676 }
7777 class TestPayload extends Bundle {
78- val x = UInt (parameter.gcdParameter.width.W )
79- val y = UInt (parameter.gcdParameter.width.W )
78+ val x = UInt (parameter.gcdParameter.width.W )
79+ val y = UInt (parameter.gcdParameter.width.W )
8080 val result = UInt (parameter.gcdParameter.width.W )
8181 }
8282 val request =
@@ -86,10 +86,10 @@ class GCDTestBench(val parameter: GCDTestBenchParameter)
8686 )
8787 when(dut.io.input.ready) {
8888 dut.io.input.valid := request.valid
89- dut.io.input.bits := request.bits
89+ dut.io.input.bits := request.bits
9090 }.otherwise {
9191 dut.io.input.valid := false .B ;
92- dut.io.input.bits := DontCare ;
92+ dut.io.input.bits := DontCare ;
9393 }
9494
9595 // LTL Checker
@@ -98,7 +98,7 @@ class GCDTestBench(val parameter: GCDTestBenchParameter)
9898 val inputNotFire : Sequence = ! dut.io.input.fire
9999 val outputFire : Sequence = dut.io.output.valid
100100 val outputNotFire : Sequence = ! dut.io.output.valid
101- val lastRequestResult : UInt = RegEnable (request.bits.result, dut.io.input.fire)
101+ val lastRequestResult : UInt = RegEnable (request.bits.result, dut.io.input.fire)
102102 val checkRight : Sequence = lastRequestResult === dut.io.output.bits
103103 val inputNotValid : Sequence = dut.io.input.ready && ! dut.io.input.valid
104104
@@ -140,19 +140,19 @@ case class TestVerbatimParameter(
140140@ instantiable
141141class TestVerbatimOM (parameter : TestVerbatimParameter ) extends Class {
142142 val useAsyncReset : Property [Boolean ] = IO (Output (Property [Boolean ]()))
143- val initFunctionName : Property [String ] = IO (Output (Property [String ]()))
144- val dumpFunctionName : Property [String ] = IO (Output (Property [String ]()))
145- val clockFlipTick : Property [Int ] = IO (Output (Property [Int ]()))
146- val resetFlipTick : Property [Int ] = IO (Output (Property [Int ]()))
147- val gcd = IO (Output (Property [AnyClassType ]()))
143+ val initFunctionName : Property [String ] = IO (Output (Property [String ]()))
144+ val dumpFunctionName : Property [String ] = IO (Output (Property [String ]()))
145+ val clockFlipTick : Property [Int ] = IO (Output (Property [Int ]()))
146+ val resetFlipTick : Property [Int ] = IO (Output (Property [Int ]()))
147+ val gcd = IO (Output (Property [AnyClassType ]()))
148148 @ public
149149 val gcdIn = IO (Input (Property [AnyClassType ]()))
150- gcd := gcdIn
151- useAsyncReset := Property (parameter.useAsyncReset)
150+ gcd := gcdIn
151+ useAsyncReset := Property (parameter.useAsyncReset)
152152 initFunctionName := Property (parameter.initFunctionName)
153153 dumpFunctionName := Property (parameter.dumpFunctionName)
154- clockFlipTick := Property (parameter.clockFlipTick)
155- resetFlipTick := Property (parameter.resetFlipTick)
154+ clockFlipTick := Property (parameter.clockFlipTick)
155+ resetFlipTick := Property (parameter.resetFlipTick)
156156}
157157
158158/** Test blackbox for clockgen, wave dump and extra testbench-only codes. */
0 commit comments