Block-based Processing
- class tiliqua.dsp.block.Block(shape)
data.StructLayoutrepresenting a ‘Block’ of samples.- shapeShape
Shape of the
samplepayload of elements in this block.
This is normally used in combination with
stream.Signature, wherevalid,readyandpayload.firstare used to delineate samples inside. Blocks are transferred one sample at a time - a practical example with blocks of length 8:|-- block 1 --| |-- block 2 --| |--- payload.sample: 0 1 2 3 4 5 6 7 8 A B C D E F G H I ... payload.first: -_______________-_______________-__ valid: -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- ready: (all ones)
Most cores here are assuming they are working with blocks of some predefined size - that is, each producer/consumer must expect the same size of
Block.- Members:
first (
unsigned(1)) – Strobe asserted for first sample in a block, deasserted otherwise.sample (
shape) – Payload of this sample in the block.
- class tiliqua.dsp.block.WrapCore(*args, src_loc_at=0, **kwargs)
Wrap a streaming component with simple
i,ostreams such that it takes/emitsBlockstreams (wherepayload.firstis tracked).This only supports simple cores that have:
An input stream
iof typestream.Signature(shape)An output stream
oof typestream.Signature(shape)
A FIFO of size
max_latencyis used to track and propagatepayload.firstfrom the input to the output of the wrapped core. The wrapped core must never store more thanmax_latencyelements in flight for this to work correctly.- Members:
i (
In(stream.Signature(Block(self.shape_i)))) – Incoming blocks, where shape of block payload is inherited from the wrapped core.o (
In(stream.Signature(Block(self.shape_o)))) – Outgoing blocks, where shape of block payload is inherited from the wrapped core.
- __init__(core, max_latency=16)
- corewiring.Component
DSP core to be wrapped.
shape_iandshape_ocome fromi.payload.shape()ando.payload.shape().- max_latencyint
Maximum amount of elements that may be in-flight inside the wrapped core.