summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3
diff options
context:
space:
mode:
authorJim Lawson2020-01-23 09:53:11 -0800
committerGitHub2020-01-23 09:53:11 -0800
commit481736c3ebce29932b54ac72e01d6656e4995fca (patch)
tree56de0ff88ae71326064ef9ec033594b89a84ff70 /chiselFrontend/src/main/scala/chisel3
parentc6fdad17f2135d26aae78e30a419e25c1b95ee4b (diff)
Minor changes - update comments, use MaxBitsBigIntToBigDecimal instead of '108'. (#1309)
Co-authored-by: Chick Markley <chick@qrhino.com>
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/Bits.scala4
-rw-r--r--chiselFrontend/src/main/scala/chisel3/Num.scala2
2 files changed, 3 insertions, 3 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/Bits.scala b/chiselFrontend/src/main/scala/chisel3/Bits.scala
index 633636fd..57ce98d2 100644
--- a/chiselFrontend/src/main/scala/chisel3/Bits.scala
+++ b/chiselFrontend/src/main/scala/chisel3/Bits.scala
@@ -1186,7 +1186,7 @@ package experimental {
def binaryPoint: BinaryPoint
/** Return the [[Double]] value of this instance if it is a Literal
- * @note this method may return throw an exception if the literal value won't fit in a Double
+ * @note this method may throw an exception if the literal value won't fit in a Double
*/
def litToDoubleOption: Option[Double] = {
litOption match {
@@ -1201,7 +1201,7 @@ package experimental {
def litToDouble: Double = litToDoubleOption.get
/** Return the [[BigDecimal]] value of this instance if it is a Literal
- * @note this method may return throw an exception if the literal value won't fit in a BigDecimal
+ * @note this method may throw an exception if the literal value won't fit in a BigDecimal
*/
def litToBigDecimalOption: Option[BigDecimal] = {
litOption match {
diff --git a/chiselFrontend/src/main/scala/chisel3/Num.scala b/chiselFrontend/src/main/scala/chisel3/Num.scala
index e4d61d94..7a6b0744 100644
--- a/chiselFrontend/src/main/scala/chisel3/Num.scala
+++ b/chiselFrontend/src/main/scala/chisel3/Num.scala
@@ -282,7 +282,7 @@ trait NumObject {
* @return
*/
def toBigDecimal(value: BigInt, binaryPoint: Int): BigDecimal = {
- if(value.bitLength > 108) {
+ if(value.bitLength > MaxBitsBigIntToBigDecimal) {
throw new ChiselException(
s"BigInt $value with bitlength ${value.bitLength} is too big, precision lost with > $MaxBitsBigIntToBigDecimal bits"
)