Skip to content

Commit

Permalink
Bump to firtool-resolver 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig committed Feb 23, 2024
1 parent 68eb248 commit bc9a795
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ lazy val chiselSettings = Seq(
"org.scalatest" %% "scalatest" % "3.2.16" % "test",
"org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % "test",
"com.lihaoyi" %% "upickle" % "3.1.0",
"org.chipsalliance" %% "firtool-resolver" % "1.3.0"
"org.chipsalliance" %% "firtool-resolver" % "2.0.0"
)
) ++ (
// Tests from other projects may still run concurrently
Expand Down
12 changes: 10 additions & 2 deletions src/main/scala/circt/stage/phases/CIRCT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package circt.stage.phases

import _root_.logger.LogLevel
import _root_.logger.{Logger, LogLevel}
import chisel3.BuildInfo.{firtoolVersion, version => chiselVersion}
import chisel3.InternalErrorException
import chisel3.experimental.hierarchy.core.ImportDefinitionAnnotation
Expand Down Expand Up @@ -55,6 +55,14 @@ private object Helpers {
case true => Seq.empty
}
}

class LoggerShim(logger: Logger) extends firtoolresolver.Logger {
def error(msg: String): Unit = logger.error(msg)
def warn(msg: String): Unit = logger.warn(msg)
def info(msg: String): Unit = logger.info(msg)
def debug(msg: String): Unit = logger.debug(msg)
def trace(msg: String): Unit = logger.trace(msg)
}
}

private[this] object Exceptions {
Expand Down Expand Up @@ -204,7 +212,7 @@ class CIRCT extends Phase {
val binary = circtOptions.firtoolBinaryPath.getOrElse {
// .get is safe, firtoolVersion is an Option for backwards compatibility
val version = firtoolVersion.get
val resolved = firtoolresolver.Resolve(loggerToScribe(logger), version)
val resolved = firtoolresolver.Resolve(new LoggerShim(logger), version)
resolved match {
case Left(msg) =>
throw new Exceptions.FirtoolNotFound(msg)
Expand Down
33 changes: 0 additions & 33 deletions src/main/scala/circt/stage/phases/ScribeInterop.scala

This file was deleted.

0 comments on commit bc9a795

Please sign in to comment.