chipsalliance / chipsalliance/chisel
Why does FixedPoint get interpreted as Double when printing?
- Dominant language
- Scala
- Stars
- 4.8k
- Forks
- 658
- Avg merge
- 18h 59m
- Merged PRs (30d)
- 14
Description
Type of issue: other enhancement
Impact: potentially changes the string width of FixedPoint prints
Why does the FixedPoint toString method try to interpret is as a Double instead of BigDecimal?
```scala
override def toString: String = {
val bindingString = litToDoubleOption match {
case Some(value) => s"($value)"
case _ => bindingToString
}
s"FixedPoint$width$binaryPoint$bindingString"
}
```
This causes the printing of any FixedPoint bigger than a Double to fail.
Perhaps instead of using litToDoubleOption, we should use litToBigDecimalOption.
https://github.com/freechipsproject/chisel3/blob/2f9f12a811bf81c37da4eaf854f71a57f46e45ff/core/src/main/scala/chisel3/Bits.scala#L1234
Contributor guide
Assessment
This issue has not been assessed yet.