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

Use Treadle (on pull requests only) to speed up CI (backport #2341) #2748

Merged
merged 2 commits into from
Sep 27, 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
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
- name: Documentation (Scala 2.12 only)
if: startsWith(matrix.scala, '2.12')
run: sbt ++${{ matrix.scala }} docs/mdoc unidoc
- name: Use Treadle for Pull Requests
if: github.event_name == 'pull_request'
run: echo "CHISEL3_CI_USE_TREADLE=1" >> $GITHUB_ENV
- name: Test
run: sbt ++${{ matrix.scala }} test
- name: Binary compatibility
Expand Down
5 changes: 4 additions & 1 deletion src/test/scala/chiselTests/ChiselSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ trait ChiselRunners extends Assertions with BackendCompilationUtilities {
annotations: AnnotationSeq = Seq()
): Boolean = {
// Change this to enable Treadle as a backend
val defaultBackend = chisel3.testers.TesterDriver.defaultBackend
val defaultBackend = {
val useTreadle = sys.env.get("CHISEL3_CI_USE_TREADLE").isDefined
if (useTreadle) chisel3.testers.TreadleBackend else chisel3.testers.TesterDriver.defaultBackend
}
val hasBackend = TestUtils.containsBackend(annotations)
val annos: Seq[Annotation] = if (hasBackend) annotations else defaultBackend +: annotations
TesterDriver.execute(() => t, additionalVResources, annos)
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/chiselTests/Vec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.scalacheck._

import chisel3._
import chisel3.stage.ChiselStage
import chisel3.testers.BasicTester
import chisel3.testers.{BasicTester, TesterDriver}
import chisel3.util._
import org.scalacheck.Shrink
import scala.annotation.tailrec
Expand Down Expand Up @@ -456,7 +456,7 @@ class VecSpec extends ChiselPropSpec with Utils {
}

property("Infering widths on huge Vecs should not cause a stack overflow") {
assertTesterPasses { new HugeVecTester(10000) }
assertTesterPasses(new HugeVecTester(10000), annotations = TesterDriver.verilatorOnly)
}

property("A Reg of a Vec of a single 1 bit element should compile and work") {
Expand Down