Skip to content

arch-riscv: Add an assert for vector splitting.#840

Open
jueshiwenli wants to merge 2 commits into
xs-devfrom
xs-vector-260422
Open

arch-riscv: Add an assert for vector splitting.#840
jueshiwenli wants to merge 2 commits into
xs-devfrom
xs-vector-260422

Conversation

@jueshiwenli
Copy link
Copy Markdown
Collaborator

@jueshiwenli jueshiwenli commented Apr 22, 2026

Change-Id: I2aae4e4c13f0c528354d9e404bd857f42175ddb9

Summary by CodeRabbit

  • Chores

    • Added an internal validation to improve reliability of vector instruction construction.
  • Documentation

    • Added a Chinese design-doc index for Kunminghu vector docs.
    • Added a new design document describing control and sequencing for vector configuration instructions, including timing, risk mitigation, and verification guidance.

Change-Id: I2aae4e4c13f0c528354d9e404bd857f42175ddb9
Copilot AI review requested due to automatic review settings April 22, 2026 07:04
@github-actions
Copy link
Copy Markdown

🚀 RVV Performance test triggered: spec06int-rvv-0.8c

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7117ee46-cc7d-4946-a53a-cb4065aee4f8

📥 Commits

Reviewing files that changed from the base of the PR and between 0729129 and 9a3d45c.

📒 Files selected for processing (2)
  • docs/design-docs/vector/README.md
  • docs/design-docs/vector/vector-config-decode-block-design.md
✅ Files skipped from review due to trivial changes (2)
  • docs/design-docs/vector/README.md
  • docs/design-docs/vector/vector-config-decode-block-design.md

📝 Walkthrough

Walkthrough

Added a runtime assertion in the VectorIntMacroConstructor template requiring num_microops be exactly 1 or an even number. Also added Chinese vector design documentation: an index README and a detailed design doc for vector-config decode/commit serialization behavior.

Changes

Vector Arithmetic Validation

Layer / File(s) Summary
Template Check
src/arch/riscv/isa/vector/base/vector_arith.temp.isa
Insert `assert(num_microops == 1

Vector Design Documentation (Chinese)

Layer / File(s) Summary
Docs Index
docs/design-docs/vector/README.md
Add Kunminghu Vector documentation index README with homepage link, scope statement, and link to the design doc.
Design Specification
docs/design-docs/vector/vector-config-decode-block-design.md
Add detailed design doc describing decode-stage serialization for vector-config (vset*) instructions, same-cycle push truncation, commit-stage younger-executed detection with squashAfter refresh/replay, timing diagrams, risks, validation plan, and affected code references.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • huxuan0307
  • Anzooooo
  • weidingliu

Poem

🐰 I nibble code by moonlight's beam,
I hop through asserts, neat and keen,
One or even—rules so sweet,
Docs bloom like clover at my feet,
Happy hops for vector dreams! 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'arch-riscv: Add an assert for vector splitting' accurately matches the main code change, which adds a runtime assertion in the vector arithmetic template to constrain num_microops.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch xs-vector-260422

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a debug-time invariant check in the RISC-V vector arithmetic ISA template to validate assumptions about how many micro-ops are created when vector instructions are split based on LMUL.

Changes:

  • Add an assert to ensure num_microops is either 1 or an even number before generating micro-ops.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

🚀 Coremark Smoke Test Results

Branch IPC Change
Base (xs-dev) 2.3051 -
This PR 2.3051 ➡️ 0.0000 (0.00%)

✅ Difftest smoke test passed!

Change-Id: I8216f2832fc528cd3bb07af9b04fde6d494761a9
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

🚀 Coremark Smoke Test Results

Branch IPC Change
Base (xs-dev) 2.3130 -
This PR 2.3130 ➡️ 0.0000 (0.00%)

✅ Difftest smoke test passed!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants