Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
852e450
Memrouter changes for virtualization(#16)
Mikemy666 Dec 7, 2025
c259f27
[docs] fix: add mdbook missing files
shirohasuki Dec 7, 2025
a10a666
Virtualizetion of the whole BallDomain (#17)
Mikemy666 Dec 8, 2025
d3b81ab
[arch] feat: replace saturn with t1
shirohasuki Dec 9, 2025
b973362
[ci] fix: add missing dependency in doc.yml
shirohasuki Dec 9, 2025
5e023aa
[arch/core] feat: add usingRVVRoCC in rocket decoder, which would sen…
shirohasuki Dec 14, 2025
87667fe
[arch/rocket] fix: add other insts' routing in RoCC CmdRouter
shirohasuki Dec 15, 2025
6644183
change the framework of memdomain for the preparation of virtualizati…
Mikemy666 Dec 16, 2025
51013ee
[arch/gpdomain] feat: add rvv decoder in sequncer
shirohasuki Dec 16, 2025
0a01adf
[bb-test/ctest/rvv] del: remove staurn's rvv tests and add two base t…
shirohasuki Dec 16, 2025
e67d6f8
[arch/memdomain] refactor: made some adjustments to the architecture …
Mikemy666 Dec 18, 2025
987f7c6
[compiler] fix: specify 'llvm' in git submodule update for compiler i…
shirohasuki Dec 18, 2025
c8ca497
[arch/memdomain] refractor: finish the back-end arch unification (#20)
Mikemy666 Dec 18, 2025
1101258
[submodules] update: bump submodule versions for compiler and palladium
shirohasuki Dec 18, 2025
d4c5ad6
[arch/memdomain] fix: resolve ther bug of CI TEST (#21)
Mikemy666 Dec 19, 2025
8789836
[bb-test] refactor: Update memory management in sw and ISA integration
shirohasuki Dec 20, 2025
ecfe3a0
[arch] feat: update config with Serializable
shirohasuki Dec 22, 2025
41f8f46
[bb-test] fix: fix the mistake of the bits of the ISA inst need resolved
Mikemy666 Dec 24, 2025
45f09ff
[arch] feat: complete implementation of hierarchical parameterisation
shirohasuki Dec 28, 2025
e0594f4
[arch] fix: fix lots of bugs to pass compilation
shirohasuki Dec 30, 2025
cce29a9
[arch] feat: add common Router
shirohasuki Jan 1, 2026
06f1149
[arch] refactor: remove EmptyBall module and update BBus initialization
shirohasuki Jan 1, 2026
88e31e4
[arch] feat: enhance BBus and MemRouter with dynamic bandwidth handli…
shirohasuki Jan 1, 2026
57fb795
[arch] refactor: streamline BBus and MemRouter for flat indexing and …
shirohasuki Jan 2, 2026
06b38bc
[arch] refactor: employ composition over inheritance to streamline th…
shirohasuki Jan 4, 2026
02354b2
[arch] slightly update
shirohasuki Jan 4, 2026
16a79da
Fix some bugs
SJM946 Jan 4, 2026
83965cb
[arch] feat: add channel peak
shirohasuki Jan 4, 2026
d29ea17
[arch] refactor: update BallDomain and related modules to use top-lev…
shirohasuki Jan 4, 2026
1e2febc
[arch] feat: introduce ChannelMappingTable
shirohasuki Jan 4, 2026
38ffc17
[arch] refactor: remove redundant ball_id, bank_id, and rob_id assign…
shirohasuki Jan 4, 2026
d904ce5
[arch] slightly update
shirohasuki Jan 4, 2026
f9b5fd0
[arch] feat: implement ChannelCluster and refactor BallMemChannel int…
shirohasuki Jan 4, 2026
e33396a
[arch] refactor: update BallDomain and related modules to use unified…
shirohasuki Jan 4, 2026
1b77849
[arch] del: remove fpga package object
shirohasuki Jan 4, 2026
83e3a0c
[arch] refactor: simplify BallDomain and BBus channel connections usi…
shirohasuki Jan 4, 2026
5758a61
[arch] fix: fix some bugs of the connection about memrouter
Mikemy666 Jan 4, 2026
86cb203
[arch] fix: fix some bugs of the connection about memroute againr
Mikemy666 Jan 4, 2026
a21572c
[arch]Fix some initialization bugs
SJM946 Jan 4, 2026
7f6ee9d
[arch] fix: fix some bugs of the dead lock of channel module
Mikemy666 Jan 4, 2026
daf63e0
[arch]feat:add initialization of some val
Mikemy666 Jan 5, 2026
1719942
[arch]fix: Fixed the bug where accpipe data was misread.
Mikemy666 Jan 5, 2026
ab16d63
[arch]fix:Fixed bugs in the memdomain backend and strictly controlled…
Mikemy666 Jan 5, 2026
9d7d9a2
Revert "[arch] fix: fix some bugs of the dead lock of channel module"
Mikemy666 Jan 5, 2026
35c5a9b
[arch]Fix sone interface bugs in memrouter
SJM946 Jan 5, 2026
b404ad2
[arch]Fix:fix some bugs of memdomain
Mikemy666 Jan 6, 2026
8dd289d
[arch]Fix interface initialazaiton bugs in memrouter
SJM946 Jan 6, 2026
8e3abab
[arch]fix:fix the circle of combination bug of accpipe
Mikemy666 Jan 6, 2026
6824f78
[arch]fix:fix the bugs of toybuckyball
Mikemy666 Jan 6, 2026
77a8d40
[arch]fix:fix the potential problems of readreqgen module
Mikemy666 Jan 6, 2026
ca2c912
[arch]fix:fix some bugs of memrouter
Mikemy666 Jan 7, 2026
aae4599
[arch]feat:add writereqgen part for memrouter
Mikemy666 Jan 8, 2026
a4b9ce6
[arch]fix:fix the potential probelmes of combination loops
Mikemy666 Jan 8, 2026
ecb79bb
[arch] fix: fix mvin/mvout test bug
shirohasuki Jan 9, 2026
aea83c1
[bebop] feat: bump bebop to the latest version.
shirohasuki Jan 10, 2026
5e2a908
Merge main: convert bebop to submodule
shirohasuki Jan 10, 2026
f58fca0
[bb-tests/ctest] refactor: replace bb_mset for memory allocation cons…
shirohasuki Jan 11, 2026
c9b48ff
[bb-tests/ctest] refactor: update memory allocation to use virtual ba…
shirohasuki Jan 11, 2026
cc9a24b
Fix some bugs and simplify the logic
SJM946 Jan 22, 2026
18bd7de
test
SJM946 Jan 22, 2026
863d52e
Merge branch 'main' into vmem-dev
shirohasuki Jan 22, 2026
ec19a12
[arch]Fix memdomain bugs, successfully finish running vecunit matmul …
shirohasuki Jan 23, 2026
ccab3c1
[arch]Partly fix TLB bugs
SJM946 Jan 25, 2026
3f0ddd2
[arch]Revert changes to default.json
SJM946 Jan 25, 2026
6081c4b
[arch]Fix TLB bugs, using paddr for now
SJM946 Jan 26, 2026
d3c1b30
[arch] Add AxisBundle class for blink interface
shirohasuki Jan 29, 2026
513bc5a
[arch]Remove memRouter and add mapping table for MemMidend
SJM946 Jan 30, 2026
ec610a6
[sims] feat: add cosimulation support
shirohasuki Jan 30, 2026
f444a0c
[sims] add cosim server
shirohasuki Jan 30, 2026
79b7386
[arch]Fix some TLB/reader/writer bugs
SJM946 Jan 30, 2026
0d36b0e
[arch] refactor: rewrite RoCC command
shirohasuki Feb 2, 2026
4771e88
[arch]Rewrite mapping table allocating logic
SJM946 Feb 2, 2026
d18df9f
[nix] feat: init Nix Flake support
shirohasuki Feb 2, 2026
8ca9697
[nix] wip: nix installation update
shirohasuki Feb 2, 2026
ea14ac9
[nix] wip: nix installation update
shirohasuki Feb 2, 2026
20e745c
[nix] feat: update Nix environment setup
shirohasuki Feb 2, 2026
97255b5
[nix] fix: fix bugs in build-all.sh
shirohasuki Feb 2, 2026
1065605
[arch]fix: fix bugs of bankwriting in memdomain
Mikemy666 Feb 3, 2026
c18a8fc
[arch]fix: fix bugs of error addr from dma
Mikemy666 Feb 3, 2026
c6f7804
[arch] Fix read request bug
SJM946 Feb 3, 2026
71d8245
Merge branch 'vmem-dev' of https://github.com/DangoSys/buckyball into…
SJM946 Feb 3, 2026
434e84b
[arch]fix:fix some bugs of bankreading in memdomain
Mikemy666 Feb 3, 2026
4b7c13d
[arch] Fix vecunit read resp bug
SJM946 Feb 3, 2026
df4a9fe
[arch]improve:improve the robust of bankreading
Mikemy666 Feb 4, 2026
14b470f
[nix] feat: add htif env into nix
shirohasuki Feb 4, 2026
fd2e510
[arch] Add acc config inst
SJM946 Feb 5, 2026
c770fd7
[arch]fix :fix the bug of reludecode and improve ctest
Mikemy666 Feb 6, 2026
1bdc23b
[arch]fix:fix bugs of streamreader and add transposeball
Mikemy666 Feb 6, 2026
67b719f
[arch] fix:fix bugs of reluball
Mikemy666 Feb 9, 2026
a51f257
[arch] Remove acc config inst, add vbank config inst, rewrite memBank…
SJM946 Feb 10, 2026
da2d09a
[arch] Fix memBackend bugs
SJM946 Feb 10, 2026
2b37c89
[arch]fix:fix some bugs of transposeball
Mikemy666 Feb 11, 2026
cf545b0
Merge branch 'dev-from-67b719f' into vmem-dev
Mikemy666 Feb 11, 2026
77af77b
[arch] Add acc_group_id signal for acc control
SJM946 Feb 11, 2026
11e7eee
[arch]add:add im2colBall
Mikemy666 Feb 11, 2026
73f1ff0
Merge branch 'vmem-dev' of github.com:DangoSys/buckyball into vmem-dev
Mikemy666 Feb 11, 2026
60c5894
[arch] Rewrite AccPipe and finish acc control in MemBackend
SJM946 Feb 12, 2026
c0a1edd
feat: add bebop nix support
shirohasuki Feb 12, 2026
8220eed
[arch] Fix some bugs and simplify the logic in MemBackend
SJM946 Feb 12, 2026
714326b
[arch]fix:fix bugs of lost data of last line in backend
Mikemy666 Feb 13, 2026
55a4aa1
[arch]fix:fix dead error of compling
Mikemy666 Feb 13, 2026
7b561cf
[arch] Fix some bugs in VecUnit, successfully finish running vecunit_…
SJM946 Feb 13, 2026
3657cbc
[scripts] del: remove old build system. ATTENTION: this update need r…
shirohasuki Feb 13, 2026
80b04f0
[scripts] fix: add sbt to build environment and fix bug in rtl build
shirohasuki Feb 14, 2026
03d1769
[ci] fix: fix PR head checkout
shirohasuki Feb 14, 2026
130ef8b
[nix] feat: add UV dependency to build environment
shirohasuki Feb 14, 2026
64d9837
[ci] feat: add DeterminateSystems Nix action to GitHub workflow
shirohasuki Feb 14, 2026
703d651
[scripts] feat: update build-all.sh to include bebop installation step
shirohasuki Feb 14, 2026
306977b
[nix] feat: add pre-commit package to flake.nix
shirohasuki Feb 14, 2026
af9f85f
[scripts] fix: replace bbdev env with nix
shirohasuki Feb 14, 2026
2e2e7d9
[doc] update README.md
shirohasuki Feb 15, 2026
b8046e2
[scripts] fix: update condition for Nix installation check;
shirohasuki Feb 15, 2026
38be7df
[bbdev] fix: bump to fix ci bug
shirohasuki Feb 25, 2026
6322afa
[arch] Simplify MemMidend
Feb 26, 2026
5c90ead
[arch] Remove channel_id in MemBackend mapping table
Feb 27, 2026
1df991f
[arch]Rewrite memset inst
Feb 27, 2026
dc0247b
[arch]fix:fix the bugs of im2col in decoding
Mikemy666 Feb 28, 2026
3f36236
[arch] Fix some bugs, successfully running most workloads using VecBall
Feb 28, 2026
53e2c93
[arch] Fix some bugs in workloads
Feb 28, 2026
fd464d6
[bb-tests] fix: replace virtual bank configuration with memory alloca…
shirohasuki Feb 28, 2026
a21dfef
[bb-tests] fix: fix bugs in mvin_mvout and relu tests
shirohasuki Mar 1, 2026
c9d0df3
[bb-tests]add:add transpose on ctest
Mikemy666 Mar 1, 2026
918fbcb
[bb-tests]fix:fix bugs of ctests set
Mikemy666 Mar 1, 2026
77941e9
[bb-tests] fix:fix bugs of ctests set
shirohasuki Mar 1, 2026
df4a549
[docs] doc: update README
shirohasuki Mar 1, 2026
644d72f
[arch]fix: fix bugs of im2col ball and pass the test (#24)
Mikemy666 Mar 1, 2026
83f8dfb
[arch]fix: Fix memConfiger bugs
SJM946 Mar 2, 2026
96a8b9c
[arch] feat: add scoreboard for ILP
shirohasuki Mar 2, 2026
10f4888
Merge branch 'main' into dev-ilp
shirohasuki Mar 2, 2026
a044611
[arch] fix: fix memdomain backend bugs
shirohasuki Mar 2, 2026
a58c76e
[arch] chore: update subproject commits and scalafmt version; remove …
shirohasuki Mar 2, 2026
d44ebc2
[arch] chore: remove debug print statements from VecStoreUnit
shirohasuki Mar 2, 2026
7f86483
[arch] fix: correct address calculation in Transpose and VecLoadUnit …
shirohasuki Mar 2, 2026
5d8c610
[arch] feat: Halving the registers files of Transpose
shirohasuki Mar 2, 2026
e313cac
[arch] fix: update VecLoadUnit and VecStoreUnit
shirohasuki Mar 2, 2026
b419d27
[docs] feat: add new documentation submodule and remove outdated files
shirohasuki Mar 4, 2026
65fbf83
[docs] update: bump documentation submodule to latest commit
shirohasuki Mar 4, 2026
a547d5a
Update README links and badges
shirohasuki Mar 4, 2026
9f274c5
[arch]add:build shared mem framework
Mikemy666 Mar 5, 2026
e006ad2
[arch]refactor:rebuild the framework of backend
Mikemy666 Mar 5, 2026
a5f5e99
[arch] add: Add SystolicArrayBall and BFP test
SJM946 Mar 5, 2026
9b34e40
[nix] update: bump Verilator version to 5.036 and add ccache and lld …
shirohasuki Mar 5, 2026
9f533ec
[nix] update: downgrade Verilator version to 5.022
shirohasuki Mar 6, 2026
fd5f21d
[ci] update: add ALL_PROXY environment variable to CI and PR workflows
shirohasuki Mar 6, 2026
d6cdf68
[arch] add: Introduce BBTile architecture with decoupled Buckyball ac…
shirohasuki Mar 6, 2026
a8babf8
[arch]add:add shared_mvin/out inst but not finished
Mikemy666 Mar 6, 2026
53679fb
[arch]add:build is_shared flag to backend
Mikemy666 Mar 6, 2026
c30822e
[nix] update: add Yosys and OpenSTA tools
shirohasuki Mar 6, 2026
b0be7f8
[arch] feat: enhance coverage support with signal handling and cleanup
shirohasuki Mar 6, 2026
8ad61a9
[bbdev] update: bump bbdev to the latest version
shirohasuki Mar 7, 2026
51a955a
[arch] feat: implement Quant and Dequant Balls with associated tests …
shirohasuki Mar 7, 2026
e33f494
[bbAgent] fix: refactor MCP server to use official SDK
shirohasuki Mar 7, 2026
d31cd19
[arch] feat: implement Im2col module with LineBufferManager and Strea…
shirohasuki Mar 7, 2026
85124a8
[bb-tests] feat: add MLIR OpTest workloads and tests for Gemmini oper…
shirohasuki Mar 7, 2026
ebe4f0c
[arch] fix: fix bugs in TLB
shirohasuki Mar 7, 2026
5470ea1
[bb-tests] fix: update TLB test workload names for consistency
shirohasuki Mar 7, 2026
a879d2d
[arch]add: finish is_shared flag connection but sharedmemback have pr…
Mikemy666 Mar 8, 2026
02ded4e
[arch]add:send hartid signal to sharedmem
Mikemy666 Mar 8, 2026
7d1865d
[mcp] feat: add waveform-mcp submodule and configuration; update buil…
shirohasuki Mar 8, 2026
6ded000
[bbAgent] feat: initialize waveform-mcp submodule
shirohasuki Mar 8, 2026
0c35959
[arch] feat: refactor instruction encoding
shirohasuki Mar 8, 2026
7652a44
[bbAgent] add skills for ball creation and registration checks
shirohasuki Mar 9, 2026
b6bea0b
[arch]fix:change the code framework of sharedmembackend
Mikemy666 Mar 9, 2026
9497a18
[trace]add:add is_ shared and hartid for debug
Mikemy666 Mar 9, 2026
737f127
[arch]fix:put two signal together on hartid
Mikemy666 Mar 9, 2026
9a60266
[arch]refactor:let hardware detect is_shared automatically
Mikemy666 Mar 11, 2026
5bafdfc
[arch]fix:fix bugs of connection between sharedmem and balls
Mikemy666 Mar 11, 2026
4abed3b
[bbtest]fix:fix bugs of index of shared banks
Mikemy666 Mar 11, 2026
9e65082
Update README.md
shirohasuki Mar 11, 2026
a8ab1c9
Update README.md
shirohasuki Mar 11, 2026
49b1ac1
[bdb] feat: add MMIO support and UART output handling
shirohasuki Mar 12, 2026
33446c5
[arch] fix: update mmio_tick to debounce wFire signal and adjust cloc…
shirohasuki Mar 12, 2026
4388b8e
[ci] fix: update verilator configuration in CI workflows
shirohasuki Mar 12, 2026
624590d
[arch] fix: correct memory section handling in BBSimHarness and link…
shirohasuki Mar 12, 2026
ec532a1
[bb-tests] refactor: sync new simulation framework
shirohasuki Mar 12, 2026
908259f
[bb-tests] fix: update CMakeLists for workload directories and compil…
shirohasuki Mar 12, 2026
127aea5
[bbdev] update: bump bbdev to the latest version
shirohasuki Mar 12, 2026
7684f0f
[arch] fix: update mmio_tick for rising-edge detection and clean up B…
shirohasuki Mar 12, 2026
38dc608
[ci] fix: update verilator configuration in CI workflows
shirohasuki Mar 12, 2026
02d7993
[arch] refactor: simplified RoB design and remove outdated limitation
shirohasuki Mar 14, 2026
e6ddb6a
[arch] feat: integrate SubROB into GlobalRS
shirohasuki Mar 14, 2026
47b15aa
[arch] Make MemMidend more general
Mar 15, 2026
8bd6970
[arch] fix: fix bugs in gemminiball
shirohasuki Mar 15, 2026
f1c2835
[arch] fix: fix bugs in gemminiball
shirohasuki Mar 17, 2026
2cc269a
[arch] fix: fix bugs in gemminiball
shirohasuki Mar 19, 2026
9f8e47b
[arch] del: remove unused channel and memory router components
shirohasuki Mar 20, 2026
0316193
[arch] feat: introduce GlobalScheduler and BAT to support new schedul…
shirohasuki Mar 20, 2026
d39bea7
[arch] feat: add NDJSON visualization script and enhance tracing with…
shirohasuki Mar 20, 2026
9cd49a7
[arch] del: remove bebop submodule and related files; refactor build …
shirohasuki Mar 21, 2026
d5fd471
[bebop] feat: add bebop next
shirohasuki Mar 21, 2026
0bbb8fc
[bebop] update: bump bebop version
shirohasuki Mar 21, 2026
298af92
[bb-tests] fix: correct_tiled_matmul
shirohasuki Mar 21, 2026
ab998be
[compiler] update: bump compiler to support latest buckyball ISAs
shirohasuki Mar 22, 2026
e27a4da
[bb-tests] del: remove OpTest toy and tile workloads, update CMakeLis…
shirohasuki Mar 23, 2026
35136a7
[bebop] update: bump bebop
shirohasuki Mar 24, 2026
606b10a
feat(bebop): Add Spike and Verilator cosimulation module
daiyongyuan Mar 30, 2026
24c2971
feat(bebop): feat: add vector computation support and enhance bebop_a…
daiyongyuan Mar 30, 2026
96c19b7
Add MXFP ball prototype and test
Aurore-pixed Apr 21, 2026
ea00d81
Update README.md
Aurore-pixed Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .claude/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!skills/
!skills/**/*
!CLAUDE.md
111 changes: 111 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Buckyball

基于 RISC-V 的 DSA(Domain Specific Architecture)框架。Chisel 6.5.0,Nix Flake 构建。

## 项目结构

- `arch/src/main/scala/framework/` — 框架核心
- `balldomain/prototype/` — Ball 算子实现(每个 Ball 一个子目录)
- `balldomain/blink/` — Blink 协议定义(BlinkIO、BankRead/Write、BallStatus)
- `balldomain/configs/` — BallDomainParam + default.json(ballIdMappings)
- `balldomain/bbus/` — BBus 总线
- `balldomain/rs/` — BallRsIssue / BallRsComplete(命令/完成接口)
- `memdomain/backend/banks/` — SramReadIO / SramWriteIO
- `core/bbtile/` — BBTile 集成(Rocket core + Buckyball)
- `top/` — GlobalConfig(顶层参数汇聚)
- `arch/src/main/scala/examples/toy/balldomain/` — toy 配置
- `DISA.scala` — 指令 opcode(funct7 BitPat)
- `DomainDecoder.scala` — 指令解码表(ListLookup)
- `bbus/busRegister.scala` — Ball 生成器注册(match case)
- `arch/src/main/scala/sims/` — 仿真配置
- `verilator/` — Verilator 配置
- `verify/` — 单 Ball elaboration(BallTopMain)
- `bb-tests/` — 测试
- `workloads/lib/bbhw/isa/` — ISA C 宏(每条指令一个 .c 文件)
- `workloads/src/CTest/toy/` — C 测试用例
- `sardine/` — pytest 测试框架
- `bbdev/` — 开发工具链(Motia 工作流后端)

## Blink 协议

Ball 通过 Blink 协议接入 BBus。每个 Ball 实现 `HasBlink` trait。

```
BlinkIO(b: GlobalConfig, inBW: Int, outBW: Int):
cmdReq: Flipped(Decoupled(BallRsIssue)) // 命令输入(含 BallDecodeCmd + rob_id)
cmdResp: Decoupled(BallRsComplete) // 完成输出(含 rob_id)
bankRead: Vec(inBW, Flipped(BankRead)) // SRAM 读端口
bankWrite: Vec(outBW, Flipped(BankWrite)) // SRAM 写端口
status: BallStatus { idle, running } // 状态信号

BankRead/BankWrite 元数据字段(均为 Input):
bank_id, rob_id, ball_id, group_id

SramReadIO: req.valid/ready + req.bits.addr → resp.valid + resp.bits.data
SramWriteIO: req.valid/ready + req.bits(addr, data, mask, wmode) → resp.valid + resp.bits.ok
```

关键时序:SRAM 读延迟 = 1 cycle(req.fire 后下一周期 resp.valid 拉高)。

## 注册不变量

添加或修改 Ball 注册时,以下 6 项必须同时满足:

1. `default.json` 的 `ballNum` == `ballIdMappings` 数组长度
2. `ballId` 严格递增(0, 1, 2, ...),不跳号
3. `ballId` 无重复
4. `DISA.scala` 中 funct7 无重复
5. `busRegister.scala` 中的 case 名称集合 == `default.json` 中的 ballName 集合
6. `DomainDecoder.scala` 中的 BID 值集合 == `default.json` 中的 ballId 集合

用 `/check` skill 可以自动检查所有不变量并可选自动修复。

## MCP 工具

项目配置了 `buckyball-dev` MCP Server,提供以下工具。

**重要:编译、仿真、综合、测试等操作必须通过 MCP 工具调用,禁止直接使用 bbdev CLI 或 nix develop 命令。**
bbdev CLI 是给人类程序员用的,MCP 工具是给 agent 用的——MCP 工具内部会自动管理 bbdev server 生命周期并通过 HTTP API 调用。

### 校验
- `validate` — 检查 6 项注册不变量

### bbdev API 封装(自动管理 server 生命周期)
- `bbdev_workload_build` — 编译 CTest
- `bbdev_verilator_run(binary, config?, batch?, coverage?)` — 全流程 clean→verilog→build→sim
- `bbdev_verilator_verilog(config, balltype?)` — 生成 Verilog;`config` 必传,`balltype` 可选(单 Ball elaborate)
- `bbdev_verilator_build(jobs?, coverage?)` — 编译 Verilator 仿真器
- `bbdev_verilator_sim(binary, batch?, coverage?)` — 跑仿真(需先 build)
- `bbdev_sardine_run(workload?, coverage?)` — 批量测试
- `bbdev_yosys_synth(top?, config?)` — Yosys 综合 + OpenSTA 时序分析

默认 config 值:`sims.verilator.BuckyballToyVerilatorConfig`
仿真 binary 命名格式:`ctest_<name>_test_singlecore-baremetal`

### 分析报告路径
- 面积报告:`bbdev/api/steps/yosys/log/hierarchy_report.txt`(子模块分解)、`area_report.txt`(顶层)
- 时序报告:`bbdev/api/steps/yosys/log/timing_report.txt`
- 覆盖率报告:`bb-tests/sardine/reports/coverage/html/`
- 仿真日志:`arch/log/<timestamp>/stdout.log`、`disasm.log`
- bdb 调试日志:`arch/log/<timestamp>/bdb.log`,包含三种 DPI-C trace:
- `[ITRACE]` — 指令发射/完成
- `[MTRACE]` — SRAM 读写
- `[PMCTRACE]` — Ball/Mem 性能计数(elapsed cycles)

## Skills

项目 skill 位于 `.claude/skills/` 下:
- `/ball` — 创建新 Ball 算子(全流程:实现→注册→ISA→CTest→仿真)
- `/check` — 注册状态校验 + 自动修复
- `/verify` — Ball 功能验证(编译→仿真→覆盖率→PMC 分析)
- `/optimize` — RTL 模块面积/延迟优化(适用于任意模块,不限 Ball)
- `/debug` — 仿真调试(日志分析→波形→故障模式库)
- `/waveform` — 波形分析(waveform-mcp 使用指南)

## 约定

- 改 Ball 实现时不要碰注册文件,改注册文件时不要碰实现文件
- Chisel 版本 6.5.0,不要使用 6.6+ 新 API
- CTest 用 `add_cross_platform_test_target` 注册到 CMakeLists.txt
- **禁止直接调用 `bbdev` CLI 或 `nix develop -c bbdev ...`**,必须通过 MCP 工具调用
- Ball wrapper 类名必须和 `default.json` 中 `ballName` 一致
Loading