Reduces CPU cycles to 2 clock cycles for faster testing/simulation
This commit is contained in:
@@ -49,10 +49,13 @@ class ZzTopAllSpec
|
||||
trace: ListBuffer[String]
|
||||
): Unit = {
|
||||
var cycles = 0
|
||||
dut.clock.step(12) // Attente d'un cycle proc (12 cycles systeme)
|
||||
val clock_per_cpucycle = 2;
|
||||
dut.clock.step(
|
||||
clock_per_cpucycle
|
||||
) // Attente d'un cycle proc (clock_per_cpu cycles systeme)
|
||||
// Attendre une écriture dans x31
|
||||
while (!dut.io.valid_x31.get.peek().litToBoolean && cycles < timeout) {
|
||||
dut.clock.step(12) // Attente d'un cycle proc
|
||||
dut.clock.step(clock_per_cpucycle) // Attente d'un cycle proc
|
||||
cycles += 1
|
||||
trace += f"Attente $cycles cycles"
|
||||
}
|
||||
|
||||
@@ -43,10 +43,13 @@ class ZzTopSpec extends AnyFreeSpec with Matchers with ChiselSim {
|
||||
trace: ListBuffer[String]
|
||||
): Unit = {
|
||||
var cycles = 0
|
||||
dut.clock.step(12) // Attente d'un cycle proc (12 cycles systeme)
|
||||
val clock_per_cpucycle = 2;
|
||||
dut.clock.step(
|
||||
clock_per_cpucycle
|
||||
) // Attente d'un cycle proc (clock_per_cpucycle cycles systeme)
|
||||
// Attendre une écriture dans x31
|
||||
while (!dut.io.valid_x31.get.peek().litToBoolean && cycles < timeout) {
|
||||
dut.clock.step(12) // Attente d'un cycle proc
|
||||
dut.clock.step(clock_per_cpucycle) // Attente d'un cycle proc
|
||||
cycles += 1
|
||||
trace += f"Attente $cycles cycles"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user