@@ -58,10 +58,6 @@ class RealGCD3 extends Module {
5858 printf(" x: %d, y: %d\n " , x, y)
5959 }.otherwise { printf(" stalled\n " )}
6060
61- // printf("ti %d x %d y %d in_ready %d in_valid %d out %d out_valid %d==============\n",
62- // ti, x, y, io.in.ready, io.in.valid, io.out.bits, io.out.valid)
63- // ti, x, y, io.in.ready, io.in.valid, io.out.bits, io.out.ready, io.out.valid)
64-
6561 io.out.bits := x
6662 io.out.valid := y === Bits (0 ) && p
6763 when (io.out.valid) {
@@ -70,19 +66,19 @@ class RealGCD3 extends Module {
7066}
7167
7268class GCDAdvTester (c : RealGCD3 ) extends AdvTester (c) {
69+ val gcdOutputHandler = new ValidSink (c.io.out, (outPort : UInt ) => {
70+ peek(outPort)
71+ })
72+ val gcdInputDriver = new DecoupledSource (c.io.in, (inPorts : RealGCD3Input , inValues : TestGCD3Values ) => {
73+ wire_poke(inPorts.a, inValues.a)
74+ wire_poke(inPorts.b, inValues.b)
75+ })
76+
7377 for {
7478 i <- 1 to 10
7579 j <- 1 to 10
7680 } {
7781 val (gcd_value, nCycles) = RealGCD3 .computeGcdResultsAndCycles(i, j)
78- val gcdOutputHandler = new ValidSink (c.io.out, (outPort : UInt ) => {
79- peek(outPort)
80- })
81- val gcdInputDriver = new DecoupledSource (c.io.in, (inPorts : RealGCD3Input , inValues : TestGCD3Values ) => {
82- wire_poke(inPorts.a, inValues.a)
83- wire_poke(inPorts.b, inValues.b)
84- })
85-
8682 gcdInputDriver.inputs.enqueue(TestGCD3Values (i, j))
8783 gcdInputDriver.process()
8884 eventually(gcdOutputHandler.outputs.size != 0 , nCycles + 2 )
@@ -101,22 +97,19 @@ class AdvTesterSpec extends FlatSpec with Matchers {
10197 }
10298
10399 it should " run verilator via command line arguments" in {
104- // val args = Array.empty[String]
105100 val args = Array (" --backend-name" , " verilator" )
106101 iotesters.Driver .execute(args, () => new RealGCD3 ) { c =>
107102 new GCDAdvTester (c)
108103 } should be (true )
109104 }
110105 it should " run firrtl via command line arguments" in {
111- // val args = Array.empty[String]
112106 val args = Array (" --backend-name" , " firrtl" , " --fint-write-vcd" )
113107 iotesters.Driver .execute(args, () => new RealGCD3 ) { c =>
114108 new GCDAdvTester (c)
115109 } should be (true )
116110 }
117111
118112 it should " run firrtl via direct options configuration" in {
119- // val args = Array.empty[String]
120113 val manager = new TesterOptionsManager {
121114 testerOptions = TesterOptions (backendName = " firrtl" )
122115 interpreterOptions = InterpreterOptions (writeVCD = true )
0 commit comments