Skip to content

[ci] Add slang lint#445

Open
micprog wants to merge 6 commits into
mainfrom
slang-action
Open

[ci] Add slang lint#445
micprog wants to merge 6 commits into
mainfrom
slang-action

Conversation

@micprog
Copy link
Copy Markdown
Member

@micprog micprog commented Apr 10, 2026

No description provided.

@micprog micprog marked this pull request as ready for review April 11, 2026 15:05
Comment thread hardware/src/lane/lane_sequencer.sv
Comment thread hardware/src/lane/simd_alu.sv
Comment thread hardware/src/lane/simd_alu.sv
Comment thread hardware/src/sldu/sldu.sv
Comment thread hardware/src/lane/vmfpu.sv
Comment thread hardware/src/masku/masku.sv
Comment thread hardware/src/vlsu/vldu.sv
Comment thread hardware/src/vlsu/vstu.sv
Comment thread hardware/src/vlsu/addrgen.sv
micprog and others added 6 commits June 2, 2026 02:15
PR review (hopang-0221): the automatic variables introduced to silence
slang's -Winferred-latch are not visible in waveforms, since they do not
exist as named signals in the design hierarchy.

Restore them as module-scope signals and break the inferred latches with
unconditional default assignments at the top of their always_comb blocks
instead. No functional change: each of these is always assigned before it
is read on the path that uses it, so the defaults only affect the
otherwise-unread latch paths.

Affected: simd_alu (r), lane_sequencer (extra_stride/vl_tot),
masku (vrgat_res/vrgat_buf), vldu (vrf_word_start_byte),
vstu (vrf_eff_write_bytes), vmfpu (vfrec7/vfrsqrt7 scratch arrays,
narrowing_shuffled_result/narrowing_shuffle_be).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR review (hopang-0221): unlike VSSUBU, the VSSUB saturation flag is not
replicated across all bits of vxsat.w{16,32,64}[b] (only the LSB is set),
so the AND-reduction introduced for the slang -Wint-bool-conv fix is
always 0 and saturation never triggers. Use OR-reduction instead, which
matches the original non-zero test and clears the warning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR review (hopang-0221): replace the verbose explicit zero-pad
replications (added to avoid an unsized '0 inside a concatenation) with
equivalent implicit zero-extension and a plain literal comparison.
out_pnt_d is wide enough to hold {red_stride_cnt_d, 3'b0}, and the popc
compare is against the value 1 - no functional change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@micprog
Copy link
Copy Markdown
Member Author

micprog commented Jun 2, 2026

Thanks for the review @hopang-0221! I addressed the issues you raised and rebased on main. The slang action has a small issue as it was constructed without accounting for newer slang versions breaking the API, pulp-platform/pulp-actions#29 should address that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this also changes the functionality:
old: res.w8 [2b + narrowing_select_i] = ($signed(opb.w16[b]) >>> opa.w16[b][3:0]) + rm[b];
new: res.w8 [2
b + narrowing_select_i] = $unsigned(($signed(opb.w16[b]) >>> opa.w16[b][3:0]) + $signed(rm[b]));

rm[b] is 1-bit number:

  1. Without $signed(), rm[b]==0 -> 0; rm[b]==1 -> 1
  2. With $signed(), rm[b]==0 -> 0; rm[b]==1 -> -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants