diff options
| author | Jim Lawson | 2017-08-01 14:11:03 -0700 |
|---|---|---|
| committer | GitHub | 2017-08-01 14:11:03 -0700 |
| commit | 661aa017446693077670ab3d14a30e4804a5c1af (patch) | |
| tree | ae5dbb532b3bbdae060e10193a1eeb8dda0baa22 /src/main/scala/chisel3/util | |
| parent | 004938693112b2be268b0ee8d91874ba2d993ec3 (diff) | |
Address scalastyle issues, out of date comments, extraneous imports. (#658)
No functional changes
Diffstat (limited to 'src/main/scala/chisel3/util')
| -rw-r--r-- | src/main/scala/chisel3/util/BitPat.scala | 12 | ||||
| -rw-r--r-- | src/main/scala/chisel3/util/Valid.scala | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/main/scala/chisel3/util/BitPat.scala b/src/main/scala/chisel3/util/BitPat.scala index 33b9f173..54ded155 100644 --- a/src/main/scala/chisel3/util/BitPat.scala +++ b/src/main/scala/chisel3/util/BitPat.scala @@ -94,7 +94,13 @@ sealed class BitPat(val value: BigInt, val mask: BigInt, width: Int) { @deprecated("Use '=/=', which avoids potential precedence problems", "chisel3") def != (that: UInt): Bool = macro SourceInfoTransform.thatArg - def do_=== (that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = value.asUInt === (that & mask.asUInt) // scalastyle:ignore method.name - def do_=/= (that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = !(this === that) // scalastyle:ignore method.name - def do_!= (that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = this =/= that // scalastyle:ignore method.name + def do_=== (that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = { // scalastyle:ignore method.name + value.asUInt === (that & mask.asUInt) + } + def do_=/= (that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = { // scalastyle:ignore method.name + !(this === that) + } + def do_!= (that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = { // scalastyle:ignore method.name + this =/= that + } } diff --git a/src/main/scala/chisel3/util/Valid.scala b/src/main/scala/chisel3/util/Valid.scala index 6fb67585..7017b7a1 100644 --- a/src/main/scala/chisel3/util/Valid.scala +++ b/src/main/scala/chisel3/util/Valid.scala @@ -47,8 +47,12 @@ object Pipe apply(v, b, latency-1)(compileOptions) } } - def apply[T <: Data](enqValid: Bool, enqBits: T)(implicit compileOptions: CompileOptions): Valid[T] = apply(enqValid, enqBits, 1)(compileOptions) - def apply[T <: Data](enq: Valid[T], latency: Int = 1)(implicit compileOptions: CompileOptions): Valid[T] = apply(enq.valid, enq.bits, latency)(compileOptions) + def apply[T <: Data](enqValid: Bool, enqBits: T)(implicit compileOptions: CompileOptions): Valid[T] = { + apply(enqValid, enqBits, 1)(compileOptions) + } + def apply[T <: Data](enq: Valid[T], latency: Int = 1)(implicit compileOptions: CompileOptions): Valid[T] = { + apply(enq.valid, enq.bits, latency)(compileOptions) + } } class Pipe[T <: Data](gen: T, latency: Int = 1)(implicit compileOptions: CompileOptions) extends Module |
