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

Chisel compile warning: random LFSR16 #2355

Merged
merged 1 commit into from
Mar 27, 2020
Merged

Chisel compile warning: random LFSR16 #2355

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/ICache.scala:191:14: method apply in object LFSR16 is deprecated (since 3.2): Use chisel3.util.random.LFSR(16) for a 16-bit LFSR
[warn]     val v0 = LFSR16(refill_fire)(log2Up(nWays)-1,0)
[warn]              ^
[warn] /rocket-chip/src/main/scala/tilelink/Arbiter.scala:100:14: method apply in object LFSR16 is deprecated (since 3.2): Use chisel3.util.random.LFSR(16) for a 16-bit LFSR
[warn]   val lfsr = LFSR16(Bool(true))
[warn]              ^
[warn] /rocket-chip/src/main/scala/util/ECC.scala:186:14: method apply in object LFSR16 is deprecated (since 3.2): Use chisel3.util.random.LFSR(16) for a 16-bit LFSR
[warn]     UIntToOH(LFSR16()(log2Up(width)+f-1,0))(width-1,0)
[warn]              ^
[warn] /rocket-chip/src/main/scala/util/Misc.scala:157:28: method apply in object LFSR16 is deprecated (since 3.2): Use chisel3.util.random.LFSR(16) for a 16-bit LFSR
[warn]   private def randomizer = LFSR16()
[warn]                            ^
[warn] /rocket-chip/src/main/scala/util/Replacement.scala:17:14: method apply in object LFSR16 is deprecated (since 3.2): Use chisel3.util.random.LFSR(16) for a 16-bit LFSR
[warn]   val lfsr = LFSR16(replace)
[warn]              ^

@ingallsj ingallsj requested review from aswaterman and terpstra March 22, 2020 21:45
@ingallsj ingallsj changed the title Chisel compile warning: Chisel compile warning: random LFSR16 Mar 22, 2020
@seldridge
Copy link
Member

Note: that the get the exact behavior of LFSR16 you need to use a special construction:

FibonacciLFSR
  .maxPeriod(16, increment, seed = Some(BigInt(1) << 15))
  .asBools
  .reverse

The new LFSR works in reverse of the old one.

@ingallsj
Copy link
Contributor Author

ingallsj commented Mar 22, 2020

Note: that the get the exact behavior of LFSR16 you need to use a special construction:
The new LFSR works in reverse of the old one.

Noted, and thanks, I didn't know that difference.
For all of these purposes, the new behavior (with minimal code bloat) should be fine too: we aren't trying for predictable behavior from the pseudo-random generators. :)

@aswaterman
Copy link
Member

Yeah, the semantic difference is fine in this case

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