summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrebe2017-04-02 13:03:01 -0700
committerGitHub2017-04-02 13:03:01 -0700
commitd72bcca424808268df08466ea69e394f8dafcd57 (patch)
treea60cd7d52d596d61eab9ae5bfe3b08c471c8b481
parent8e4ddc62db448b613ae327792e72defca4d115d4 (diff)
parent19e16642cb99fbb4707ce23fa4df56963e3d39b6 (diff)
Merge pull request #564 from ucb-bar/bugfix-lost-width-on-fixed-literals
Creating FixedPoint literals was throwing away width
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Bits.scala2
-rw-r--r--src/test/scala/chiselTests/FixedPointSpec.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala
index 240f5c83..dd3a2e8b 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala
@@ -947,7 +947,7 @@ object FixedPoint {
* Use PrivateObject to force users to specify width and binaryPoint by name
*/
def fromBigInt(value: BigInt, width: Width, binaryPoint: BinaryPoint): FixedPoint = {
- apply(value, Width(), binaryPoint)
+ apply(value, width, binaryPoint)
}
/** Create an FixedPoint literal with inferred width from BigInt.
* Use PrivateObject to force users to specify width and binaryPoint by name
diff --git a/src/test/scala/chiselTests/FixedPointSpec.scala b/src/test/scala/chiselTests/FixedPointSpec.scala
index 5047ac62..76a89e6a 100644
--- a/src/test/scala/chiselTests/FixedPointSpec.scala
+++ b/src/test/scala/chiselTests/FixedPointSpec.scala
@@ -79,7 +79,7 @@ class FixedPointFromBitsTester extends BasicTester {
}
class FixedPointMuxTester extends BasicTester {
- val largeWidthLowPrecision = 6.0.F(3.W, 0.BP)
+ val largeWidthLowPrecision = 6.0.F(4.W, 0.BP)
val smallWidthHighPrecision = 0.25.F(2.W, 2.BP)
val unknownWidthLowPrecision = 6.0.F(0.BP)
val unknownFixed = Wire(FixedPoint())