finished lab2

This commit is contained in:
TOKISAKIX\21168
2023-12-12 00:34:29 +08:00
parent cda1a478ed
commit cba231d592
15 changed files with 1590 additions and 16 deletions

View File

@@ -1,25 +1,25 @@
package riscv
package riscv.singlecycle
import board.z710.Top
import riscv.{Parameters, TestAnnotations}
import board.basys3.BootStates
import chisel3._
import chisel3.util.{is, switch}
import chiseltest._
import org.scalatest.flatspec.AnyFlatSpec
import riscv.{Parameters, TestAnnotations}
import board.z710.Top
class SayGoodbyeTest extends AnyFlatSpec with ChiselScalatestTester {
behavior of "Board simulation"
it should "say goodbye " in {
test(new Top("say_goodbye.asmbin")).withAnnotations(TestAnnotations.annos) { c =>
for (i <- 1 to 50000) {
c.clock.step(5)
c.io.rx.poke((i % 2).U) // poke some useless value, since rx not yet used
}
}
class BoardSayGoodbyeTest extends AnyFlatSpec with ChiselScalatestTester {
behavior of "Board Single"
it should "say goodbye" in {
test(new Top("say_goodbye.asmbin")).withAnnotations(Seq(VerilatorBackendAnnotation, WriteVcdAnnotation))
{ c =>
for (i <- 1 to 200) {
c.clock.step(1000)
c.io.rx.poke((i % 2).B) // Avoid timeout
}
}
}
}