Skip to content

Commit 5b886b6

Browse files
authored
[test] Test after randomization in SimulatorSpec (#4981)
Fix an inconsistency in the SimulatorSpec where, if you convert it to run with VCS, this will then have FIRRTL randomization occurr at time 1. The test starts before this and several tests will then fail. Fixes #4980. Signed-off-by: Schuyler Eldridge <[email protected]>
1 parent 94f2eb4 commit 5b886b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/scala-2/chiselTests/simulator/SimulatorSpec.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class SimulatorSpec extends AnyFunSpec with Matchers {
5959
.simulate(new GCD()) { module =>
6060
import PeekPokeAPI._
6161
val gcd = module.wrapped
62+
gcd.clock.step(2)
6263
gcd.io.a.poke(24.U)
6364
gcd.io.b.poke(36.U)
6465
gcd.io.loadValues.poke(1.B)
@@ -79,6 +80,7 @@ class SimulatorSpec extends AnyFunSpec with Matchers {
7980
.simulate(new GCD()) { module =>
8081
import PeekPokeAPI._
8182
val gcd = module.wrapped
83+
gcd.clock.step(2)
8284
gcd.io.a.poke(24.U)
8385
gcd.io.b.poke(36.U)
8486
gcd.io.loadValues.poke(1.B)
@@ -266,6 +268,7 @@ class SimulatorSpec extends AnyFunSpec with Matchers {
266268
.simulate(new SimpleModule) { module =>
267269
import PeekPokeAPI._
268270
val dut = module.wrapped
271+
dut.viewOfClock.step(2)
269272
dut.io.in.poke(12.U)
270273
dut.viewOfClock.step(1)
271274
dut.io.out.peek()

0 commit comments

Comments
 (0)