Skip to content

Commit ccaf0b4

Browse files
committed
wip: Update Chisel from 6.5.0 to 7.0.0
`UnknownWidth` became a `case object` in this Chisel PR: chipsalliance/chisel#4242 The `connectFromBits` method was removed in this Chisel PR: chipsalliance/chisel#4168
1 parent e40a376 commit ccaf0b4

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ env:
2020
VERILATOR_REPO: https://github.com/verilator/verilator
2121
VERILATOR_DIR: verilator
2222
VERILATOR_VERSION_TAG: v4.228
23-
FIRTOOL_VERSION: v1.62.0
24-
FIRTOOL_VERSION_TAG: firtool-1.62.0
23+
FIRTOOL_VERSION: v1.77.0
24+
FIRTOOL_VERSION_TAG: firtool-1.77.0
2525

2626
jobs:
2727
test:

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ scalacOptions ++= Seq(
1212
"-language:reflectiveCalls",
1313
"-Ymacro-annotations"
1414
)
15-
val chiselVersion = "6.5.0"
15+
val chiselVersion = "7.0.0-M2"
1616
addCompilerPlugin("org.chipsalliance" %% "chisel-plugin" % chiselVersion cross CrossVersion.full)
1717
libraryDependencies ++= Seq(
1818
"org.chipsalliance" %% "chisel" % chiselVersion,

src/main/scala/fixedpoint/FixedPoint.scala

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import chisel3.util.Cat
2626
object FixedPoint extends NumObject {
2727

2828
/** Create a FixedPoint type with inferred width. */
29-
def apply(): FixedPoint = apply(UnknownWidth(), BinaryPoint())
29+
def apply(): FixedPoint = apply(UnknownWidth, BinaryPoint())
3030

3131
/** Create a FixedPoint type or port with fixed width. */
3232
def apply(width: Width, binaryPoint: BinaryPoint): FixedPoint = new FixedPoint(width, binaryPoint)
@@ -42,15 +42,15 @@ object FixedPoint extends NumObject {
4242
* Use PrivateObject to force users to specify width and binaryPoint by name
4343
*/
4444
def fromBigInt(value: BigInt, binaryPoint: BinaryPoint = 0.BP): FixedPoint = {
45-
apply(value, UnknownWidth(), binaryPoint)
45+
apply(value, UnknownWidth, binaryPoint)
4646
}
4747

4848
/** Create a FixedPoint literal with inferred width from BigInt.
4949
* Use PrivateObject to force users to specify width and binaryPoint by name
5050
*/
5151
def fromBigInt(value: BigInt, width: Int, binaryPoint: Int): FixedPoint =
5252
if (width == -1) {
53-
apply(value, UnknownWidth(), BinaryPoint(binaryPoint))
53+
apply(value, UnknownWidth, BinaryPoint(binaryPoint))
5454
} else {
5555
apply(value, KnownWidth(width), BinaryPoint(binaryPoint))
5656
}
@@ -103,7 +103,7 @@ object FixedPoint extends NumObject {
103103
}
104104

105105
private[fixedpoint] def recreateWidth[T <: Data](d: T): Width = {
106-
d.widthOption.fold[Width](UnknownWidth())(_.W)
106+
d.widthOption.fold[Width](UnknownWidth)(_.W)
107107
}
108108

109109
/** Align all FixedPoints in a (possibly heterogeneous) sequence by width and binary point
@@ -145,7 +145,7 @@ object FixedPoint extends NumObject {
145145

146146
implicit class fromDoubleToLiteral(double: Double) {
147147
def F(binaryPoint: BinaryPoint): FixedPoint = {
148-
FixedPoint.fromDouble(double, UnknownWidth(), binaryPoint)
148+
FixedPoint.fromDouble(double, UnknownWidth, binaryPoint)
149149
}
150150

151151
def F(width: Width, binaryPoint: BinaryPoint): FixedPoint = {
@@ -155,7 +155,7 @@ object FixedPoint extends NumObject {
155155

156156
implicit class fromBigDecimalToLiteral(bigDecimal: BigDecimal) {
157157
def F(binaryPoint: BinaryPoint): FixedPoint = {
158-
FixedPoint.fromBigDecimal(bigDecimal, UnknownWidth(), binaryPoint)
158+
FixedPoint.fromBigDecimal(bigDecimal, UnknownWidth, binaryPoint)
159159
}
160160

161161
def F(width: Width, binaryPoint: BinaryPoint): FixedPoint = {
@@ -325,10 +325,6 @@ sealed class FixedPoint private[fixedpoint] (width: Width, private var _inferred
325325

326326
override def bulkConnect(that: Data)(implicit sourceInfo: SourceInfo): Unit = connectOp(that, _ <> _)
327327

328-
override def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo): Unit = {
329-
this.data := that.asTypeOf(this.data)
330-
}
331-
332328
def apply(x: BigInt): Bool = data.apply(x)
333329

334330
def apply(x: Int): Bool = data.apply(x)

src/test/scala/FixedPointSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ class FixedPointFromBitsTester extends BasicTester {
7676
val f6bp0 = 6.0.F(0.BP)
7777
val f6bp2 = 6.0.F(2.BP)
7878

79-
val f1bp5shiftleft2 = Wire(FixedPoint(UnknownWidth(), BinaryPoint()))
80-
val f6bp0shiftright2 = Wire(FixedPoint(UnknownWidth(), BinaryPoint()))
81-
val f6bp2shiftright2 = Wire(FixedPoint(UnknownWidth(), BinaryPoint()))
79+
val f1bp5shiftleft2 = Wire(FixedPoint(UnknownWidth, BinaryPoint()))
80+
val f6bp0shiftright2 = Wire(FixedPoint(UnknownWidth, BinaryPoint()))
81+
val f6bp2shiftright2 = Wire(FixedPoint(UnknownWidth, BinaryPoint()))
8282

8383
f1bp5shiftleft2 := f1bp5 << 2
8484
f6bp0shiftright2 := f6bp0 >> 2

0 commit comments

Comments
 (0)