Skip to content

Commit

Permalink
Bump to firtool-resolver 2.0.0 (#3855)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig authored Feb 23, 2024
1 parent 3573d11 commit eadde6f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 37 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
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object v {
)
val osLib = ivy"com.lihaoyi::os-lib:0.9.1"
val upickle = ivy"com.lihaoyi::upickle:3.1.0"
val firtoolResolver = ivy"org.chipsalliance::firtool-resolver:1.3.0"
val firtoolResolver = ivy"org.chipsalliance::firtool-resolver:2.0.0"
val scalatest = ivy"org.scalatest::scalatest:3.2.14"
val scalacheck = ivy"org.scalatestplus::scalacheck-1-15:3.2.11.0"
val json4s = ivy"org.json4s::json4s-native:4.0.6"
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.{LogLevel, Logger}
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 eadde6f

Please sign in to comment.