Skip to content

Commit

Permalink
Move diplomacy to standalone library absorbing aop
Browse files Browse the repository at this point in the history
Splits out the aop and diplomacy modules into a standalone
library. Adds the new library as a dependency and updates the
in-tree diplomacy and aop modules to reference the new library with
deprecation warnings.
  • Loading branch information
lordspacehog committed Feb 21, 2024
1 parent 49e7d27 commit f21658b
Show file tree
Hide file tree
Showing 17 changed files with 1,019 additions and 3,444 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "dependencies/chisel"]
path = dependencies/chisel
url = https://github.com/chipsalliance/chisel.git
[submodule "dependencies/diplomacy"]
path = dependencies/diplomacy
url = https://github.com/lordspacehog/diplomacy.git
1 change: 1 addition & 0 deletions .mill-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.11.7
32 changes: 32 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version = 3.7.17
runner.dialect = scala213

maxColumn = 120
align.preset = most
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
docstrings.style = SpaceAsterisk
lineEndings = preserve
includeCurlyBraceInSelectChains = false
danglingParentheses.preset = true

align.tokens."+" = [
{
code = ":"
}
]

newlines.beforeCurlyLambdaParams = never
newlines.beforeMultiline = fold
newlines.implicitParamListModifierForce = [before]

verticalMultiline.atDefnSite = true

optIn.annotationNewlines = true

rewrite.rules = [SortImports, PreferCurlyFors, AvoidInfix]
fileOverride {
"glob:**/common.sc/**" {
runner.dialect = scala3
}
}
706 changes: 491 additions & 215 deletions build.sc

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions common.sc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import mill._
import mill.scalalib._

trait HasChisel
extends ScalaModule {
trait HasChisel extends ScalaModule {
// Define these for building chisel from source
def chiselModule: Option[ScalaModule]

Expand All @@ -21,20 +20,18 @@ trait HasChisel

def chiselPluginIvy: Option[Dep]

override def scalacPluginIvyDeps: T[Agg[Dep]] = T(super.scalacPluginIvyDeps() ++ chiselPluginIvy.map(Agg(_)).getOrElse(Agg.empty[Dep]))
override def scalacPluginIvyDeps: T[Agg[Dep]] =
T(super.scalacPluginIvyDeps() ++ chiselPluginIvy.map(Agg(_)).getOrElse(Agg.empty[Dep]))
}

trait MacrosModule
extends ScalaModule {
trait MacrosModule extends ScalaModule {

def scalaReflectIvy: Dep

override def ivyDeps = T(super.ivyDeps() ++ Some(scalaReflectIvy))
}


trait RocketChipModule
extends HasChisel {
trait RocketChipModule extends HasChisel {
override def mainClass = T(Some("freechips.rocketchip.diplomacy.Main"))

def macrosModule: MacrosModule
Expand All @@ -45,16 +42,23 @@ trait RocketChipModule
// should be cde/common.sc#CDEModule
def cdeModule: ScalaModule

def diplomacyModule: ScalaModule

def diplomacyIvy: Option[Dep]

def mainargsIvy: Dep

def json4sJacksonIvy: Dep

override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule)
def sourcecodeIvy: Dep

override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule, diplomacyModule)

override def ivyDeps = T(
super.ivyDeps() ++ Agg(
mainargsIvy,
json4sJacksonIvy
)
json4sJacksonIvy,
sourcecodeIvy
) ++ diplomacyIvy
)
}
1 change: 1 addition & 0 deletions dependencies/diplomacy
Submodule diplomacy added at b4f93b
121 changes: 0 additions & 121 deletions src/main/scala/aop/Select.scala

This file was deleted.

6 changes: 6 additions & 0 deletions src/main/scala/aop/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package freechips.rocketchip

object aop {
@deprecated("aop has moved to the standalone diplomacy library.", "rocketchip 2.0.0")
val Select = _root_.org.chipsalliance.diplomacy.aop.Select
}
Loading

0 comments on commit f21658b

Please sign in to comment.