Skip to content

memrouter changes#16

Merged
Mikemy666 merged 1 commit into
DangoSys:mainfrom
Mikemy666:switcher-clean
Dec 7, 2025
Merged

memrouter changes#16
Mikemy666 merged 1 commit into
DangoSys:mainfrom
Mikemy666:switcher-clean

Conversation

@Mikemy666
Copy link
Copy Markdown
Contributor

Memrouter and related modules changes for virtualization
Tutorail updated

Copilot AI review requested due to automatic review settings December 7, 2025 13:52
@Mikemy666 Mikemy666 merged commit 852e450 into DangoSys:main Dec 7, 2025
5 of 6 checks passed
Copy link
Copy Markdown
Member

@shirohasuki shirohasuki left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirohasuki
Copy link
Copy Markdown
Member

cool

Copy link
Copy Markdown

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

This PR refactors the memory routing architecture to support virtualization by consolidating separate SPAD and ACC memory interfaces into a unified virtual bank system. The changes simplify the architecture by using a single shared ToPhysicalLine module instead of per-ball instances, and introduce new bundle types (SramReadWithInfo and SramWriteWithInfo) that carry additional routing metadata.

  • Unified memory bank interfaces (combining SPAD and ACC into numBanks)
  • Replaced per-ball ToPhysicalLine modules with a single shared instance
  • Updated tutorial documentation with config parameter

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/bb-note/src/tutorial/tutorial.md Added config parameter to verilator command
arch/src/main/scala/framework/switcher/ToPhysicalLine.scala Changed from per-ball RobId bundles to unified IO bundles, removed rob_id field assignments
arch/src/main/scala/framework/balldomain/blink/blink.scala Updated comments to document additional fields in WithInfo bundles
arch/src/main/scala/framework/balldomain/bbus/memrouter/memRouter.scala Consolidated SPAD/ACC interfaces into unified numBanks structure, updated routing logic
arch/src/main/scala/framework/balldomain/bbus/memrouter/SramIOAdapter.scala Changed interfaces to use WithInfo bundles, added wire for proper field propagation
arch/src/main/scala/framework/balldomain/bbus/bbus.scala Replaced per-ball ToPhysicalLine instances with single shared module, updated signal routing

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

Comment on lines 62 to 63
}
}
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Incomplete signal connection. Only io.req is connected, but SramReadWithInfo also includes rob_id, is_acc, and bank_id fields that need to be propagated. Consider connecting the entire bundle or explicitly handling all fields.

Suggested change
}
}
io.sramRead_o(j).io.rob_id := io.sramRead_i(i)(j).io.rob_id
io.sramRead_o(j).io.is_acc := io.sramRead_i(i)(j).io.is_acc
io.sramRead_o(j).io.bank_id := io.sramRead_i(i)(j).io.bank_id
}

Copilot uses AI. Check for mistakes.
io.sramRead_i(i)(j).io.resp <> io.sramRead_o(j).resp
for(j <- 0 until numBanks){
when(io.sramRead_o(j).io.resp.valid){
io.sramRead_i(i)(j).io.resp <> io.sramRead_o(j).io.resp
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Incomplete signal connection. Only io.resp is connected, but SramReadWithInfo also includes rob_id, is_acc, and bank_id fields that need to be propagated. Consider connecting the entire bundle or explicitly handling all fields.

Suggested change
io.sramRead_i(i)(j).io.resp <> io.sramRead_o(j).io.resp
io.sramRead_i(i)(j).io <> io.sramRead_o(j).io

Copilot uses AI. Check for mistakes.

read_o.rob_id := io.sramWrite_i.rob_id
read_o.is_acc := io.sramWrite_i.is_acc
read_o.bank_id := io.sramWrite_i.bank_id
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Trailing whitespace after the assignment. Remove the extra spaces at the end of this line.

Suggested change
read_o.bank_id := io.sramWrite_i.bank_id
read_o.bank_id := io.sramWrite_i.bank_id

Copilot uses AI. Check for mistakes.
read_o.is_acc := io.sramWrite_i.is_acc
read_o.bank_id := io.sramWrite_i.bank_id

io.sramRead_o <> read_o
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Trailing whitespace after the assignment. Remove the extra spaces at the end of this line.

Suggested change
io.sramRead_o <> read_o
io.sramRead_o <> read_o

Copilot uses AI. Check for mistakes.
}

// -----------------------------------------------------------------------------
// ToPhysicalLine - per-ball conversion from virtual to physical line
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Misleading comment. The comment says "per-ball conversion" but the code creates a single shared ToPhysicalLine module (not one per ball). Update the comment to reflect that this is a shared module that converts from unified virtual banks to separate physical SPAD and ACC banks.

Suggested change
// ToPhysicalLine - per-ball conversion from virtual to physical line
// ToPhysicalLine - shared module converting from unified virtual banks to separate physical SPAD and ACC banks

Copilot uses AI. Check for mistakes.
// SramWriteIO with rob_id, is_acc, bank_id
class SramWriteWithInfo(val n: Int, val w: Int, val mask_len: Int)(implicit b: CustomBuckyballConfig, p: Parameters) extends Bundle {
val io = new SramWriteIO(n, w, mask_len)
// Input because theSramWriteIO outer layer has Flipped
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Typo in comment: "theSramWriteIO" should have a space - "the SramWriteIO".

Suggested change
// Input because theSramWriteIO outer layer has Flipped
// Input because the SramWriteIO outer layer has Flipped

Copilot uses AI. Check for mistakes.
for(j <- 0 until b.acc_banks){
when(io.accWrite_i(i)(j).io.req.valid){
io.accWrite_o(j) <> io.accWrite_i(i)(j).io
io.sramWrite_o(j)<> io.sramWrite_i(i)(j)
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Missing space before the <> operator. Should be io.sramWrite_o(j) <> io.sramWrite_i(i)(j) for consistency with other connection statements.

Suggested change
io.sramWrite_o(j)<> io.sramWrite_i(i)(j)
io.sramWrite_o(j) <> io.sramWrite_i(i)(j)

Copilot uses AI. Check for mistakes.
@Mikemy666 Mikemy666 deleted the switcher-clean branch December 8, 2025 05:13
@Mikemy666 Mikemy666 restored the switcher-clean branch December 8, 2025 05:14
@Mikemy666 Mikemy666 deleted the switcher-clean branch December 8, 2025 05:14
shirohasuki pushed a commit that referenced this pull request May 19, 2026
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.

3 participants