diff options
| author | Jack Koenig | 2016-06-10 18:09:19 -0700 |
|---|---|---|
| committer | Jack Koenig | 2016-06-10 18:09:19 -0700 |
| commit | c13ad522ae226bad57f341d0f93865194fb0bf76 (patch) | |
| tree | abb1a5b81693da98818a9bee79c776d421a820d1 /src | |
| parent | f162263c05643c0851c5200fff2fc356f97843cd (diff) | |
Change BoolType from method to val
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/firrtl/PrimOps.scala | 54 | ||||
| -rw-r--r-- | src/main/scala/firrtl/Utils.scala | 8 |
2 files changed, 31 insertions, 31 deletions
diff --git a/src/main/scala/firrtl/PrimOps.scala b/src/main/scala/firrtl/PrimOps.scala index c90260a3..7e8d77db 100644 --- a/src/main/scala/firrtl/PrimOps.scala +++ b/src/main/scala/firrtl/PrimOps.scala @@ -180,60 +180,60 @@ object PrimOps extends LazyLogging { } case Lt => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => Utils.BoolType() - case (t1:SIntType, t2:UIntType) => Utils.BoolType() - case (t1:UIntType, t2:SIntType) => Utils.BoolType() - case (t1:SIntType, t2:SIntType) => Utils.BoolType() + case (t1:UIntType, t2:UIntType) => Utils.BoolType + case (t1:SIntType, t2:UIntType) => Utils.BoolType + case (t1:UIntType, t2:SIntType) => Utils.BoolType + case (t1:SIntType, t2:SIntType) => Utils.BoolType case (t1, t2) => UnknownType } DoPrim(o,a,c,t) } case Leq => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => Utils.BoolType() - case (t1:SIntType, t2:UIntType) => Utils.BoolType() - case (t1:UIntType, t2:SIntType) => Utils.BoolType() - case (t1:SIntType, t2:SIntType) => Utils.BoolType() + case (t1:UIntType, t2:UIntType) => Utils.BoolType + case (t1:SIntType, t2:UIntType) => Utils.BoolType + case (t1:UIntType, t2:SIntType) => Utils.BoolType + case (t1:SIntType, t2:SIntType) => Utils.BoolType case (t1, t2) => UnknownType } DoPrim(o,a,c,t) } case Gt => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => Utils.BoolType() - case (t1:SIntType, t2:UIntType) => Utils.BoolType() - case (t1:UIntType, t2:SIntType) => Utils.BoolType() - case (t1:SIntType, t2:SIntType) => Utils.BoolType() + case (t1:UIntType, t2:UIntType) => Utils.BoolType + case (t1:SIntType, t2:UIntType) => Utils.BoolType + case (t1:UIntType, t2:SIntType) => Utils.BoolType + case (t1:SIntType, t2:SIntType) => Utils.BoolType case (t1, t2) => UnknownType } DoPrim(o,a,c,t) } case Geq => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => Utils.BoolType() - case (t1:SIntType, t2:UIntType) => Utils.BoolType() - case (t1:UIntType, t2:SIntType) => Utils.BoolType() - case (t1:SIntType, t2:SIntType) => Utils.BoolType() + case (t1:UIntType, t2:UIntType) => Utils.BoolType + case (t1:SIntType, t2:UIntType) => Utils.BoolType + case (t1:UIntType, t2:SIntType) => Utils.BoolType + case (t1:SIntType, t2:SIntType) => Utils.BoolType case (t1, t2) => UnknownType } DoPrim(o,a,c,t) } case Eq => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => Utils.BoolType() - case (t1:SIntType, t2:UIntType) => Utils.BoolType() - case (t1:UIntType, t2:SIntType) => Utils.BoolType() - case (t1:SIntType, t2:SIntType) => Utils.BoolType() + case (t1:UIntType, t2:UIntType) => Utils.BoolType + case (t1:SIntType, t2:UIntType) => Utils.BoolType + case (t1:UIntType, t2:SIntType) => Utils.BoolType + case (t1:SIntType, t2:SIntType) => Utils.BoolType case (t1, t2) => UnknownType } DoPrim(o,a,c,t) } case Neq => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => Utils.BoolType() - case (t1:SIntType, t2:UIntType) => Utils.BoolType() - case (t1:UIntType, t2:SIntType) => Utils.BoolType() - case (t1:SIntType, t2:SIntType) => Utils.BoolType() + case (t1:UIntType, t2:UIntType) => Utils.BoolType + case (t1:SIntType, t2:UIntType) => Utils.BoolType + case (t1:UIntType, t2:SIntType) => Utils.BoolType + case (t1:SIntType, t2:SIntType) => Utils.BoolType case (t1, t2) => UnknownType } DoPrim(o,a,c,t) @@ -352,21 +352,21 @@ object PrimOps extends LazyLogging { } case Andr => { val t = (t1()) match { - case (_:UIntType|_:SIntType) => Utils.BoolType() + case (_:UIntType|_:SIntType) => Utils.BoolType case (t1) => UnknownType } DoPrim(o,a,c,t) } case Orr => { val t = (t1()) match { - case (_:UIntType|_:SIntType) => Utils.BoolType() + case (_:UIntType|_:SIntType) => Utils.BoolType case (t1) => UnknownType } DoPrim(o,a,c,t) } case Xorr => { val t = (t1()) match { - case (_:UIntType|_:SIntType) => Utils.BoolType() + case (_:UIntType|_:SIntType) => Utils.BoolType case (t1) => UnknownType } DoPrim(o,a,c,t) diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index 863f079f..a5253e84 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -76,7 +76,7 @@ object Utils extends LazyLogging { def ceil_log2(x: Int): Int = scala.math.ceil(scala.math.log(x) / scala.math.log(2)).toInt val gen_names = Map[String,Int]() val delin = "_" - def BoolType () = { UIntType(IntWidth(1)) } + val BoolType = UIntType(IntWidth(1)) val one = UIntLiteral(BigInt(1),IntWidth(1)) val zero = UIntLiteral(BigInt(0),IntWidth(1)) def uint (i:Int) : UIntLiteral = { @@ -122,8 +122,8 @@ object Utils extends LazyLogging { val fieldss = t.fields.map { f => Field(f.name,f.flip,create_mask(f.tpe)) } BundleType(fieldss) } - case t:UIntType => BoolType() - case t:SIntType => BoolType() + case t:UIntType => BoolType + case t:SIntType => BoolType } } def create_exps (n:String, t:Type) : Seq[Expression] = @@ -527,7 +527,7 @@ object Utils extends LazyLogging { case s:DefMemory => { val depth = s.depth val addr = Field("addr",Default,UIntType(IntWidth(scala.math.max(ceil_log2(depth), 1)))) - val en = Field("en",Default,BoolType()) + val en = Field("en",Default,BoolType) val clk = Field("clk",Default,ClockType) val def_data = Field("data",Default,s.dataType) val rev_data = Field("data",Flip,s.dataType) |
