Forum Discussion
---
## Solutions
### **Solution 1: Fix the DSP Source (Best Practice)**
Modify your DSP output interface so that `valid` remains asserted until `valid & ready = 1`:
```
If (data_available):
valid <= 1
data <= <packet_data>
Else If (valid & ready):
valid <= 0 // Only deassert after successful handshake
Else:
valid <= valid // Hold valid asserted
```
This is the protocol-compliant solution and requires no additional IP.
---
### **Solution 2: Add Input FIFOs (Practical for Complex DSP Pipelines)**
Insert an **Avalon Streaming FIFO** before each of your 32 DSP channels at the mux inputs:
```
DSP_Channel_0 --> [FIFO] --> 16-to-1 Mux Input 0
DSP_Channel_1 --> [FIFO] --> 16-to-1 Mux Input 1
...
DSP_Channel_31 --> [FIFO] --> 16-to-1 Mux Input 15 (Second group)
```
**Benefits:**
- The FIFO accepts your single-cycle pulse
- Holds `valid` asserted until the mux grants `ready`
- Completely decouples your DSP timing from the scheduler
- Adds minimal latency (typically 1–2 cycles per FIFO)
- Works with any scheduling configuration
**Configuration in Platform Designer:**
- FIFO depth: 16–32 (sufficient for burst absorption)
- Single-clock FIFO (matches your system clock domain)
- No packet support needed unless your DSP already uses it
---
### **Solution 3: Increase Scheduling Size (Mitigation Only)**
Increasing from Scheduling Size = 2 to a higher value (e.g., 8–16) gives each channel a longer arbitration window, but **does not solve the underlying protocol issue**. Your sources should still not pulse `valid` for a single cycle. This is a workaround, not a solution.
---
## Verification Approach
After implementing Solution 1 or 2, verify with SignalTap:
1. **At mux inputs**: Confirm that `valid` remains high until `valid & ready = 1` on the same cycle for all channels.
2. **At mux output**: Set trigger on rising edge of output `valid` for each channel and confirm triggers fire for all 32 channels.
3. **Data integrity**: Verify that packets from all channels contain correct channel IDs and data.
---
## Why Cascaded Muxes Don't Hide the Issue
Your 32-to-1 cascaded architecture is sound, but the scheduler starvation propagates through each stage:
- If channels 1–31 don't transfer at the first 16-to-1 mux stage, they never reach the second stage.
- The final 2-to-1 mux then only multiplexes channels from whichever group wins arbitration.
The data path to HPS works (proven by your emulator), so this is purely an input arbitration issue.
---
## So in summary
**Root Cause**: Your DSP sources violate the Avalon-ST protocol by pulsing `valid` for only 1 cycle. The mux scheduler cannot guarantee that `ready` will be presented during that 1-cycle window—especially for non-zero channels that must wait for scheduler rotation.
**Recommended Fix**: Add input FIFOs (Solution 2) for minimum disruption to your existing DSP logic. This is the standard approach for integrating DSP modules with streaming interconnect in Quartus designs.
**Expected Outcome**: All 32 channels will forward packets to the HPS correctly.
---
Do you notice that your replies are in MD format? Are they all AI-generated?
- KennyT_altera1 month ago
Super Contributor
I’d also like to know whether the suggestions provided are helpful, and whether this explanation matches the behavior you are seeing in your design.
- KennyT_altera1 month ago
Super Contributor
Just following up on this case.
From your SignalTap observation, the main thing to check is whether each DSP source holds valid until ready is asserted. If valid is only pulsed for one cycle, the mux may miss that transfer for channels that are not currently being serviced, which would explain why channel 0 is seen but other channels are not.
If that is the case, holding valid until handshake completes, or adding a small Avalon-ST FIFO before each mux input, should help confirm the behavior.
Please let us know whether this matches what you are seeing after your checks.
- KennyT_altera28 days ago
Super Contributor
Is there further queries?
- KennyT_altera25 days ago
Super Contributor
closing the thread since there are no further queries.