summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main
diff options
context:
space:
mode:
authorchick2019-12-11 12:51:25 -0800
committerchick2019-12-11 12:51:25 -0800
commit1d5b067ee8f025b4eddb5a293be0a2d624610056 (patch)
treeed82d3d2839534a659e97e668d77624334c8f92e /chiselFrontend/src/main
parent69ae14b485c67834ad3c9c518ef080cf75ce9b1d (diff)
- Change getPossibleValues of Interval to return a NumericRange former Seq materialized all values
- Fixed computation in getHighestPossibleValue, erroneously was using lower intead of upper
Diffstat (limited to 'chiselFrontend/src/main')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/internal/firrtl/IR.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/internal/firrtl/IR.scala b/chiselFrontend/src/main/scala/chisel3/internal/firrtl/IR.scala
index bc662ddb..e76a8d60 100644
--- a/chiselFrontend/src/main/scala/chisel3/internal/firrtl/IR.scala
+++ b/chiselFrontend/src/main/scala/chisel3/internal/firrtl/IR.scala
@@ -9,6 +9,7 @@ import chisel3.experimental._
import _root_.firrtl.{ir => firrtlir}
import _root_.firrtl.PrimOps
+import scala.collection.immutable.NumericRange
import scala.math.BigDecimal.RoundingMode
// scalastyle:off number.of.types
@@ -432,7 +433,7 @@ sealed class IntervalRange(
val getHighestPossibleValue: Option[BigDecimal] = {
increment match {
case Some(inc) =>
- lower match {
+ upper match {
case firrtlir.Closed(n) => Some(n)
case firrtlir.Open(n) => Some(n - inc)
case _ => None
@@ -446,7 +447,7 @@ sealed class IntervalRange(
* Mostly to be used for testing
* @return
*/
- def getPossibleValues: Seq[BigDecimal] = {
+ def getPossibleValues: NumericRange[BigDecimal] = {
(getLowestPossibleValue, getHighestPossibleValue, increment) match {
case (Some(low), Some(high), Some(inc)) => (low to high by inc)
case (_, _, None) =>