Master/slave interface
Declare a port as master
or slave
Declare a port as master
or slave
There are 4 available syntaxes, which are all equivalent:
val braces = master(Flow(Bool)) val short = master Flow (Bool) val spaceful = master port Flow(Bool) val variadic = Flow(Bool) master(variadic)
The "braces" syntax is short and generic, but it uses braces.
The "short" syntax is short, but it is formatted with a space between the type and its parameters, and it can be used only with:
Flow
Stream
The "spaceful" syntax is generic and beatiful, but more verbose.
The "variadic" syntax can be used with any number of interfaces, but can be used only if the interfaces are already declared.
Something which can create master/slave interfaces
Similar to Bundle but with bit packing capabilities.
Similar to Bundle but with bit packing capabilities. Use pack implicit functions to assign fields to bit locations - pack(Range, [Endianness]) - Packs the data into Range aligning to bit Endianness if too wide - packFrom(Position) - Packs the data starting (LSB) at Position. Uses full data length - packTo(Position) - Packs the data ending (MSB) at Position. Uses full data length
Providing no location tag will place the next data value immediately after the last.
val regWord = new PackedBundle { val init = Bool().packFrom(0) // Bit 0 val stop = Bool() // Bit 1 val result = Bits(16 bit).packTo(31) // Bits 16 to 31 }
An enhanced form of PackedBundle with Word-centric packing.
An enhanced form of PackedBundle with Word-centric packing. Offers all the same implicit packing assignment functions, but applies packing to an assigned word. - inWord(WordIndex) - Indicates which word to pack into. Must be used after a pack assigment. If no pack range was given then the entire data length will be assumed. Ranges that exceed the word will wrap into subsequent words.
Like PackedBundle, providing no pack or word assignments will place data immediately after the last.
val wordPacked = PackedWordBundle(8 bits) { val aNumber = UInt(8 bits).word(0) // Bits 7 downto 0 val bNumber = UInt(8 bits).pack(0 to 7).word(1) // Bits 8 to 15 val large = Bits(18 bits).word(2) // Bits 33 downto 16 val flag = Bool() // Bit 34
Enumeration to present order of slices.
A StreamArbiter is like a StreamMux, but with built-in complex selection logic that can arbitrate input streams based on a schedule or handle fragmented streams.
A StreamArbiter is like a StreamMux, but with built-in complex selection logic that can arbitrate input streams based on a schedule or handle fragmented streams. Use a StreamArbiterFactory to create instances of this class.
Fully redesigned in release 1.8.2 allowing improved timing closure.
Fully redesigned in release 1.8.2 allowing improved timing closure. - latency of 0, 1, 2 cycles
A StreamFork will clone each incoming data to all its output streams.
A StreamFork will clone each incoming data to all its output streams. If synchronous is true, all output streams will always fire together, which means that the stream will halt until all output streams are ready. If synchronous is false, output streams may be ready one at a time, at the cost of an additional flip flop (1 bit per output). The input stream will block until all output streams have processed each item regardlessly.
Note that this means that when synchronous is true, the valid signal of the outputs depends on their inputs, which may lead to dead locks when used in combination with systems that have it the other way around. It also violates the handshake of the AXI specification (section A3.3.1).
Packs layout
's Data into the given stream
Packs layout
's Data into the given stream
stream
is directly driven by this area.
layout
Data is read directly
io.start
indicates when to start packing. All layout
's Data is registered before packing.
io.done
indicates when the last word has been packed.
Use the companion object StreamPapcker
to create an instance.
Unpacks stream
's words into the given layout
's Data.
Unpacks stream
's words into the given layout
's Data.
stream
is directly driven by this area.
layout
Data are driven through a register.
io.start
starts unpacking
io.dones
is set of bits indicating when the associated Data in layout
is unpacked.
io.allDone
indicates when the last word has been unpacked.
Use the companion object StreamUnpacker
to create an instance.
Do not use. Use the companion object or a normal regular StreamMux instead.
Creates a counter
Creates an always running counter
Creates an always running counter
Run command
**************************************************************************** Big-Endian <-> Little-Endian
Slice with higher bits process first
Slice with lower bits process first
This is equivalent to a StreamMux, but with a counter attached to the port selector.
Demultiplex one stream into multiple output streams, always selecting only one at a time.
This is equivalent to a StreamDemux, but with a counter attached to the port selector.
Combine a stream and a flow to a new stream.
Combine a stream and a flow to a new stream. If both input sources fire, the flow will be preferred.
Join multiple streams into one.
Join multiple streams into one. The resulting stream will only fire if all of them fire, so you may want to buffer the inputs.
Multiplex multiple streams into a single one, always only processing one at a time.
Create a new Flow that is always valid, with a given payload
Declare a master port
Declare a master port
See MS for syntax help.
Declare a slave port
Declare a slave port
See MS for syntax help.
Do not use
Use apply or port instead: 'val b = master(maybeNull)' or 'val rgb = master port maybeNull'
Use apply or port instead: 'val b = slave(maybeNull)' or 'val rgb = slave port maybeNull'