Backpressure-aware, lossless 1-stage streaming pipeline
(Elastic Buffer / AXI-Stream Register Slice Equivalent)
| Aspect | Detail |
|---|---|
| Problem | Reliable data transfer under backpressure |
| Solution | 1-stage valid-ready pipeline (elastic buffer) |
| Guarantee | No data loss, no overwrite, in-order delivery |
| Latency | 1 cycle |
| Throughput | 1 txn / cycle (no stalls) |
| Result | PASS 20 / 20 |
In synchronous digital systems, producer and consumer operate at independent rates. Without proper flow control:
- โ Data loss under backpressure
- โ Overwrite of unconsumed data
- โ Ordering violations
- โ Non-deterministic throughput
Design and verify a pipeline stage that:
- โ Guarantees lossless transfer
- โ Handles arbitrary backpressure
- โ Preserves strict ordering
- โ Ensures cycle-accurate deterministic behavior
A transaction occurs iff:
valid && readyflowchart LR
%% =========================
%% DATA PATH
%% =========================
P[Producer] -->|data| B[Pipeline Register]
B -->|data| C[Consumer]
%% =========================
%% CONTROL SIGNALS
%% =========================
P -->|valid| B
C -->|ready| B
%% =========================
%% STATE MACHINE (TIED TO PIPELINE)
%% =========================
E[EMPTY slot_full=0] -->|valid| F[FULL slot_full=1]
F -->|ready| E
F -.holds data.-> B
%% =========================
%% CORE BEHAVIOR (MATCHES TIMING)
%% =========================
B -->|valid & ready โ transfer| C
B -->|valid & !ready โ hold| B
%% =========================
%% INVARIANTS (MATCHES SVA)
%% =========================
I1[Transfer iff valid AND ready]
I2[Data stable when valid AND NOT ready]
I1 --> B
I2 --> B
Equivalent to a 1-depth elastic buffer / AXI-Stream register slice
| Component | Role |
|---|---|
data_reg |
Holds current transaction |
slot_full |
Indicates valid data present |
txn_count |
Counts completed transfers |
| Condition | Action |
|---|---|
| full + ready | consume |
| empty + valid | load |
| full + !ready | stall (hold data) |
- Generator
- Driver
- Monitor
- Scoreboard (mailbox-based)
- Random data
- Random delay (1โ5 cycles)
- Random backpressure (0โ8 cycles)
// Transfer occurs only on handshake
property handshake_transfer;
@(posedge clk) (valid && ready) |-> ##1 txn_count == $past(txn_count) + 1;
endproperty
assert property (handshake_transfer);
// Data must remain stable under backpressure
property data_stable_on_stall;
@(posedge clk) (valid && !ready) |-> $stable(data_reg);
endproperty
assert property (data_stable_on_stall);
// No overwrite before consumption
property no_overwrite;
@(posedge clk) (slot_full && !ready) |-> $stable(data_reg);
endproperty
assert property (no_overwrite);covergroup handshake_cg @(posedge clk);
coverpoint valid;
coverpoint ready;
cross valid, ready;
endgroupClock โโ_โโโ_โโโ_โโโ_โโโ_โโโ_โโโ_โโโ
valid โโโ โ โ โ โ โ โ โ โโโโโ โ โ โ โ โ โ โ โโโโโโโโ
ready โโโโโโ โ โ โ โ โ โ โ โโโโโโโ โ โ โ โ โ โโโโ
data === A === B === B === C === D ===
handshake โ โ โ โ
A B C D
txn_count 0 โ 1 โ 2 โ 2 โ 3 โ 4
- โ Transfer only when
valid && ready - โ Data stable during stall
- โ No overwrite
- โ Count increments only on handshake
โ Handshake correctness โ Backpressure handling โ Stable data โ In-order execution
| Metric | Status |
|---|---|
| Transactions | 20 |
| PASS | 20 |
| FAIL | 0 |
| Assertions | PASS |
| Data Integrity | Verified |
| Metric | Value |
|---|---|
| Latency | 1 cycle |
| Throughput | 1 txn/cycle |
| Backpressure | Lossless |
xvlog src/pipeline_dut.sv sim/transaction.sv sim/tb_pipeline.sv
xelab tb_pipeline -s tb_pipeline_sim
xsim tb_pipeline_sim -run allsrc/
โโโ pipeline_dut.sv
sim/
โโโ tb_pipeline.sv
โโโ transaction.sv
waveform.png
README.md
.gitignore
- AXI-Stream pipelines
- Network-on-Chip routers
- DSP streaming systems
- FIFO front-end buffering
- Multi-stage FIFO
- Skid buffer design
- AXI-Stream wrapper
- UVM verification environment
- Coverage closure metrics
1. Transfer โ valid && ready
2. Data stable when valid && !ready
3. No overwrite before consumption
4. txn_count increments only on handshake
Arya Dinesh
B.Tech Electronics & Communication Engineering
๐ซ Letโs connect: www.linkedin.com/in/aryadinesh2005
โญ If you found this project interesting, feel free to star this repository!
๐ง Open for collaboration or discussion on FPGA, digital design, and embedded systems.
