From d7d658d856f47e0b82ad99120631536f7652bf09 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 9 Feb 2017 16:17:18 -0800 Subject: Fix mismatch between Chisel and Firrtl on UInt -& UInt Fixes #501. Also added UIntOps test. --- chiselFrontend/src/main/scala/chisel3/core/Bits.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chiselFrontend') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala index 574184d1..fccc6f08 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala @@ -436,7 +436,7 @@ sealed class UInt private[core] (width: Width, lit: Option[ULit] = None) def do_+% (that: UInt)(implicit sourceInfo: SourceInfo): UInt = (this +& that).tail(1) def do_-& (that: UInt)(implicit sourceInfo: SourceInfo): UInt = - binop(sourceInfo, UInt((this.width max that.width) + 1), SubOp, that) + binop(sourceInfo, SInt((this.width max that.width) + 1), SubOp, that).asUInt def do_-% (that: UInt)(implicit sourceInfo: SourceInfo): UInt = (this -& that).tail(1) -- cgit v1.2.3