1
0

use getSimpleName to dump out test names

This commit is contained in:
Howard Mao 2016-07-19 14:42:58 -07:00
parent 1dac2930eb
commit 577c73667b
2 changed files with 6 additions and 2 deletions

View File

@ -622,6 +622,10 @@ class RegressionTest(implicit p: Parameters) extends GroundTest()(p) {
io.status.error.bits := UInt(i) io.status.error.bits := UInt(i)
cur_finished := regress.io.finished cur_finished := regress.io.finished
} }
when (regress.io.start) {
printf(s"Starting regression ${regress.getClass.getSimpleName}\n")
}
} }
when (cur_finished && !all_done) { when (cur_finished && !all_done) {

View File

@ -17,7 +17,7 @@ abstract class UnitTest extends Module {
} }
when (io.start) { when (io.start) {
printf(s"Started UnitTest ${this.getClass.getName}\n") printf(s"Started UnitTest ${this.getClass.getSimpleName}\n")
} }
} }
@ -43,7 +43,7 @@ class UnitTestSuite(implicit p: Parameters) extends GroundTest()(p) {
tests.zipWithIndex.foreach { case (mod, i) => tests.zipWithIndex.foreach { case (mod, i) =>
mod.io.start := (state === s_start) && test_idx === UInt(i) mod.io.start := (state === s_start) && test_idx === UInt(i)
val timeout = Timer(1000, mod.io.start, mod.io.finished) val timeout = Timer(1000, mod.io.start, mod.io.finished)
assert(!timeout, s"UnitTest ${mod.getClass.getName} timed out") assert(!timeout, s"UnitTest ${mod.getClass.getSimpleName} timed out")
when (timeout) { when (timeout) {
io.status.timeout.valid := Bool(true) io.status.timeout.valid := Bool(true)
io.status.timeout.bits := UInt(i) io.status.timeout.bits := UInt(i)