From 57e8774c34fc28dd34cdec5e8a1bf82f3cd4e0cd Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Tue, 14 Aug 2018 11:39:28 -0400 Subject: Put do_* methods in SourceInfoTransformMacro group This places all do_* methods (and two unary methods in SInt and FixedPoint that act like do_* methods) inside the ScalaDoc group "SourceInfoTransformMacro". Classes/objects which need information about this group have an additional bare trait mixed in, `SourceInfoDoc`, that provides information about the group and its priority. Signed-off-by: Schuyler Eldridge --- src/main/scala/chisel3/util/BitPat.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/scala/chisel3/util') diff --git a/src/main/scala/chisel3/util/BitPat.scala b/src/main/scala/chisel3/util/BitPat.scala index 6ff08bea..6cba497e 100644 --- a/src/main/scala/chisel3/util/BitPat.scala +++ b/src/main/scala/chisel3/util/BitPat.scala @@ -88,15 +88,17 @@ object BitPat { * "b10001".U === BitPat("b101??") // evaluates to false.B * }}} */ -sealed class BitPat(val value: BigInt, val mask: BigInt, width: Int) { +sealed class BitPat(val value: BigInt, val mask: BigInt, width: Int) extends SourceInfoDoc { def getWidth: Int = width def === (that: UInt): Bool = macro SourceInfoTransform.thatArg def =/= (that: UInt): Bool = macro SourceInfoTransform.thatArg + /** @group SourceInfoTransformMacro */ def do_=== (that: UInt) // scalastyle:ignore method.name (implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = { value.asUInt === (that & mask.asUInt) } + /** @group SourceInfoTransformMacro */ def do_=/= (that: UInt) // scalastyle:ignore method.name (implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = { !(this === that) -- cgit v1.2.3