From 360927487041c9a200991da09d398614eb376167 Mon Sep 17 00:00:00 2001 From: Yinan Xu Date: Thu, 14 Sep 2023 17:34:28 +0800 Subject: [PATCH] Report all warnings as errors (#155) * Fix the warnings in Difftest and DPIC --- build.sc | 3 +++ src/main/scala/DPIC.scala | 2 +- src/main/scala/Difftest.scala | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sc b/build.sc index 924cf8dc0..4364fbb1e 100644 --- a/build.sc +++ b/build.sc @@ -30,6 +30,9 @@ trait CommonDiffTest extends ScalaModule with SbtModule { override def scalacPluginIvyDeps = Agg(ivys.chisel3Plugin) + override def scalacOptions = Seq("-Ymacro-annotations") ++ + Seq("-Xfatal-warnings", "-feature", "-deprecation", "-language:reflectiveCalls") + override def ivyDeps = Agg(ivys.chisel3) } diff --git a/src/main/scala/DPIC.scala b/src/main/scala/DPIC.scala index 5c3c85059..62e0f54f4 100644 --- a/src/main/scala/DPIC.scala +++ b/src/main/scala/DPIC.scala @@ -63,7 +63,7 @@ class DPIC[T <: DifftestBundle](gen: T) extends ExtModule // This is different from BlackBoxes. io.elements.toSeq.reverse.map{ case (name, data) => data match { - case vec: Vec[Data] => vec.zipWithIndex.map { case (v, i) => (s"io_${name}_$i", v) } + case vec: Vec[_] => vec.zipWithIndex.map { case (v, i) => (s"io_${name}_$i", v) } case _ => Seq((s"io_$name", data)) } } diff --git a/src/main/scala/Difftest.scala b/src/main/scala/Difftest.scala index f547cdd04..fd1000056 100644 --- a/src/main/scala/Difftest.scala +++ b/src/main/scala/Difftest.scala @@ -88,7 +88,7 @@ abstract class DifftestBundle extends Bundle val raw = elements.toSeq.reverse.filterNot(e => filteredElements.contains(e._1)) raw.map{ case (s, data) => data match { - case v: Vec[UInt] => (s, Some(v)) + case v: Vec[_] => (s, Some(v.asInstanceOf[Vec[UInt]])) case u: UInt => (s, Some(Seq(u))) case _ => println(s"Unknown type: ($s, $data)") (s, None)