summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/scala/chisel3/compatibility.scala34
-rw-r--r--src/main/scala/chisel3/compatibility/debug.scala2
-rw-r--r--src/main/scala/chisel3/package.scala38
-rw-r--r--src/main/scala/chisel3/util/BitPat.scala6
-rw-r--r--src/main/scala/chisel3/util/Decoupled.scala2
-rw-r--r--src/main/scala/chisel3/util/TransitName.scala4
6 files changed, 45 insertions, 41 deletions
diff --git a/src/main/scala/chisel3/compatibility.scala b/src/main/scala/chisel3/compatibility.scala
index 5624b79c..35c44330 100644
--- a/src/main/scala/chisel3/compatibility.scala
+++ b/src/main/scala/chisel3/compatibility.scala
@@ -3,7 +3,7 @@
// Allows legacy users to continue using Chisel (capital C) package name while
// moving to the more standard package naming convention chisel3 (lowercase c).
-package object Chisel {
+package object Chisel { // scalastyle:ignore package.object.name
type Direction = chisel3.core.Direction
val INPUT = chisel3.core.Direction.Input
val OUTPUT = chisel3.core.Direction.Output
@@ -72,29 +72,29 @@ package object Chisel {
* Prefer storing the result and then extracting from it.
*/
implicit class fromIntToLiteral(val x: Int) extends AnyVal {
- def U: UInt = UInt(BigInt(x), Width())
- def S: SInt = SInt(BigInt(x), Width())
+ def U: UInt = UInt(BigInt(x), Width()) // scalastyle:ignore method.name
+ def S: SInt = SInt(BigInt(x), Width()) // scalastyle:ignore method.name
- def asUInt() = UInt(x, Width())
- def asSInt() = SInt(x, Width())
- def asUInt(width: Int) = UInt(x, width)
- def asSInt(width: Int) = SInt(x, width)
+ def asUInt(): UInt = UInt(x, Width())
+ def asSInt(): SInt = SInt(x, Width())
+ def asUInt(width: Int): UInt = UInt(x, width)
+ def asSInt(width: Int): SInt = SInt(x, width)
}
-
+
implicit class fromBigIntToLiteral(val x: BigInt) extends AnyVal {
- def U: UInt = UInt(x, Width())
- def S: SInt = SInt(x, Width())
+ def U: UInt = UInt(x, Width()) // scalastyle:ignore method.name
+ def S: SInt = SInt(x, Width()) // scalastyle:ignore method.name
- def asUInt() = UInt(x, Width())
- def asSInt() = SInt(x, Width())
- def asUInt(width: Int) = UInt(x, width)
- def asSInt(width: Int) = SInt(x, width)
+ def asUInt(): UInt = UInt(x, Width())
+ def asSInt(): SInt = SInt(x, Width())
+ def asUInt(width: Int): UInt = UInt(x, width)
+ def asSInt(width: Int): SInt = SInt(x, width)
}
implicit class fromStringToLiteral(val x: String) extends AnyVal {
- def U: UInt = UInt(x)
+ def U: UInt = UInt(x) // scalastyle:ignore method.name
}
implicit class fromBooleanToLiteral(val x: Boolean) extends AnyVal {
- def B: Bool = Bool(x)
+ def B: Bool = Bool(x) // scalastyle:ignore method.name
}
@@ -105,7 +105,7 @@ package object Chisel {
val throwException = chisel3.compatibility.throwException
val debug = chisel3.compatibility.debug
- object testers {
+ object testers { // scalastyle:ignore object.name
type BasicTester = chisel3.testers.BasicTester
val TesterDriver = chisel3.testers.TesterDriver
}
diff --git a/src/main/scala/chisel3/compatibility/debug.scala b/src/main/scala/chisel3/compatibility/debug.scala
index c3966dae..d9f6e4b0 100644
--- a/src/main/scala/chisel3/compatibility/debug.scala
+++ b/src/main/scala/chisel3/compatibility/debug.scala
@@ -1,3 +1,5 @@
+// See LICENSE for license details.
+
package chisel3.compatibility
import chisel3.core._
diff --git a/src/main/scala/chisel3/package.scala b/src/main/scala/chisel3/package.scala
index 93070f1d..7911cb04 100644
--- a/src/main/scala/chisel3/package.scala
+++ b/src/main/scala/chisel3/package.scala
@@ -1,6 +1,6 @@
// See LICENSE for license details.
-package object chisel3 {
+package object chisel3 { // scalastyle:ignore package.object.name
import scala.language.experimental.macros
import internal.firrtl.Width
@@ -73,29 +73,29 @@ package object chisel3 {
* Prefer storing the result and then extracting from it.
*/
implicit class fromIntToLiteral(val x: Int) extends AnyVal {
- def U: UInt = UInt(BigInt(x), Width())
- def S: SInt = SInt(BigInt(x), Width())
+ def U: UInt = UInt(BigInt(x), Width()) // scalastyle:ignore method.name
+ def S: SInt = SInt(BigInt(x), Width()) // scalastyle:ignore method.name
- def asUInt() = UInt(x, Width())
- def asSInt() = SInt(x, Width())
- def asUInt(width: Int) = UInt(x, width)
- def asSInt(width: Int) = SInt(x, width)
+ def asUInt(): UInt = UInt(x, Width())
+ def asSInt(): SInt = SInt(x, Width())
+ def asUInt(width: Int): UInt = UInt(x, width)
+ def asSInt(width: Int): SInt = SInt(x, width)
}
-
+
implicit class fromBigIntToLiteral(val x: BigInt) extends AnyVal {
- def U: UInt = UInt(x, Width())
- def S: SInt = SInt(x, Width())
+ def U: UInt = UInt(x, Width()) // scalastyle:ignore method.name
+ def S: SInt = SInt(x, Width()) // scalastyle:ignore method.name
- def asUInt() = UInt(x, Width())
- def asSInt() = SInt(x, Width())
- def asUInt(width: Int) = UInt(x, width)
- def asSInt(width: Int) = SInt(x, width)
+ def asUInt(): UInt = UInt(x, Width())
+ def asSInt(): SInt = SInt(x, Width())
+ def asUInt(width: Int): UInt = UInt(x, width)
+ def asSInt(width: Int): SInt = SInt(x, width)
}
implicit class fromStringToLiteral(val x: String) extends AnyVal {
- def U: UInt = UInt(x)
+ def U: UInt = UInt(x) // scalastyle:ignore method.name
}
implicit class fromBooleanToLiteral(val x: Boolean) extends AnyVal {
- def B: Bool = Bool(x)
+ def B: Bool = Bool(x) // scalastyle:ignore method.name
}
implicit class fromUIntToBitPatComparable(val x: UInt) extends AnyVal {
@@ -103,9 +103,9 @@ package object chisel3 {
final def != (that: BitPat): Bool = macro SourceInfoTransform.thatArg
final def =/= (that: BitPat): Bool = macro SourceInfoTransform.thatArg
- def do_=== (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that === x
- def do_!= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that != x
- def do_=/= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that =/= x
+ def do_=== (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that === x // scalastyle:ignore method.name
+ def do_!= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that != x // scalastyle:ignore method.name
+ def do_=/= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that =/= x // scalastyle:ignore method.name
}
// Compatibility with existing code.
diff --git a/src/main/scala/chisel3/util/BitPat.scala b/src/main/scala/chisel3/util/BitPat.scala
index e79b882b..5de7a508 100644
--- a/src/main/scala/chisel3/util/BitPat.scala
+++ b/src/main/scala/chisel3/util/BitPat.scala
@@ -84,7 +84,7 @@ sealed class BitPat(val value: BigInt, val mask: BigInt, width: Int) {
def =/= (that: UInt): Bool = macro SourceInfoTransform.thatArg
def != (that: UInt): Bool = macro SourceInfoTransform.thatArg
- def do_=== (that: UInt)(implicit sourceInfo: SourceInfo): Bool = value.asUInt === (that & mask.asUInt)
- def do_=/= (that: UInt)(implicit sourceInfo: SourceInfo): Bool = !(this === that)
- def do_!= (that: UInt)(implicit sourceInfo: SourceInfo): Bool = this =/= that
+ def do_=== (that: UInt)(implicit sourceInfo: SourceInfo): Bool = value.asUInt === (that & mask.asUInt) // scalastyle:ignore method.name
+ def do_=/= (that: UInt)(implicit sourceInfo: SourceInfo): Bool = !(this === that) // scalastyle:ignore method.name
+ def do_!= (that: UInt)(implicit sourceInfo: SourceInfo): Bool = this =/= that // scalastyle:ignore method.name
}
diff --git a/src/main/scala/chisel3/util/Decoupled.scala b/src/main/scala/chisel3/util/Decoupled.scala
index 0d000f49..42f58ea9 100644
--- a/src/main/scala/chisel3/util/Decoupled.scala
+++ b/src/main/scala/chisel3/util/Decoupled.scala
@@ -103,7 +103,7 @@ class Queue[T <: Data](gen: T, val entries: Int,
extends Module(override_reset=override_reset) {
def this(gen: T, entries: Int, pipe: Boolean, flow: Boolean, _reset: Bool) =
this(gen, entries, pipe, flow, Some(_reset))
-
+
val io = IO(new QueueIO(gen, entries))
val ram = Mem(entries, gen)
diff --git a/src/main/scala/chisel3/util/TransitName.scala b/src/main/scala/chisel3/util/TransitName.scala
index f36f926f..ce6cb60f 100644
--- a/src/main/scala/chisel3/util/TransitName.scala
+++ b/src/main/scala/chisel3/util/TransitName.scala
@@ -1,3 +1,5 @@
+// See LICENSE for license details.
+
package chisel3.util
import chisel3._
@@ -16,7 +18,7 @@ object TransitName {
from
}
def withSuffix[T<:HasId](suffix: String)(from: T, to: HasId): T = {
- from.addPostnameHook((given_name: String) => {to.suggestName(given_name+suffix)})
+ from.addPostnameHook((given_name: String) => {to.suggestName(given_name + suffix)})
from
}
}