Xilinx
Block Preview

Introduction

On a rising edge of START the block captures $K$ consecutive input samples ($K$ = kernel length), then computes every point of the linear convolution

$$ y[p] = \sum_{m} x[m] \cdot h[p-m], \quad p = 0 \ldots 2K-2 $$

where terms with $p-m$ outside $0..K-1$ are zero. The whole graph is first computed into an internal buffer, then streamed out as a single burst: DV stays high for $2K-1$ consecutive clocks while OUT / INDEX advance once per clock (FIRST on $p=0$, LAST on $p=2K-2$). Outside the burst OUT and INDEX are 0 and DV is low.

The whole computation uses a single MAC (II=1): each point takes K clocks, so the burst starts roughly $K + K(2K-1)$ clocks after the trigger and lasts $2K-1$ clocks.

Double-clicking the block opens the Convolution Designer: paste or load the kernel coefficients (float or integer), pick the quantisation width, preview the convolution against selectable example signals (impulse, step, Gaussian, exponential decay, sine burst, chirp, noise) or a custom test signal loaded from file, and export the quantised kernel as CSV in decimal or hex.

Pin Description

IN Input InputSize bit BIT VECTOR
Signed input samples. Sampled during the COLLECT phase only.
Default: Must be connected
START Input 1 bit BIT
Trigger, rising-edge sensitive. Ignored while BUSY=1.
Default: Must be connected
CLK Input 1 bit BIT
Clock.
Default: Default Board Clock
OUT Output InputSize+CoefSize+ceil(log2(K)) bit BIT VECTOR
Convolution point y[p]. Signed. Valid when DV=1.
INDEX Output ceil(log2(2K-1)) bit BIT VECTOR
Index p of the point on OUT (0 .. 2K-2). Valid when DV=1.
DV Output 1 bit BIT
One-clock pulse for every produced convolution point.
FIRST Output 1 bit BIT
Pulses with the first point (p=0).
LAST Output 1 bit BIT
Pulses with the last point (p=2K-2).
BUSY Output 1 bit BIT
High from START to LAST.

Properties

Input Bit Width InputSize

Bit width of the signed input samples.

Bit width of the signed input samples: 16, 24 or 32.

Default: 16

Options: 16 24 32

Coefficient Bit Width CoefSize

Bit width of each kernel coefficient (signed).

Bit width of each quantised kernel coefficient (signed), 8..32.

Default: 16

Options: 8 10 12 14 16 18 20 24 28 32

Kernel Length KernelLen

Number of kernel coefficients K. The IP captures K samples after START. Mirrored from the Convolution Designer.

Number of kernel coefficients K (2..4096). Mirrored automatically from the Convolution Designer when you save the kernel.

Default: 64

Range: 2 – 4096

Kernel (JSON, use editor) ConvProject

Quantised kernel + designer state, produced by the Convolution Designer.

Parallel MACs ParallelMacs

Number of parallel MAC units P (1 .. KernelLen, clamped to KernelLen at compile time). Each convolution point takes ceil(K/P) clocks, the whole graph ~ (2K-1)*ceil(K/P) clocks plus the 2K-1 clock output burst. Cost: P multipliers and P memory banks.

Number of parallel MAC units P (1..K, clamped to KernelLen at compile time). Each convolution point takes $\lceil K/P \rceil$ clocks, so the full graph costs about $(2K-1)\cdot\lceil K/P \rceil$ clocks plus the $2K-1$ clock output burst. Use it to keep up with high trigger rates: triggers arriving while BUSY is high are ignored, so choose P such that the total processing time fits inside the minimum trigger period. Cost: P multipliers (DSP) and P input-buffer banks; with P = K each point takes a single clock.

Default: 1

Range: 1 – 4096

Operation

Phase Duration (clocks) Description
IDLE - waiting for START rising edge
COLLECT K captures K input samples into BRAM
COMPUTE ~K * (2K-1) one MAC per clock; each finished point is streamed out with DV=1

BUSY is high outside IDLE. FIRST marks point 0, LAST marks point 2K-2 (after which the block returns to IDLE and can be re-triggered).

Output width

$$ \text{OUT_BITS} = \text{InputSize} + \text{CoefSize} + \lceil \log_2 K \rceil $$

Full precision - no truncation or rounding inside the IP.

The Convolution Designer

  • Kernel generator (spectroscopy): built-in presets - Triangular, Rectangular (boxcar), Parabolic, Cusp, Cusp with flat top (sinh), Gaussian, Gaussian with flat top, Semi-Gaussian CR-RC^n (n = 1..8), Savitzky-Golay (smooth / 1st / 2nd derivative, poly order 2..6), Gaussian derivative of order n (1 = timing, 2 = mexican hat), Morlet wavelet, CFD (delayed - fraction) and boxcar-difference (PSD gates) - plus a fully parametric trapezoid family generator: total length, shaping time, edge concavity (0 = rectangle, 1 = triangle/trapezoid, 2 = parabola, >4 = cusp) and optional negative parabolic lobes (before / after / both) with adjustable distance (down to fully overlapped on the trapezoid) and an enforced zero-area constraint. A global zero-mean option makes any generated kernel baseline-insensitive.
  • Deconvolution (preamp model): pulse model with exponential rise time and up to 3 decay constants with relative amplitudes ($p(t)=\sum A_i e^{-t/\tau_i} - \sum A_i, e^{-t/\tau_{rise}}$). Each exponential is cancelled by a $(1-d,z^{-1})$ FIR stage; an optional sharpen step divides out the short residual with a truncated inverse so the deconvolved pulse tends to a delta. When enabled, the operator is convolved into every generated kernel: trapezoid + single tau = the classic Jordanov pole-zero trapezoid (flat top stays flat on real preamp signals). Also available as a stand-alone preset (“Deconvolution operator”) and as a button that applies it to the current pasted/loaded kernel.
  • Coefficients: textarea paste or CSV/TXT file load. Float values are quantised to CoefSize bits with an automatic power-of-2 scale (the shift is reported); integer values are used as-is (clamped).
  • Test signals: impulse, step, square pulse, Gaussian, exponential decay, sine burst, chirp, noise - or a custom signal loaded from file.
  • Preview: kernel stem plot, test window, full offline convolution.
  • Export: quantised kernel as CSV, decimal or hex.