diff options
| author | chick | 2019-12-12 12:06:15 -0800 |
|---|---|---|
| committer | chick | 2019-12-18 13:57:50 -0800 |
| commit | 0bcce65d5e3001b1b7098aa2c1ccd60fcc2a6628 (patch) | |
| tree | ba737c4c886005552b0e95fb48f5ff5cbdc31ea9 /chiselFrontend/src/main/scala/chisel3/package.scala | |
| parent | 954cc41e1349d0df6d2250d6270590340cd36e82 (diff) | |
- New trait HasBinaryPoint which provides literal values as double and big decimal
- made .F and .I work for creating fixed point and interval lits from big decimal
- Added NumObject trait which provides new math conversions
- Made a Num object that extends NumObject
- Add this trait to FixedPoint and Interval for backward compatibility
- Removed code that is now in NumObject, keeping things DRY
- Add tests to FixedPointSpec to show lit conversion to double and big decimal
- Add tests to IntervalSpec to show lit conversion to double and big decimal
- Add tests to LiteralExtractorSpec to show general math conversions between BigInts with binary points and double and big decimal
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/package.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/package.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/package.scala b/chiselFrontend/src/main/scala/chisel3/package.scala index 3af21d57..65bfdeb7 100644 --- a/chiselFrontend/src/main/scala/chisel3/package.scala +++ b/chiselFrontend/src/main/scala/chisel3/package.scala @@ -115,6 +115,9 @@ package object chisel3 { // scalastyle:ignore package.object.name implicit class fromDoubleToLiteral(double: Double) extends experimental.FixedPoint.Implicits.fromDoubleToLiteral(double) + implicit class fromBigDecimalToLiteral(bigDecimal: BigDecimal) + extends experimental.FixedPoint.Implicits.fromBigDecimalToLiteral(bigDecimal) + // Interval is experimental for now, but we alias the implicit conversion classes here // to minimize disruption with existing code. implicit class fromIntToLiteralInterval(int: Int) |
