Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala compile warning: Use foldLeft instead of /: #2354

Merged
merged 1 commit into from
Mar 27, 2020

Conversation

ingallsj
Copy link
Contributor

Type of change: other enhancement (paying off technical debt)
Impact: no functional change
Development Phase: implementation

fix these Chisel compile warnings:

[warn] /rocket-chip/src/main/scala/rocket/PMP.scala:139:38: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]     ((true.B, 0.U.asTypeOf(new PMP)) /: pmps) { case ((h, prev), pmp) =>
[warn]                                      ^
[warn] /rocket-chip/src/main/scala/rocket/PMP.scala:163:19: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]   val res = (pmp0 /: (io.pmp zip (pmp0 +: io.pmp)).reverse) { case (prev, (pmp, prevPMP)) =>
[warn]                   ^
[warn] /rocket-chip/src/main/scala/util/package.scala:32:17: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]         (x.head /: x.zipWithIndex.tail) { case (prev, (cur, i)) => Mux(truncIdx === i.U, cur, prev) }
[warn]                 ^
[warn] /rocket-chip/src/main/scala/util/package.scala:43:10: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]       (x /: (0 until log2Ceil(x.size)))((r, i) => (r.rotate(1 << i) zip r).map { case (s, a) => Mux(amt(i), s, a) })
[warn]          ^
[warn] /rocket-chip/src/main/scala/util/package.scala:51:10: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]       (x /: (0 until log2Ceil(x.size)))((r, i) => (r.rotateRight(1 << i) zip r).map { case (s, a) => Mux(amt(i), s, a) })
[warn]          ^
[warn] /rocket-chip/src/main/scala/util/package.scala:137:10: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]       (x /: (0 until log2Ceil(x.getWidth)))((r, i) => Mux(amt(i), r.rotateRight(1 << i), r))
[warn]          ^
[warn] /rocket-chip/src/main/scala/util/package.scala:144:10: method /: in trait TraversableOnce is deprecated (since 2.12.10): Use foldLeft instead of /:
[warn]       (x /: (0 until log2Ceil(x.getWidth)))((r, i) => Mux(amt(i), r.rotateLeft(1 << i), r))
[warn]          ^

@ingallsj ingallsj merged commit 6ac7132 into master Mar 27, 2020
@ingallsj ingallsj deleted the warn-foldLeftSlash branch March 27, 2020 01:35
@jackkoenig
Copy link
Contributor

Not that it matters but this is a deprecation from the Scala collections library, not Chisel 😜

@ingallsj ingallsj changed the title Chisel compile warning: Use foldLeft instead of /: Scala compile warning: Use foldLeft instead of /: Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants