Skip to content

Clean up comments and whitespace in src/; delete unused modules - #1952

Merged
rosethompson merged 9 commits into
openhwfoundation:mainfrom
davidharrishmc:dh/sv-cosmetics
Oct 19, 2026
Merged

rosethompson merged 9 commits into
openhwfoundation:mainfrom
davidharrishmc:dh/sv-cosmetics

Conversation

@davidharrishmc

@davidharrishmc davidharrishmc commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Comment and whitespace cleanup across src/:

  • Fix spelling and grammar, and rewrite comments that were wrong, stale, or garbled (e.g. swapped PA/PB definitions in mul.sv, BSelect described as one-hot, the regfile write edge, mislabeled FPU flag signals).
  • Normalize indentation and spacing around operators, keyword parentheses, and commas, especially in the FPU.
  • Add short comments explaining hard-to-follow logic built from numbered control bits (FPU OpCtrl/Fmt/Funct3 equations, controller and BMU decode, cache CMO handling, MMU permission checks).
  • Delete a few commented-out code fragments that were dead debris.

After stripping comments and whitespace, every file's code is identical to main except one bmuctrl default literal whose digit grouping changed (same value). The GetLineNum targets in coverage-exclusions-rv64gc.do still resolve to the same lines.

Also deletes modules that are never instantiated: arrs, trickbox_apb, aesmixcolumns8 and rotate.

🤖 Generated with Claude Code

Fix spelling, grammar, and wrong or garbled comments; normalize
indentation and operator spacing; and add short comments explaining
hard-to-follow control-bit logic, especially in the FPU. Code tokens
are unchanged. Delete eight modules that are never instantiated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
davidharrishmc and others added 2 commits October 10, 2026 06:57
…dh/sv-cosmetics

Resolve the src/cache/cache.sv conflict by taking openhwfoundation#1948's code (OFFSETLEN
and SETLEN as parameters, NextSet sized OFFSETLEN+SETLEN) and keeping this
branch's comment/whitespace cleanup.  The NextSet comment no longer says
"lower 12 bits", and the new localparams openhwfoundation#1948 added to ifu.sv and lsu.sv
get aligned comments.  After stripping comments and whitespace, every src/
file still matches main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: David Harris <David_Harris@hmc.edu>
Restore fdivsqrtuslc4, prioritythermometer, ram2p1r1wbe_128x64 and
ram2p1r1wbe_2048x64 as they are on main, and put the two RAMs back in
run_vcs's list of memories generated per FPGA target.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: David Harris <David_Harris@hmc.edu>
davidharrishmc added a commit to davidharrishmc/cvw that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Revert capitalization-only, punctuation-only, and no-gain rewording
edits, restore contributors' informal notes, and keep commented-out code
such as the rom1p1r bootloader initialization and the RAM preload
blocks. Spelling fixes, corrections to wrong comments, added explanatory
comments, and whitespace consistency stay.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
davidharrishmc added a commit to davidharrishmc/cvw that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Keep alternate designs, the ROM bootloader initialization, and
optimization notes; drop superseded one-liners, dead predictor flops,
and blocks that reference signals that no longer exist.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
davidharrishmc added a commit to davidharrishmc/cvw that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Conflicts were main's logic changes in lines this branch re-indented or
re-commented; each keeps main's code with this branch's formatting:
- fdivsqrtfsm.sv, div.sv: FlushE & ~StallM (openhwfoundation#1925) and its comment; the
  fdivsqrtfsm DONE-state exclusion tag stays removed
- controller.sv: sfence.inval.ir refetch (openhwfoundation#1929)
- tlbcamline.sv: TLBWrite/WritePTE_G/WritePTE_NAPOT ports (openhwfoundation#1927)
- tlbcontrol.sv: ~UpperBitsUnequal in TLBMiss (openhwfoundation#1928), new BadNAPOT comment
- csrc.sv: time/timeh read only with Zicntr (openhwfoundation#1951)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: David Harris <David_Harris@hmc.edu>
# Conflicts:
#	src/hazard/hazard.sv
#	src/privileged/csr.sv
#	src/privileged/privdec.sv
@davidharrishmc

Copy link
Copy Markdown
Contributor Author

Merge order: this is part of the cosmetic stack, merged strictly #1952 → #1955 → #1959 so each delta shows on its own. Merge the open bug-fix PRs first: #1949, #1958, #1967, #1969, #1972, #1982, #1986 and #1987. The stack conflicts textually with them, and re-applying formatting is easier than re-applying fixes.

🤖 Generated with Claude Code

@rosethompson

Copy link
Copy Markdown
Contributor

I am still in the process of reviewing but there are several merge conflicts.

Comment thread src/fpu/fdivsqrt/fdivsqrtiter.sv Outdated
Comment thread src/fpu/postproc/shiftcorrection.sv Outdated
Comment thread src/ieu/kmu/zknde64.sv Outdated
Comment thread src/ieu/kmu/zknde64.sv Outdated
Comment thread src/ieu/ieu.sv
Comment thread src/mmu/hptw.sv Outdated
Comment thread src/mmu/hptw.sv Outdated
Comment thread src/privileged/csrc.sv
Comment thread src/privileged/csrc.sv
Comment thread src/uncore/plic_apb.sv
davidharrishmc and others added 2 commits October 19, 2026 07:15
Signed-off-by: David Harris <David_Harris@hmc.edu>

# Conflicts:
#	src/fpu/fctrl.sv
#	src/fpu/postproc/fmashiftcalc.sv
#	src/fpu/postproc/postprocess.sv
#	src/ifu/bpred/RASPredictor.sv
#	src/ifu/bpred/bpred.sv
#	src/ifu/bpred/icpred.sv
#	src/ifu/ifu.sv
#	src/ifu/spill.sv
#	src/lsu/align.sv
#	src/lsu/lsu.sv
#	src/privileged/csrm.sv
#	src/uncore/uartPC16550D.sv
Restore the original fdivsqrtiter comment and shiftcorrection operand
alignment, use single spaces between the aes64d/aes64e module and
instance names, push every ieu.sv comment out one column so the
PrivilegedM comment lines up, list hptw's TerapageMisaligned before
GigapageMisaligned, and align every NextWalkerState assignment in the
hptw FSM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: David Harris <David_Harris@hmc.edu>
@rosethompson
rosethompson merged commit 7f71b9a into openhwfoundation:main Oct 19, 2026
3 checks passed
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