LFSR

chisel3.util.random.LFSR
See theLFSR companion trait
object LFSR

Utilities related to psuedorandom number generation using Linear Feedback Shift Registers (LFSRs).

For example, to generate a pseudorandom 16-bit UInt that changes every cycle, you can use:

val pseudoRandomNumber = LFSR(16)

Attributes

Companion
trait
Source
LFSR.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LFSR.type

Members list

Value members

Concrete methods

def apply(width: Int, increment: Bool = ..., seed: Option[BigInt] = ...): UInt

Return a pseudorandom UInt generated using a FibonacciLFSR. If you require a Galois LFSR, use GaloisLFSR.maxPeriod.

Return a pseudorandom UInt generated using a FibonacciLFSR. If you require a Galois LFSR, use GaloisLFSR.maxPeriod.

Value parameters

increment

when asserted, the LFSR will increment

seed

an initial seed (this cannot be zero)

width

the width of the LFSR

Attributes

Returns

a UInt that is the output of a maximal period LFSR of the requested width

Source
LFSR.scala

Concrete fields

lazy val tapsMaxPeriod: Map[Int, Seq[Set[Int]]]

A mapping of widths to a sequence of known LFSR taps that produce a maximal period LFSR. These work for either a Fibonacci LFSR or a Galois LFSR. Taps are available for bit widths of 2--786, 1024, 2048, and 4096.

A mapping of widths to a sequence of known LFSR taps that produce a maximal period LFSR. These work for either a Fibonacci LFSR or a Galois LFSR. Taps are available for bit widths of 2--786, 1024, 2048, and 4096.

Users can automatically generate LFSRs using these taps with LFSR.apply for a maximum period Fibonacci XOR LFSR or with MaxPeriodGaloisLFSR/GaloisLFSR.maxPeriod or MaxPeriodFibonacciLFSR/FibonacciLFSR.maxPeriod for more configuration options.

Attributes

See also
Source
LFSR.scala