aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Laeufer2020-07-28 09:55:50 -0700
committerKevin Laeufer2020-07-29 15:26:30 -0700
commit3486ee55b47b80b2a3828a23ddc6439dc48415c3 (patch)
treec8b1db0803fcb04f7cdb5be97661ff0dfbb8e27e /src
parent4b1dc79c71d506159c163e711359aa13c0bdf15b (diff)
[2.13] replace `= Unit` with `= ()`
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/Emitter.scala6
-rw-r--r--src/main/scala/firrtl/WIR.scala26
-rw-r--r--src/main/scala/firrtl/ir/IR.scala126
-rw-r--r--src/main/scala/firrtl/options/OptionParser.scala4
-rw-r--r--src/main/scala/firrtl/options/Phase.scala2
-rw-r--r--src/main/scala/firrtl/passes/memlib/MemIR.scala4
6 files changed, 84 insertions, 84 deletions
diff --git a/src/main/scala/firrtl/Emitter.scala b/src/main/scala/firrtl/Emitter.scala
index 35682eed..da1cb83e 100644
--- a/src/main/scala/firrtl/Emitter.scala
+++ b/src/main/scala/firrtl/Emitter.scala
@@ -171,9 +171,9 @@ case class VRandom(width: BigInt) extends Expression {
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = this
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachWidth(f: Width => Unit): Unit = ()
}
class VerilogEmitter extends SeqTransform with Emitter {
diff --git a/src/main/scala/firrtl/WIR.scala b/src/main/scala/firrtl/WIR.scala
index cda22d27..aeb4f4c2 100644
--- a/src/main/scala/firrtl/WIR.scala
+++ b/src/main/scala/firrtl/WIR.scala
@@ -69,9 +69,9 @@ case object WVoid extends Expression {
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = this
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case object WInvalid extends Expression {
def tpe = UnknownType
@@ -79,9 +79,9 @@ case object WInvalid extends Expression {
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = this
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachWidth(f: Width => Unit): Unit = ()
}
// Useful for splitting then remerging references
case object EmptyExpression extends Expression {
@@ -90,9 +90,9 @@ case object EmptyExpression extends Expression {
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = this
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachWidth(f: Width => Unit): Unit = ()
}
object WDefInstance {
@@ -117,7 +117,7 @@ case class WDefInstanceConnector(
def mapType(f: Type => Type): Statement = this.copy(tpe = f(tpe))
def mapString(f: String => String): Statement = this.copy(name = f(name))
def mapInfo(f: Info => Info): Statement = this.copy(f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = portCons foreach { case (e1, e2) => (f(e1), f(e2)) }
def foreachType(f: Type => Unit): Unit = f(tpe)
def foreachString(f: String => Unit): Unit = f(name)
@@ -338,8 +338,8 @@ case class CDefMemory(
def mapType(f: Type => Type): Statement = this.copy(tpe = f(tpe))
def mapString(f: String => String): Statement = this.copy(name = f(name))
def mapInfo(f: Info => Info): Statement = this.copy(f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
- def foreachExpr(f: Expression => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
+ def foreachExpr(f: Expression => Unit): Unit = ()
def foreachType(f: Type => Unit): Unit = f(tpe)
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)
@@ -359,7 +359,7 @@ case class CDefMPort(info: Info,
def mapType(f: Type => Type): Statement = this.copy(tpe = f(tpe))
def mapString(f: String => String): Statement = this.copy(name = f(name))
def mapInfo(f: Info => Info): Statement = this.copy(f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = exps.foreach(f)
def foreachType(f: Type => Unit): Unit = f(tpe)
def foreachString(f: String => Unit): Unit = f(name)
diff --git a/src/main/scala/firrtl/ir/IR.scala b/src/main/scala/firrtl/ir/IR.scala
index ad96c18c..33083c10 100644
--- a/src/main/scala/firrtl/ir/IR.scala
+++ b/src/main/scala/firrtl/ir/IR.scala
@@ -224,9 +224,9 @@ case class Reference(name: String, tpe: Type = UnknownType, kind: Kind = Unknown
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this.copy(tpe = f(tpe))
def mapWidth(f: Width => Width): Expression = this
- def foreachExpr(f: Expression => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class SubField(expr: Expression, name: String, tpe: Type = UnknownType, flow: Flow = UnknownFlow)
@@ -237,7 +237,7 @@ case class SubField(expr: Expression, name: String, tpe: Type = UnknownType, flo
def mapWidth(f: Width => Width): Expression = this
def foreachExpr(f: Expression => Unit): Unit = f(expr)
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class SubIndex(expr: Expression, value: Int, tpe: Type, flow: Flow = UnknownFlow)
@@ -248,7 +248,7 @@ case class SubIndex(expr: Expression, value: Int, tpe: Type, flow: Flow = Unknow
def mapWidth(f: Width => Width): Expression = this
def foreachExpr(f: Expression => Unit): Unit = f(expr)
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class SubAccess(expr: Expression, index: Expression, tpe: Type, flow: Flow = UnknownFlow)
@@ -259,7 +259,7 @@ case class SubAccess(expr: Expression, index: Expression, tpe: Type, flow: Flow
def mapWidth(f: Width => Width): Expression = this
def foreachExpr(f: Expression => Unit): Unit = { f(expr); f(index) }
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class Mux(cond: Expression, tval: Expression, fval: Expression, tpe: Type = UnknownType) extends Expression {
@@ -269,7 +269,7 @@ case class Mux(cond: Expression, tval: Expression, fval: Expression, tpe: Type =
def mapWidth(f: Width => Width): Expression = this
def foreachExpr(f: Expression => Unit): Unit = { f(cond); f(tval); f(fval) }
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class ValidIf(cond: Expression, value: Expression, tpe: Type) extends Expression {
def serialize: String = s"validif(${cond.serialize}, ${value.serialize})"
@@ -278,7 +278,7 @@ case class ValidIf(cond: Expression, value: Expression, tpe: Type) extends Expre
def mapWidth(f: Width => Width): Expression = this
def foreachExpr(f: Expression => Unit): Unit = { f(cond); f(value) }
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
abstract class Literal extends Expression {
val value: BigInt
@@ -290,8 +290,8 @@ case class UIntLiteral(value: BigInt, width: Width) extends Literal {
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = UIntLiteral(value, f(width))
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
def foreachWidth(f: Width => Unit): Unit = f(width)
}
object UIntLiteral {
@@ -313,8 +313,8 @@ case class SIntLiteral(value: BigInt, width: Width) extends Literal {
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = SIntLiteral(value, f(width))
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
def foreachWidth(f: Width => Unit): Unit = f(width)
}
object SIntLiteral {
@@ -330,8 +330,8 @@ case class FixedLiteral(value: BigInt, width: Width, point: Width) extends Liter
def mapExpr(f: Expression => Expression): Expression = this
def mapType(f: Type => Type): Expression = this
def mapWidth(f: Width => Width): Expression = FixedLiteral(value, f(width), f(point))
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
def foreachWidth(f: Width => Unit): Unit = { f(width); f(point) }
}
case class DoPrim(op: PrimOp, args: Seq[Expression], consts: Seq[BigInt], tpe: Type) extends Expression {
@@ -342,7 +342,7 @@ case class DoPrim(op: PrimOp, args: Seq[Expression], consts: Seq[BigInt], tpe: T
def mapWidth(f: Width => Width): Expression = this
def foreachExpr(f: Expression => Unit): Unit = args.foreach(f)
def foreachType(f: Type => Unit): Unit = f(tpe)
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
abstract class Statement extends FirrtlNode {
@@ -364,8 +364,8 @@ case class DefWire(info: Info, name: String, tpe: Type) extends Statement with I
def mapType(f: Type => Type): Statement = DefWire(info, name, f(tpe))
def mapString(f: String => String): Statement = DefWire(info, f(name), tpe)
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
- def foreachExpr(f: Expression => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
+ def foreachExpr(f: Expression => Unit): Unit = ()
def foreachType(f: Type => Unit): Unit = f(tpe)
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)
@@ -386,7 +386,7 @@ case class DefRegister(
def mapType(f: Type => Type): Statement = this.copy(tpe = f(tpe))
def mapString(f: String => String): Statement = this.copy(name = f(name))
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = { f(clock); f(reset); f(init) }
def foreachType(f: Type => Unit): Unit = f(tpe)
def foreachString(f: String => Unit): Unit = f(name)
@@ -405,8 +405,8 @@ case class DefInstance(info: Info, name: String, module: String, tpe: Type = Unk
def mapType(f: Type => Type): Statement = this.copy(tpe = f(tpe))
def mapString(f: String => String): Statement = this.copy(name = f(name))
def mapInfo(f: Info => Info): Statement = this.copy(f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
- def foreachExpr(f: Expression => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
+ def foreachExpr(f: Expression => Unit): Unit = ()
def foreachType(f: Type => Unit): Unit = f(tpe)
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)
@@ -446,8 +446,8 @@ case class DefMemory(
def mapType(f: Type => Type): Statement = this.copy(dataType = f(dataType))
def mapString(f: String => String): Statement = this.copy(name = f(name))
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
- def foreachExpr(f: Expression => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
+ def foreachExpr(f: Expression => Unit): Unit = ()
def foreachType(f: Type => Unit): Unit = f(dataType)
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)
@@ -459,9 +459,9 @@ case class DefNode(info: Info, name: String, value: Expression) extends Statemen
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = DefNode(info, f(name), value)
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = f(value)
- def foreachType(f: Type => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)
}
@@ -482,8 +482,8 @@ case class Conditionally(
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
def foreachStmt(f: Statement => Unit): Unit = { f(conseq); f(alt) }
def foreachExpr(f: Expression => Unit): Unit = f(pred)
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
@@ -520,10 +520,10 @@ case class Block(stmts: Seq[Statement]) extends Statement {
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this
def foreachStmt(f: Statement => Unit): Unit = stmts.foreach(f)
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
- def foreachInfo(f: Info => Unit): Unit = Unit
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
+ def foreachInfo(f: Info => Unit): Unit = ()
}
case class PartialConnect(info: Info, loc: Expression, expr: Expression) extends Statement with HasInfo {
def serialize: String = s"${loc.serialize} <- ${expr.serialize}" + info.serialize
@@ -532,10 +532,10 @@ case class PartialConnect(info: Info, loc: Expression, expr: Expression) extends
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = { f(loc); f(expr) }
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
case class Connect(info: Info, loc: Expression, expr: Expression) extends Statement with HasInfo {
@@ -545,10 +545,10 @@ case class Connect(info: Info, loc: Expression, expr: Expression) extends Statem
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = { f(loc); f(expr) }
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
case class IsInvalid(info: Info, expr: Expression) extends Statement with HasInfo {
@@ -558,10 +558,10 @@ case class IsInvalid(info: Info, expr: Expression) extends Statement with HasInf
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = f(expr)
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
case class Attach(info: Info, exprs: Seq[Expression]) extends Statement with HasInfo {
@@ -571,10 +571,10 @@ case class Attach(info: Info, exprs: Seq[Expression]) extends Statement with Has
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = exprs.foreach(f)
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
case class Stop(info: Info, ret: Int, clk: Expression, en: Expression) extends Statement with HasInfo {
@@ -584,10 +584,10 @@ case class Stop(info: Info, ret: Int, clk: Expression, en: Expression) extends S
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = { f(clk); f(en) }
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
case class Print(
@@ -606,10 +606,10 @@ case class Print(
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = { args.foreach(f); f(clk); f(en) }
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
@@ -636,10 +636,10 @@ case class Verification(
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachExpr(f: Expression => Unit): Unit = { f(clk); f(pred); f(en); }
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
def foreachInfo(f: Info => Unit): Unit = f(info)
}
// end formal
@@ -651,11 +651,11 @@ case object EmptyStmt extends Statement {
def mapType(f: Type => Type): Statement = this
def mapString(f: String => String): Statement = this
def mapInfo(f: Info => Info): Statement = this
- def foreachStmt(f: Statement => Unit): Unit = Unit
- def foreachExpr(f: Expression => Unit): Unit = Unit
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachString(f: String => Unit): Unit = Unit
- def foreachInfo(f: Info => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
+ def foreachExpr(f: Expression => Unit): Unit = ()
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachString(f: String => Unit): Unit = ()
+ def foreachInfo(f: Info => Unit): Unit = ()
}
abstract class Width extends FirrtlNode {
@@ -805,14 +805,14 @@ abstract class Type extends FirrtlNode {
abstract class GroundType extends Type {
val width: Width
def mapType(f: Type => Type): Type = this
- def foreachType(f: Type => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
}
object GroundType {
def unapply(ground: GroundType): Option[Width] = Some(ground.width)
}
abstract class AggregateType extends Type {
def mapWidth(f: Width => Width): Type = this
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class UIntType(width: Width) extends GroundType {
def serialize: String = "UInt" + width.serialize
@@ -925,20 +925,20 @@ case object ClockType extends GroundType {
val width = IntWidth(1)
def serialize: String = "Clock"
def mapWidth(f: Width => Width): Type = this
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
/* Abstract reset, will be inferred to UInt<1> or AsyncReset */
case object ResetType extends GroundType {
val width = IntWidth(1)
def serialize: String = "Reset"
def mapWidth(f: Width => Width): Type = this
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case object AsyncResetType extends GroundType {
val width = IntWidth(1)
def serialize: String = "AsyncReset"
def mapWidth(f: Width => Width): Type = this
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachWidth(f: Width => Unit): Unit = ()
}
case class AnalogType(width: Width) extends GroundType {
def serialize: String = "Analog" + width.serialize
@@ -949,8 +949,8 @@ case object UnknownType extends Type {
def serialize: String = "?"
def mapType(f: Type => Type): Type = this
def mapWidth(f: Width => Width): Type = this
- def foreachType(f: Type => Unit): Unit = Unit
- def foreachWidth(f: Width => Unit): Unit = Unit
+ def foreachType(f: Type => Unit): Unit = ()
+ def foreachWidth(f: Width => Unit): Unit = ()
}
/** [[Port]] Direction */
@@ -1046,7 +1046,7 @@ case class ExtModule(
def mapPort(f: Port => Port): DefModule = this.copy(ports = ports map f)
def mapString(f: String => String): DefModule = this.copy(name = f(name))
def mapInfo(f: Info => Info): DefModule = this.copy(f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
def foreachPort(f: Port => Unit): Unit = ports.foreach(f)
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)
diff --git a/src/main/scala/firrtl/options/OptionParser.scala b/src/main/scala/firrtl/options/OptionParser.scala
index 986c5a8a..9360a961 100644
--- a/src/main/scala/firrtl/options/OptionParser.scala
+++ b/src/main/scala/firrtl/options/OptionParser.scala
@@ -11,7 +11,7 @@ case object OptionsHelpException extends Exception("Usage help invoked")
/** OptionParser mixin that causes the OptionParser to not call exit (call `sys.exit`) if the `--help` option is
* passed */
trait DoNotTerminateOnExit { this: OptionParser[_] =>
- override def terminate(exitState: Either[String, Unit]): Unit = Unit
+ override def terminate(exitState: Either[String, Unit]): Unit = ()
}
/** OptionParser mixin that converts to [[OptionsException]]
@@ -28,7 +28,7 @@ trait ExceptOnError { this: OptionParser[_] =>
*/
trait DuplicateHandling extends OptionParser[AnnotationSeq] {
- override def parse(args: Seq[String], init: AnnotationSeq): Option[AnnotationSeq] = {
+ override def parse(args: scala.collection.Seq[String], init: AnnotationSeq): Option[AnnotationSeq] = {
/** Message for found duplicate options */
def msg(x: String, y: String) = s"""Duplicate $x "$y" (did your custom Transform or OptionsManager add this?)"""
diff --git a/src/main/scala/firrtl/options/Phase.scala b/src/main/scala/firrtl/options/Phase.scala
index 33e1dbb7..2a68251d 100644
--- a/src/main/scala/firrtl/options/Phase.scala
+++ b/src/main/scala/firrtl/options/Phase.scala
@@ -89,7 +89,7 @@ trait IdentityLike[A] { this: TransformLike[A] =>
* @param a an input object
* @return nothing
*/
- protected def internalTransform(a: A): Unit = Unit
+ protected def internalTransform(a: A): Unit = ()
/** This method will execute `internalTransform` and then return the original input object
* @param a an input object
diff --git a/src/main/scala/firrtl/passes/memlib/MemIR.scala b/src/main/scala/firrtl/passes/memlib/MemIR.scala
index afba7535..2781f1e2 100644
--- a/src/main/scala/firrtl/passes/memlib/MemIR.scala
+++ b/src/main/scala/firrtl/passes/memlib/MemIR.scala
@@ -48,8 +48,8 @@ case class DefAnnotatedMemory(
writeLatency, readLatency, readers, writers,
readwriters, readUnderWrite)
def mapInfo(f: Info => Info): Statement = this.copy(info = f(info))
- def foreachStmt(f: Statement => Unit): Unit = Unit
- def foreachExpr(f: Expression => Unit): Unit = Unit
+ def foreachStmt(f: Statement => Unit): Unit = ()
+ def foreachExpr(f: Expression => Unit): Unit = ()
def foreachType(f: Type => Unit): Unit = f(dataType)
def foreachString(f: String => Unit): Unit = f(name)
def foreachInfo(f: Info => Unit): Unit = f(info)