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

Fix a few compiler warnings #738

Merged
merged 5 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/main/scala/chisel3/compatibility.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package object Chisel { // scalastyle:ignore package.object.name
import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
import scala.annotation.compileTimeOnly
import scala.language.implicitConversions

implicit val defaultCompileOptions = chisel3.core.ExplicitCompileOptions.NotStrict

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/chiselTests/IOCompatibility.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IOCModuleVec(val n: Int) extends Module {

class IOCModuleWire extends Module {
val io = IO(new IOCSimpleIO)
val inc = Wire(Module(new IOCPlusOne).io.chiselCloneType)
val inc = Wire(chiselTypeOf(Module(new IOCPlusOne).io))
inc.in := io.in
io.out := inc.out
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/chiselTests/Printf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SinglePrintfTester() extends BasicTester {
}

class ASCIIPrintfTester() extends BasicTester {
printf((0x20 to 0x7e).map(_ toChar).mkString.replace("%", "%%"))
printf((0x20 to 0x7e).map(_.toChar).mkString.replace("%", "%%"))
stop()
}

Expand Down
6 changes: 5 additions & 1 deletion src/test/scala/chiselTests/RecordSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ package chiselTests
import chisel3._
import chisel3.testers.BasicTester
import chisel3.util.{Counter, Queue}
import chisel3.experimental.requireIsChiselType
import scala.collection.immutable.ListMap

// An example of how Record might be extended
// In this case, CustomBundle is a Record constructed from a Tuple of (String, Data)
// it is a possible implementation of a programmatic "Bundle"
// (and can by connected to MyBundle below)
final class CustomBundle(elts: (String, Data)*) extends Record {
val elements = ListMap(elts map { case (field, elt) => field -> elt.chiselCloneType }: _*)
val elements = ListMap(elts map { case (field, elt) =>
requireIsChiselType(elt)
field -> elt
}: _*)
def apply(elt: String): Data = elements(elt)
override def cloneType = (new CustomBundle(elements.toList: _*)).asInstanceOf[this.type]
}
Expand Down