Skip to content

arch-riscv: configurable vector splitting unit#949

Merged
jueshiwenli merged 2 commits into
xs-devfrom
calibrateVStride-split-0708
Jul 13, 2026
Merged

arch-riscv: configurable vector splitting unit#949
jueshiwenli merged 2 commits into
xs-devfrom
calibrateVStride-split-0708

Conversation

@jueshiwenli

@jueshiwenli jueshiwenli commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Implement multiple configurable vector split units, with no blocking between different split units.

Change-Id: I7d2487187f3d45f76ebc7eec44c845c8aa87d666

Summary by CodeRabbit

  • New Features
    • Added configurable support for modeling vector memory splits with multiple independent split units.
    • Vector-ready operations now enter a staged delay before rejoining the standard scheduling pipeline.
  • Bug Fixes
    • Improved vector split scheduling to better handle blocked vs non-blocked cases and reschedule work when split units become available.
  • Documentation
    • Added a new/updated guide describing the vector memory split behavior and the “two-unit semantics.”
  • Chores
    • Avoided deprecated Python behavior on Python 3.11+ when setting the program name.

Copilot AI review requested due to automatic review settings July 8, 2026 09:39
@jueshiwenli jueshiwenli added the rvv label Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: efb1ac90-eee8-4e15-8c1b-3fb9d321467b

📥 Commits

Reviewing files that changed from the base of the PR and between 1d89eb8 and f09e596.

📒 Files selected for processing (13)
  • docs/Gem5_Docs/RVV/vector.md
  • src/cpu/o3/FuncScheduler.py
  • src/cpu/o3/issue_queue.cc
  • src/cpu/o3/issue_queue.hh
  • src/cpu/pred/ftb/decoupled_bpred.cc
  • src/cpu/pred/loop_predictor.cc
  • src/cpu/pred/ltage.cc
  • src/cpu/pred/stream/decoupled_bpred.cc
  • src/cpu/pred/stream/loop_detector.cc
  • src/cpu/pred/stream/modify_tage.cc
  • src/cpu/pred/stream/stream_loop_predictor.cc
  • src/cpu/pred/stream/stream_loop_predictor.hh
  • src/sim/main.cc
✅ Files skipped from review due to trivial changes (3)
  • src/cpu/pred/ltage.cc
  • src/cpu/pred/stream/modify_tage.cc
  • src/cpu/pred/ftb/decoupled_bpred.cc
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/cpu/o3/issue_queue.cc
  • src/cpu/o3/issue_queue.hh

📝 Walkthrough

Walkthrough

Refactors O3 vector memory split handling to use per-unit split state and scheduling, adds matching RVV documentation and configuration, updates several predictor files to use lambda-based deferred cleanup, and conditionally skips Python program-name setup on Python 3.11+.

Changes

Vector Split Unit Refactor

Layer / File(s) Summary
Per-unit state contract and public API
src/cpu/o3/issue_queue.hh
IssueQue adds per-unit split capacity and cursor members, replaces global split queue and blocker state with VectorSplitUnitState storage, and declares new helpers for availability, selection, release timing, and blocker removal.
Split unit selection and ready-queue scheduling
src/cpu/o3/issue_queue.cc
The constructor initializes per-unit split state and the ready-queue event path now computes scheduling from unit availability and the earliest per-unit release tick, with rescheduling when the event is already pending.
Split enqueue and release processing
src/cpu/o3/issue_queue.cc
Vector split start, release, and drain paths now operate on per-unit split queues, including blocker insertion and cleanup, per-unit draining into vectorDelayedReadyQ, and idle checks based on per-unit occupancy.
Commit and squash blocker cleanup
src/cpu/o3/issue_queue.cc
Commit and squash paths clear split blockers through the new helper, and squash handling now explicitly reschedules the vector-ready event.
Vector split documentation and config
docs/Gem5_Docs/RVV/vector.md, src/cpu/o3/FuncScheduler.py
The RVV documentation page describes the vector-ready split pipeline, two-unit semantics, unit selection, unchanged downstream behavior, and the new vectorSplitUnits configuration parameter.
Estimated code review effort: 3 (Moderate) ~30 minutes

Deferred Cleanup Lambda Updates

