Hold DMA upsizer output under backpressure - #20
Open
flaviens wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the DMA S2MM “upsizer” RTL blocks to properly apply backpressure to the input stream while an output word is pending, and to hold output TVALID/data/packet state stable until the downstream handshake completes. This prevents packed output words (and TLAST state) from being lost or mis-associated when the DMA sink stalls.
Changes:
- Gate
s_axis_treadywith(~m_axis_tvalid | m_axis_tready)and introduceinput_transfer/output_transfer/word_completehandshake helpers. - Hold
m_axis_tvalidasserted untilm_axis_treadyis observed, and update/cleartlastin sync with completed-word handshakes. - Apply the same handshake/backpressure behavior consistently across rtl / rtl_4ch / rtl_250 stream-app variants.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| prj/stream_app/rtl/rtl/rp_oscilloscope/rp_dma_s2mm_upsize.v | Adds proper input backpressure and holds output valid/state through handshake for oscilloscope upsizer. |
| prj/stream_app/rtl/rtl/rp_gpio/gpio_dma_s2mm_upsize.v | Adds proper input backpressure and holds output valid/state through handshake for GPIO upsizer. |
| prj/stream_app/rtl/rtl_4ch/rp_oscilloscope/rp_dma_s2mm_upsize.v | Mirrors oscilloscope upsizer backpressure/hold semantics in 4ch variant. |
| prj/stream_app/rtl/rtl_4ch/rp_gpio/gpio_dma_s2mm_upsize.v | Mirrors GPIO upsizer backpressure/hold semantics in 4ch variant. |
| prj/stream_app/rtl/rtl_250/rp_oscilloscope/rp_dma_s2mm_upsize.v | Mirrors oscilloscope upsizer backpressure/hold semantics in 250MHz variant. |
| prj/stream_app/rtl/rtl_250/rp_gpio/gpio_dma_s2mm_upsize.v | Mirrors GPIO upsizer backpressure/hold semantics in 250MHz variant. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+129
to
+132
| if (input_transfer) begin | ||
| upsize_buf[mux_sel ] <= (s_axis_tdata[16-1:8] & {8{ use_8bit}}) | (s_axis_tdata[8-1:0] & {8{~use_8bit}}); | ||
| upsize_buf[mux_sel+1] <= (s_axis_tdata[16-1:8] & {8{~use_8bit}}) | (upsize_buf[mux_sel+1] & {8{ use_8bit}}); | ||
| end |
Comment on lines
+129
to
+132
| if (input_transfer) begin | ||
| upsize_buf[mux_sel ] <= (s_axis_tdata[16-1:8] & {8{ use_8bit}}) | (s_axis_tdata[8-1:0] & {8{~use_8bit}}); | ||
| upsize_buf[mux_sel+1] <= (s_axis_tdata[16-1:8] & {8{~use_8bit}}) | (upsize_buf[mux_sel+1] & {8{ use_8bit}}); | ||
| end |
Comment on lines
+129
to
+132
| if (input_transfer) begin | ||
| upsize_buf[mux_sel ] <= (s_axis_tdata[16-1:8] & {8{ use_8bit}}) | (s_axis_tdata[8-1:0] & {8{~use_8bit}}); | ||
| upsize_buf[mux_sel+1] <= (s_axis_tdata[16-1:8] & {8{~use_8bit}}) | (upsize_buf[mux_sel+1] & {8{ use_8bit}}); | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The upsizers tied input ready high while pulsing output valid for one cycle. A stalled DMA sink could therefore lose packed words, overwrite buffered samples, and retain
TLASTinto a later packet.Checks
TLASTerrors.