diff --git a/CHANGELOG.md b/CHANGELOG.md index 542eb153d..1b18631ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Force cheshire's sim scripts re-generation - Fix u-boot to support RVV-linux - Fixed src emul check for vector integer extension operation + - Fix slide unit hang when the slide offset is a whole-chunk multiple ### Added diff --git a/hardware/src/ara_dispatcher.sv b/hardware/src/ara_dispatcher.sv index e5f9e06d5..4a7525ee3 100644 --- a/hardware/src/ara_dispatcher.sv +++ b/hardware/src/ara_dispatcher.sv @@ -267,14 +267,26 @@ module ara_dispatcher import ara_pkg::*; import rvv_pkg::*; #( // NP2 Slide support logic is_stride_np2; - logic [idx_width(idx_width(VLENB << 3)):0] sldu_popc; - - // Is the stride power of two? + logic [idx_width(idx_width(8*NrLanes)):0] sldu_popc; + + // The SLDU's p2_stride_gen only resolves the WITHIN-CHUNK portion of the slide + // offset (it is idx_width(8*NrLanes) bits wide, matching one VRF chunk); the + // chunk-level portion of the stride is handled by the slide operand addressing. + // is_stride_np2 must therefore be computed on exactly that within-chunk offset + // (element stride truncated to the generator width). Computing it on the full + // stride wrongly sends pure chunk-shift offsets (whose low bits are zero, e.g. + // vslidedown by 48/96, or a sign-extended .vi imm >= 16) into the NP2 path, + // where p2_stride_gen reports popcount 0 and SLIDE_NP2_RUN's popc == 1 exit is + // never reached, hanging the slide unit forever. + logic [idx_width(8*NrLanes)-1:0] sldu_stride_chunk; + assign sldu_stride_chunk = (ara_req.stride >> csr_vtype_q.vsew); + + // Is the within-chunk stride a power of two? popcount #( - .INPUT_WIDTH (idx_width(VLENB << 3)) + .INPUT_WIDTH (idx_width(8*NrLanes)) ) i_np2_stride ( - .data_i (ara_req.stride[idx_width(VLENB << 3)-1:0] ), - .popcount_o(sldu_popc ) + .data_i (sldu_stride_chunk), + .popcount_o(sldu_popc ) ); assign is_stride_np2 = sldu_popc > 1;