Layer / File(s) Summary
Predictor defer cleanup updates
src/cpu/pred/ftb/decoupled_bpred.cc, src/cpu/pred/loop_predictor.cc, src/cpu/pred/ltage.cc, src/cpu/pred/stream/*.cc, src/cpu/pred/stream/*.hh
Several predictor paths switch scope-exit debugFlagOn cleanup from std::bind to explicit lambda forms, including the stream loop predictor header and implementation helpers.
Estimated code review effort: 2 (Simple) ~10 minutes

Python 3.11 Program Name Guard

Layer / File(s) Summary
Python program-name version guard
src/sim/main.cc
main() wraps the program-name call in a preprocessor check so it is not executed for Python 3.11+.
Estimated code review effort: 1 (Trivial) ~2 minutes

Possibly related PRs

  • OpenXiangShan/GEM5#896: Both PRs modify src/cpu/o3/issue_queue.{cc,hh} to implement the vectorReadyQ to 3-cycle delay to vectorDelayedReadyQ pipeline that the per-split-unit refactor builds on.
  • OpenXiangShan/GEM5#929: Both PRs modify vector-memory split scheduling around tryStartVectorMemSplit()/scheduleVectorReadyQEvent() and blocking-split state that this PR refactors into per-unit structures.

Suggested reviewers: Anzooooo, huxuan0307, weidingliu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.90% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making vector splitting configurable with split-unit support.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch calibrateVStride-split-0708

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the O3 backend’s vector-memory “split” delay modeling in IssueQue to support multiple independent split units, aiming to avoid global blocking when one split stream is occupied by a blocking vector mem op.

Changes:

  • Replace the single global vector split queue/blocker with per-unit split state (vectorSplitStates) and round-robin unit selection.
  • Update vector-ready event scheduling logic to account for multiple split units and their next release times.
  • Add documentation describing the multi-unit split model and intended configuration surface.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/cpu/o3/issue_queue.hh Introduces per-split-unit state and new helper APIs for unit selection/scheduling.
src/cpu/o3/issue_queue.cc Implements multi-unit split behavior, per-unit blocking semantics, and updated event scheduling.
docs/Gem5_Docs/RVV/vector.md Documents the new split-unit model and intended configurability via vectorSplitUnits.

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

Comment thread src/cpu/o3/issue_queue.cc
@jueshiwenli jueshiwenli force-pushed the calibrateVStride-split-0708 branch from 3b3bb6c to 1d89eb8 Compare July 8, 2026 09:46
@jueshiwenli jueshiwenli added rvv and removed rvv labels Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/cpu/o3/issue_queue.hh (1)

221-224: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use lower_snake_case for the new helper APIs.

Please rename the new methods and their definitions/call sites, e.g. has_available_vector_split_unit, select_vector_split_unit, next_vector_split_release_tick, and erase_vector_split_blocker. As per coding guidelines, "Functions and methods should use lower_snake_case naming convention".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/cpu/o3/issue_queue.hh` around lines 221 - 224, The new helper APIs in
IssueQueue use non-conforming camelCase names, so rename them to
lower_snake_case and update every definition and call site accordingly.
Specifically, change the method declarations and usages of
hasAvailableVectorSplitUnit, selectVectorSplitUnit, nextVectorSplitReleaseTick,
and eraseVectorSplitBlocker to their lower_snake_case equivalents in IssueQueue
and any related implementation code.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/cpu/o3/issue_queue.hh`:
- Around line 221-224: The new helper APIs in IssueQueue use non-conforming
camelCase names, so rename them to lower_snake_case and update every definition
and call site accordingly. Specifically, change the method declarations and
usages of hasAvailableVectorSplitUnit, selectVectorSplitUnit,
nextVectorSplitReleaseTick, and eraseVectorSplitBlocker to their
lower_snake_case equivalents in IssueQueue and any related implementation code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8750eb92-2d36-4bbc-94a8-25f1a01e2845

📥 Commits

Reviewing files that changed from the base of the PR and between 7104b23 and 3b3bb6c.

📒 Files selected for processing (3)
  • docs/Gem5_Docs/RVV/vector.md
  • src/cpu/o3/issue_queue.cc
  • src/cpu/o3/issue_queue.hh

@jueshiwenli jueshiwenli added rvv and removed rvv labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🚀 Coremark Smoke Test Results

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

✅ Difftest smoke test passed!

@XiangShanRobot

Copy link
Copy Markdown

[Generated by GEM5 Performance Robot]
commit: 1b8e3ec
workflow: On-Demand RVV SPEC Test (Tier 1.5)

Standard Performance

Overall Score

PR Master Diff(%)
Score 20.13 19.74 +1.95 🟢

Change-Id: I5ba2c40f363863dcce0a29bb4911a02f372d3bb9
Implement multiple configurable vector split units, with no blocking between different split units.

Change-Id: Id1f7918060a321dff33cac3c02f2daef9c75cb23
@jueshiwenli jueshiwenli force-pushed the calibrateVStride-split-0708 branch from 1b8e3ec to f09e596 Compare July 9, 2026 03:01
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🚀 Coremark Smoke Test Results

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

✅ Difftest smoke test passed!

@weidingliu weidingliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM :)

@jueshiwenli jueshiwenli merged commit 199da04 into xs-dev Jul 13, 2026
2 checks passed
@jueshiwenli jueshiwenli deleted the calibrateVStride-split-0708 branch July 13, 2026 04:14
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.

4 participants