Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stdlib package #2519

Merged
merged 3 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,38 @@ jobs:
- name: Integration Tests
run: sbt integrationTests/test

std:
name: Standard Library Tests
runs-on: ubuntu-20.04
strategy:
matrix:
scala: [ "2.13.6", "2.12.15" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Tabby OSS Cad Suite (from YosysHQ)
uses: YosysHQ/setup-oss-cad-suite@v1
with:
osscadsuite-version: '2021-11-09'
- name: Setup Scala
uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.11"
- name: Cache Scala
uses: coursier/cache-action@v5
- name: Check Formatting (Scala 2.12 only)
if: startsWith(matrix.scala, '2.12')
run: sbt ++${{ matrix.scala }} standardLibrary/scalafmtCheckAll
- name: Unit Tests
run: sbt ++${{ matrix.scala }} standardLibrary/test

# Sentinel job to simplify how we specify which checks need to pass in branch
# protection and in Mergify
#
# When adding new jobs, please add them to `needs` below
all_tests_passed:
name: "all tests passed"
needs: [ci, integration]
needs: [ci, integration, std]
runs-on: ubuntu-20.04
steps:
- run: echo Success!
Expand Down
14 changes: 14 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ lazy val integrationTests = (project in file("integration-tests"))
)
)

// the chisel standard library
lazy val standardLibrary = (project in file("stdlib"))
.dependsOn(chisel)
.settings(commonSettings: _*)
.settings(chiselSettings: _*)
.settings(usePluginSettings: _*)
.settings(
Seq(
libraryDependencies += defaultVersions("chiseltest") % "test",
Compile / scalaSource := baseDirectory.value / "src",
Test / scalaSource := baseDirectory.value / "test",
)
)

lazy val docs = project // new documentation project
.in(file("docs-target")) // important: it must not be docs/
.dependsOn(chisel)
Expand Down
15 changes: 15 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ class chisel3CrossModule(val crossScalaVersion: String) extends CommonModule wit
super.scalacOptions() ++ Agg(s"-Xplugin:${plugin.jar().path}", "-P:chiselplugin:genBundleElements")
}

object stdlib extends CommonModule {
override def millSourcePath = m.millSourcePath / "stdlib"

override def crossScalaVersion = m.crossScalaVersion

override def scalacPluginClasspath = T { m.scalacPluginClasspath() }

object test extends Tests with TestModule.ScalaTest {
override def moduleDeps = super.moduleDeps ++ chiseltestModule
override def ivyDeps = m.ivyDeps() ++ Agg(
v.scalatest
)
}
}

object test extends Tests with TestModule.ScalaTest {
override def scalacPluginClasspath = T { m.scalacPluginClasspath() }

Expand Down