diff --git a/build.sbt b/build.sbt index 8a121f79f36..812e39401a9 100644 --- a/build.sbt +++ b/build.sbt @@ -315,8 +315,8 @@ lazy val core = (project in file("core")) "-language:reflectiveCalls", "-unchecked", "-Xcheckinit", - "-Xlint:infer-any" -// , "-Xlint:missing-interpolator" + "-Xlint:infer-any", + "-Xlint:missing-interpolator" ) ) .dependsOn(macros) diff --git a/core/src/main/scala/chisel3/connectable/Connection.scala b/core/src/main/scala/chisel3/connectable/Connection.scala index 5a77563640c..ede985f929b 100644 --- a/core/src/main/scala/chisel3/connectable/Connection.scala +++ b/core/src/main/scala/chisel3/connectable/Connection.scala @@ -249,7 +249,7 @@ private[chisel3] object Connection { case List(a, b) => BiConnect.markAnalogConnected(sourceInfo, a, b, currentModule) BiConnect.markAnalogConnected(sourceInfo, b, a, currentModule) - case _ => throw new InternalErrorException("Match error: as.toList=${as.toList}") + case _ => throw new InternalErrorException(s"Match error: as.toList=${as.toList}") } } catch { // convert Exceptions to Builder.error's so compilation can continue case attach.AttachException(message) => Builder.error(message) diff --git a/core/src/main/scala/chisel3/experimental/hierarchy/core/Hierarchy.scala b/core/src/main/scala/chisel3/experimental/hierarchy/core/Hierarchy.scala index 4fcb937dcd1..936d056e58c 100644 --- a/core/src/main/scala/chisel3/experimental/hierarchy/core/Hierarchy.scala +++ b/core/src/main/scala/chisel3/experimental/hierarchy/core/Hierarchy.scala @@ -105,7 +105,7 @@ object Hierarchy { def toTarget: IsModule = i match { case d: Definition[T] => new Definition.DefinitionBaseModuleExtensions(d).toTarget case i: Instance[T] => new Instance.InstanceBaseModuleExtensions(i).toTarget - case _ => throw new InternalErrorException("Match error: toTarget i=$i") + case _ => throw new InternalErrorException(s"Match error: toTarget i=$i") } /** Returns the toAbsoluteTarget of this hierarchy @@ -114,7 +114,7 @@ object Hierarchy { def toAbsoluteTarget: IsModule = i match { case d: Definition[T] => new Definition.DefinitionBaseModuleExtensions(d).toAbsoluteTarget case i: Instance[T] => new Instance.InstanceBaseModuleExtensions(i).toAbsoluteTarget - case _ => throw new InternalErrorException("Match error: toAbsoluteTarget i=$i") + case _ => throw new InternalErrorException(s"Match error: toAbsoluteTarget i=$i") } } } diff --git a/core/src/main/scala/chisel3/experimental/hierarchy/core/Instance.scala b/core/src/main/scala/chisel3/experimental/hierarchy/core/Instance.scala index 574d36d29c7..6897305960b 100644 --- a/core/src/main/scala/chisel3/experimental/hierarchy/core/Instance.scala +++ b/core/src/main/scala/chisel3/experimental/hierarchy/core/Instance.scala @@ -34,7 +34,7 @@ final case class Instance[+A] private[chisel3] (private[chisel3] val underlying: case Proto(value: IsInstantiable) => None case Clone(i: BaseModule) => Some(i) case Clone(i: InstantiableClone[_]) => i.getInnerContext - case _ => throw new InternalErrorException("Match error: underlying=$underlying") + case _ => throw new InternalErrorException(s"Match error: underlying=$underlying") } /** @return the context this instance. Note that for non-module clones, getInnerDataContext will be the same as getClonedParent */ @@ -42,7 +42,7 @@ final case class Instance[+A] private[chisel3] (private[chisel3] val underlying: case Proto(value: BaseModule) => value._parent case Clone(i: BaseModule) => i._parent case Clone(i: InstantiableClone[_]) => i.getInnerContext - case _ => throw new InternalErrorException("Match error: underlying=$underlying") + case _ => throw new InternalErrorException(s"Match error: underlying=$underlying") } /** Used by Chisel's internal macros. DO NOT USE in your normal Chisel code!!! @@ -84,7 +84,7 @@ object Instance extends SourceInfoDoc { def toTarget: IsModule = i.underlying match { case Proto(x: BaseModule) => x.getTarget case Clone(x: IsClone[_] with BaseModule) => x.getTarget - case _ => throw new InternalErrorException("Match error: i.underlying=${i.underlying}") + case _ => throw new InternalErrorException(s"Match error: i.underlying=${i.underlying}") } /** If this is an instance of a Module, returns the toAbsoluteTarget of this instance @@ -93,7 +93,7 @@ object Instance extends SourceInfoDoc { def toAbsoluteTarget: IsModule = i.underlying match { case Proto(x) => x.toAbsoluteTarget case Clone(x: IsClone[_] with BaseModule) => x.toAbsoluteTarget - case _ => throw new InternalErrorException("Match error: i.underlying=${i.underlying}") + case _ => throw new InternalErrorException(s"Match error: i.underlying=${i.underlying}") } def suggestName(name: String): Unit = i.underlying match { diff --git a/core/src/main/scala/chisel3/experimental/hierarchy/core/Lookupable.scala b/core/src/main/scala/chisel3/experimental/hierarchy/core/Lookupable.scala index ec62b9fb27f..fc5bd956511 100644 --- a/core/src/main/scala/chisel3/experimental/hierarchy/core/Lookupable.scala +++ b/core/src/main/scala/chisel3/experimental/hierarchy/core/Lookupable.scala @@ -82,7 +82,7 @@ object Lookupable { newChild.bind(internal.CrossModuleBinding) newChild.setAllParents(Some(m)) newChild - case _ => throw new InternalErrorException("Match error: newParent=$newParent") + case _ => throw new InternalErrorException(s"Match error: newParent=$newParent") } } } @@ -204,7 +204,7 @@ object Lookupable { val wrMap = mapping.flatMap { case (from, _, wr) => Option.when(wr.isReadOnly)(from -> wr) }.toMap AggregateViewBinding(newMap, Option.when(wrMap.nonEmpty)(wrMap)) } - case _ => throw new InternalErrorException("Match error: data.topBinding=${data.topBinding}") + case _ => throw new InternalErrorException(s"Match error: data.topBinding=${data.topBinding}") } // TODO Unify the following with `.viewAs` @@ -218,7 +218,7 @@ object Lookupable { Builder.unnamedViews += agg case _ => () } - case _ => throw new InternalErrorException("Match error: newBinding=$newBinding") + case _ => throw new InternalErrorException(s"Match error: newBinding=$newBinding") } result.bind(newBinding) @@ -278,7 +278,7 @@ object Lookupable { val newChild = Module.do_pseudo_apply(new InstanceClone(m.getProto, () => m.instanceName)) newChild._parent = i._parent Clone(newChild) - case _ => throw new InternalErrorException("Match error: rec(m)=${rec(m)}") + case _ => throw new InternalErrorException(s"Match error: rec(m)=${rec(m)}") } case Clone(m: InstanceClone[_]) => rec(m) match { @@ -287,9 +287,9 @@ object Lookupable { val newChild = Module.do_pseudo_apply(new InstanceClone(m.getProto, () => m.instanceName)) newChild._parent = i._parent Clone(newChild) - case _ => throw new InternalErrorException("Match error: rec(m)=${rec(m)}") + case _ => throw new InternalErrorException(s"Match error: rec(m)=${rec(m)}") } - case _ => throw new InternalErrorException("Match error: module=$module") + case _ => throw new InternalErrorException(s"Match error: module=$module") } } @@ -396,7 +396,7 @@ object Lookupable { newChild.setRef(mem.getRef, true) newChild case _ => - throw new InternalErrorException("Match error: newParent=$newParent") + throw new InternalErrorException(s"Match error: newParent=$newParent") } } } diff --git a/src/main/scala/chisel3/aop/Select.scala b/src/main/scala/chisel3/aop/Select.scala index 66397a5673d..1e2cb9ff582 100644 --- a/src/main/scala/chisel3/aop/Select.scala +++ b/src/main/scala/chisel3/aop/Select.scala @@ -477,7 +477,7 @@ object Select { case Slot(imm, name) => Seq(imm.id.asInstanceOf[Record].elements(name)) case Index(imm, _) => getEffected(imm) case LitIndex(imm, _) => getEffected(imm) - case _ => throw new InternalErrorException("Match error: a=$a") + case _ => throw new InternalErrorException(s"Match error: a=$a") } // Given an arg, return the corresponding id. Don't use on a loc of a connect. @@ -506,7 +506,7 @@ object Select { case e: ChiselException => i.getOptionRef.get match { case l: LitArg => l.num.intValue.toString - case _ => throw new InternalErrorException("Match error: i.getOptionRef.get=${i.getOptionRef.get}") + case _ => throw new InternalErrorException(s"Match error: i.getOptionRef.get=${i.getOptionRef.get}") } } diff --git a/src/main/scala/chisel3/util/experimental/decode/QMCMinimizer.scala b/src/main/scala/chisel3/util/experimental/decode/QMCMinimizer.scala index 987901b140c..b9456ea5b94 100644 --- a/src/main/scala/chisel3/util/experimental/decode/QMCMinimizer.scala +++ b/src/main/scala/chisel3/util/experimental/decode/QMCMinimizer.scala @@ -261,7 +261,7 @@ object QMCMinimizer extends Minimizer { (maxt ++ dc, false) case x if !x.mask.testBit(i) => // default to ? (mint, true) - case _ => throw new InternalErrorException("Match error: table.default=${table.default}") + case _ => throw new InternalErrorException(s"Match error: table.default=${table.default}") } implicants.foreach(_.isPrime = true) diff --git a/src/main/scala/circt/stage/phases/CIRCT.scala b/src/main/scala/circt/stage/phases/CIRCT.scala index a4feeecf182..b7a28998f17 100644 --- a/src/main/scala/circt/stage/phases/CIRCT.scala +++ b/src/main/scala/circt/stage/phases/CIRCT.scala @@ -250,7 +250,7 @@ class CIRCT extends Phase { ) }) - logger.info(s"""Running CIRCT: '${cmd.mkString(" ")}""" + input.fold(_ => " < $$input'", _ => "'")) + logger.info(s"""Running CIRCT: '${cmd.mkString(" ")}""" + input.fold(_ => " < $$" + "input'", _ => "'")) val stdoutStream, stderrStream = new java.io.ByteArrayOutputStream val stdoutWriter = new java.io.PrintWriter(stdoutStream) val stderrWriter = new java.io.PrintWriter(stderrStream)