这个凿子代码工作正常:
chiselMainTest(Array[String]("--backend", "c", "--genHarness"), () => Module( new Cache(nways = 16, nsets = 32) )){c => new CacheTests(c)}
然而,这个 - 一个小的变化 - 会产生运行时错误:
val cache_inst = new Cache(nways = 16, nsets = 32)
chiselMainTest(Array[String]("--backend", "c", "--genHarness"), () => Module(cache_inst)){c => new CacheTests(c)}
[error] (run-main) java.util.NoSuchElementException: head of empty list
java.util.NoSuchElementException: head of empty list
at scala.collection.immutable.Nil$.head(List.scala:337)
at scala.collection.immutable.Nil$.head(List.scala:334)