diff --git a/build.sbt b/build.sbt index 543e5db8..c589c037 100644 --- a/build.sbt +++ b/build.sbt @@ -26,25 +26,24 @@ def javacOptionsVersion(scalaVersion: String): Seq[String] = { organization := "edu.berkeley.cs" -version := "3.2-SNAPSHOT" +version := "3.3.3-RC2" name := "chisel-tutorial" -scalaVersion := "2.11.12" +scalaVersion := "2.12.10" -crossScalaVersions := Seq("2.11.12", "2.12.4") +crossScalaVersions := Seq("2.12.10", "2.11.12") scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-language:reflectiveCalls") // Provide a managed dependency on X if -DXVersion="" is supplied on the command line. // The following are the default development versions, not the "release" versions. -val defaultVersions = Map( - "chisel3" -> "3.2-SNAPSHOT", - "chisel-iotesters" -> "1.3-SNAPSHOT" +val defaultVersions = Seq( + "chisel-iotesters" -> "2.5.0-RC2" ) -libraryDependencies ++= (Seq("chisel3","chisel-iotesters").map { - dep: String => "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep)) }) +libraryDependencies ++= defaultVersions.map { case (dep, ver) => + "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", ver) } resolvers ++= Seq( Resolver.sonatypeRepo("snapshots"), diff --git a/doc/tutorial/tutorial-2.tex b/doc/tutorial/tutorial-2.tex index 7e0200e2..08716d24 100644 --- a/doc/tutorial/tutorial-2.tex +++ b/doc/tutorial/tutorial-2.tex @@ -1339,10 +1339,10 @@ \subsection{Mem} \begin{scala} val ram1p = Mem(UInt(width = 32), 1024, seqRead = true) -val reg_raddr = Reg(UInt()) -when (wen) { ram1p(waddr) := wdata } -.elsewhen (ren) { reg_raddr := raddr } -val rdata = ram1p(reg_raddr) +val reg_addr = Reg(UInt()) +when (wen) { ram1p(addr) := wdata } +.elsewhen (ren) { reg_addr := addr } +val rdata = ram1p(reg_addr) \end{scala} If the same \code{Mem} address is both written and sequentially read on the same clock diff --git a/doc/tutorial/tutorial.tex b/doc/tutorial/tutorial.tex index 58380a31..e7339b78 100644 --- a/doc/tutorial/tutorial.tex +++ b/doc/tutorial/tutorial.tex @@ -803,7 +803,7 @@ \section{State Elements} delayed by one clock cycle. Note that we do not have to specify the type of \verb+Reg+ as it will be automatically inferred from its input when instantiated in this way. In the current version of Chisel, -clock and reset are global signals that are implicity included where +clock and reset are global signals that are implicitly included where needed. Using registers, we can quickly define a number of useful circuit @@ -832,7 +832,7 @@ \section{State Elements} The \verb!:=! assignment to \verb!x! in \verb!counter! wires an update combinational circuit which increments the counter value unless it hits the \verb+max+ at which point it wraps back to zero. Note that when \verb!x! appears on the right-hand side of -an assigment, its output is referenced, whereas when on the left-hand +an assignment, its output is referenced, whereas when on the left-hand side, its input is referenced. Counters can be used to build a number of useful sequential circuits. @@ -1278,10 +1278,10 @@ \subsection{Mem} \begin{scala} val ram1p = Mem(1024, UInt(32.W)) -val reg_raddr = Reg(UInt()) -when (wen) { ram1p(waddr) := wdata } -.elsewhen (ren) { reg_raddr := raddr } -val rdata = ram1p(reg_raddr) +val reg_addr = Reg(UInt()) +when (wen) { ram1p(addr) := wdata } +.elsewhen (ren) { reg_addr := addr } +val rdata = ram1p(reg_addr) \end{scala} If the same \code{Mem} address is both written and sequentially read on the same clock diff --git a/project/build.properties b/project/build.properties index 210243d0..b53dc26f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.1.1 +sbt.version = 1.3.10 diff --git a/src/main/scala/examples/Adder.scala b/src/main/scala/examples/Adder.scala index 3a099aeb..23c68479 100644 --- a/src/main/scala/examples/Adder.scala +++ b/src/main/scala/examples/Adder.scala @@ -29,7 +29,7 @@ class Adder(val n:Int) extends Module { FAs(i).b := io.B(i) FAs(i).cin := carry(i) carry(i+1) := FAs(i).cout - sum(i) := FAs(i).sum.toBool() + sum(i) := FAs(i).sum.asBool } io.Sum := sum.asUInt io.Cout := carry(n) diff --git a/src/main/scala/examples/EnableShiftRegister.scala b/src/main/scala/examples/EnableShiftRegister.scala index 28badc59..bd99e930 100644 --- a/src/main/scala/examples/EnableShiftRegister.scala +++ b/src/main/scala/examples/EnableShiftRegister.scala @@ -13,7 +13,7 @@ class EnableShiftRegister extends Module { val r1 = Reg(UInt()) val r2 = Reg(UInt()) val r3 = Reg(UInt()) - when(reset.toBool) { + when(reset.asBool) { r0 := 0.U(4.W) r1 := 0.U(4.W) r2 := 0.U(4.W) diff --git a/src/main/scala/solutions/SingleEvenFilter.scala b/src/main/scala/solutions/SingleEvenFilter.scala index 73825410..b278a86d 100644 --- a/src/main/scala/solutions/SingleEvenFilter.scala +++ b/src/main/scala/solutions/SingleEvenFilter.scala @@ -32,7 +32,7 @@ object SingleFilter { object EvenFilter { def apply[T <: UInt](dtype: T) = - Module(new PredicateFilter(dtype, (x: T) => x(0).toBool)) + Module(new PredicateFilter(dtype, (x: T) => x(0).asBool)) } class SingleEvenFilter[T <: UInt](dtype: T) extends Filter(dtype) { diff --git a/src/test/scala/utils/TutorialRunner.scala b/src/test/scala/utils/TutorialRunner.scala index 9c17ea48..077ccb6b 100644 --- a/src/test/scala/utils/TutorialRunner.scala +++ b/src/test/scala/utils/TutorialRunner.scala @@ -4,6 +4,18 @@ package utils import scala.collection.mutable.ArrayBuffer import chisel3.iotesters._ +object OptionsCopy { + def apply(t: TesterOptionsManager): TesterOptionsManager = { + new TesterOptionsManager { + testerOptions = t.testerOptions.copy() + interpreterOptions = t.interpreterOptions.copy() + chiselOptions = t.chiselOptions.copy() + firrtlOptions = t.firrtlOptions.copy() + treadleOptions = t.treadleOptions.copy() + } + } +} + object TutorialRunner { def apply(section: String, tutorialMap: Map[String, TesterOptionsManager => Boolean], args: Array[String]): Unit = { var successful = 0 @@ -37,9 +49,11 @@ object TutorialRunner { case Some(test) => println(s"Starting tutorial $testName") try { - optionsManager.setTopName(testName) - optionsManager.setTargetDirName(s"test_run_dir/$section/$testName") - if(test(optionsManager)) { + // Start with a (relatively) clean set of options. + val testOptionsManager = OptionsCopy(optionsManager) + testOptionsManager.setTopName(testName) + testOptionsManager.setTargetDirName(s"test_run_dir/$section/$testName") + if(test(testOptionsManager)) { successful += 1 } else { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy