Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge branch '1.3.x' into 1.3-release
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.sbt
  • Loading branch information
chick committed Aug 16, 2020
2 parents 3f1822d + 7fa8f6b commit 4442960
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 113 deletions.
203 changes: 94 additions & 109 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,122 +40,107 @@ def javacOptionsVersion(scalaVersion: String): Seq[String] = {
}
}

name := "treadle"

organization := "edu.berkeley.cs"

version := "1.3.0-RC1"

scalaVersion := "2.12.10"

crossScalaVersions := Seq("2.12.10", "2.11.12")

// enables using control-c in sbt CLI
cancelable in Global := true

resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("public")
)

// Assembly

assemblyJarName in assembly := "treadle.jar"

mainClass in assembly := Some("treadle.TreadleRepl")

test in assembly := {} // Should there be tests?

assemblyOutputPath in assembly := file("./utils/bin/treadle.jar")


// Provide a managed dependency on X if -DXVersion="" is supplied on the command line.
val defaultVersions = Map("firrtl" -> "1.4.0-RC1")

// Ignore dependencies on Berkeley artifacts.
// scala-steward:off
libraryDependencies ++= (Seq("firrtl").map {
dep: String => "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep)) })
// scala-steward:on

// sbt 1.2.6 fails with `Symbol 'term org.junit' is missing from the classpath`
// when compiling tests under 2.11.12
// An explicit dependency on junit seems to alleviate this.
libraryDependencies ++= Seq(
"junit" % "junit" % "4.13" % "test",
"org.scalatest" %% "scalatest" % "3.1.2" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.3" % "test",
"com.github.scopt" %% "scopt" % "3.7.1",
"org.scala-lang.modules" % "scala-jline" % "2.12.1",
"org.json4s" %% "json4s-native" % "3.6.8"
lazy val baseSettings = Seq(
name := "treadle",
organization := "edu.berkeley.cs",
version := "1.3.0-RC1",
scalaVersion := "2.12.10",
crossScalaVersions := Seq("2.12.10", "2.11.12"),
// enables using control-c in sbt CLI
cancelable in Global := true,
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("public")
),
// Ignore dependencies on Berkeley artifacts.
// scala-steward:off
libraryDependencies ++= (Seq("firrtl").map {
dep: String => "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep)) }),
// scala-steward:on
// sbt 1.2.6 fails with `Symbol 'term org.junit' is missing from the classpath`
// when compiling tests under 2.11.12
// An explicit dependency on junit seems to alleviate this.
libraryDependencies ++= Seq(
"junit" % "junit" % "4.13" % "test",
"org.scalatest" %% "scalatest" % "3.2.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.3" % "test",
"com.github.scopt" %% "scopt" % "3.7.1",
"org.scala-lang.modules" % "scala-jline" % "2.12.1",
"org.json4s" %% "json4s-native" % "3.6.8"
),
scalacOptions in Compile ++= Seq(
"-deprecation",
"-unchecked",
"-language:reflectiveCalls",
"-language:existentials",
"-language:implicitConversions",
"-Ywarn-unused-import" // required by `RemoveUnused` rule
),
javacOptions ++= javacOptionsVersion(scalaVersion.value)
)

//javaOptions in run ++= Seq(
//"-Xms2G", "-Xmx4G", "-XX:MaxPermSize=1024M", "-XX:+UseConcMarkSweepGC")
//)

publishMavenStyle := true

publishArtifact in Test := false
pomIncludeRepository := { x => false }

pomExtra := (<url>http://chisel.eecs.berkeley.edu/</url>
<licenses>
<license>
<name>BSD-style</name>
<url>http://www.opensource.org/licenses/bsd-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/freechipsproject/treadle.git</url>
<connection>scm:git:github.com/freechipsproject/treadle.git</connection>
</scm>
<developers>
<developer>
<id>chick</id>
<name>Charles Markley</name>
<url>https://aspire.eecs.berkeley.edu/author/chick/</url>
</developer>
</developers>)
lazy val assemblySettings = Seq(
assemblyJarName in assembly := "treadle.jar",
mainClass in assembly := Some("treadle.TreadleRepl"),
test in assembly := {}, // Should there be tests?
assemblyOutputPath in assembly := file("./utils/bin/treadle.jar")
)

publishTo := {
val v = version.value
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT")) {
Some("snapshots" at nexus + "content/repositories/snapshots")
}
else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { x => false },
pomExtra := (<url>http://chisel.eecs.berkeley.edu/</url>
<licenses>
<license>
<name>BSD-style</name>
<url>http://www.opensource.org/licenses/bsd-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/freechipsproject/treadle.git</url>
<connection>scm:git:github.com/freechipsproject/treadle.git</connection>
</scm>
<developers>
<developer>
<id>chick</id>
<name>Charles Markley</name>
<url>https://aspire.eecs.berkeley.edu/author/chick/</url>
</developer>
</developers>),
publishTo := {
val v = version.value
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT")) {
Some("snapshots" at nexus + "content/repositories/snapshots")
}
else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
}
}

//
// This is for regular compilation
//
scalacOptions in Compile ++= Seq(
"-deprecation",
"-unchecked",
"-language:reflectiveCalls",
"-language:existentials",
"-language:implicitConversions",
"-Ywarn-unused-import" // required by `RemoveUnused` rule
)

//
// This is for doc building
//
scalacOptions in Compile in doc ++= Seq(
"-deprecation",
"-Xfatal-warnings",
"-feature",
"-diagrams",
"-diagrams-max-classes", "25",
"-doc-version", version.value,
"-doc-source-url", "https://github.com/freechipsproject/treadle/tree/master/€{FILE_PATH}.scala",
"-sourcepath", baseDirectory.value.getAbsolutePath,
"-unchecked"
) ++ scalacOptionsVersion(scalaVersion.value)
lazy val docSettings = Seq(
scalacOptions in Compile in doc ++= Seq(
"-deprecation",
"-Xfatal-warnings",
"-feature",
"-diagrams",
"-diagrams-max-classes", "25",
"-doc-version", version.value,
"-doc-source-url", "https://github.com/freechipsproject/treadle/tree/master/€{FILE_PATH}.scala",
"-sourcepath", baseDirectory.value.getAbsolutePath,
"-unchecked"
) ++ scalacOptionsVersion(scalaVersion.value),
)

javacOptions ++= javacOptionsVersion(scalaVersion.value)
lazy val treadle = (project in file("."))
.settings(baseSettings)
.settings(assemblySettings)
.settings(publishSettings)
.settings(docSettings)
4 changes: 2 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class treadleCrossModule(crossVersionValue: String) extends CommonModule with Pu
}

def ivyDeps = Agg(
ivy"org.scalatest::scalatest:3.1.2",
ivy"org.scalatestplus::scalacheck-1-14:3.1.1.1",
ivy"org.scalatest::scalatest:3.2.1",
ivy"org.scalatestplus::scalacheck-1-14:3.1.3.0",
) ++ ivyCrossDeps

def testFrameworks = Seq("org.scalatest.tools.Framework")
Expand Down
13 changes: 11 additions & 2 deletions src/main/scala/treadle/stage/phases/PrepareAst.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package treadle.stage.phases
import firrtl.options.{Dependency, Phase}
import firrtl.stage.{FirrtlCircuitAnnotation, Forms}
import firrtl.transforms.BlackBoxSourceHelper
import firrtl.{AnnotationSeq, CircuitState}
import firrtl.{AnnotationSeq, CircuitState, passes}
import treadle.TreadleCircuitStateAnnotation
import treadle.utils.{AugmentPrintf, FixupOps}

Expand All @@ -31,7 +31,16 @@ class PrepareAst extends Phase {
Dependency[BlackBoxSourceHelper],
Dependency[FixupOps],
Dependency[AugmentPrintf]
) ++ Forms.LowFormOptimized
) ++ Forms.LowForm ++ Seq(
Dependency(passes.RemoveValidIf),
Dependency(passes.memlib.VerilogMemDelays),
Dependency(passes.SplitExpressions),
Dependency[firrtl.transforms.LegalizeAndReductionsTransform],
Dependency[firrtl.transforms.ConstantPropagation],
Dependency[firrtl.transforms.CombineCats],
Dependency(passes.CommonSubexpressionElimination),
Dependency[firrtl.transforms.DeadCodeElimination]
)

private def compiler = new firrtl.stage.transforms.Compiler(targets, currentState = Nil)
private val transforms = compiler.flattenedTransformOrder
Expand Down

0 comments on commit 4442960

Please sign in to comment.