test(comp_decomp): add ML-KEM-1024 d=11/d=5 compress/decompress cases
Adds 4 Verilator cases covering d_u=11 and d_v=5 (ML-KEM-1024), which the RTL already supports (d is 5-bit, products fit 24 bits). comp_decomp now 120/120 vectors. Also ignore .omo/ session runtime cache and archive the 06-27-sha3-g-test-specific-input trellis task. Verified all 10 modules pass both frameworks: - Verilator: 4334/4334 vectors - XSIM (Vivado 2019.2): all 11 testbenches green, separate committed vectors Oracles independently cross-checked vs hashlib (G/H/J/PRF) and FIPS 203 Alg 7/8/9/10/12 (sample_ntt, sample_cbd, ntt, poly_mul).
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -30,3 +30,6 @@ xvlog.pb
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Session runtime continuation cache
|
||||
.omo/
|
||||
|
||||
@@ -115,6 +115,36 @@
|
||||
".trellis/scripts/hooks/linear_sync.py": "e09cc4ce4699aada908808718698f33f705a3edf55c4dcf8f777ad892f80ca79",
|
||||
".trellis/scripts/init_developer.py": "f9e6c0d882406e81c8cd6b1c5abb204b0befc0069ff89cf650cd536a80f8c60e",
|
||||
".trellis/scripts/task.py": "40abdd46f5c2b6837610429a38eef50f1fc783fb1852dc4f52a891205e42ab04",
|
||||
".trellis/workflow.md": "f4b8a6f89017f62071986d6d36cc32c4c7f01fe6f023f0fd9311eddc57d8c94f"
|
||||
".trellis/workflow.md": "f4b8a6f89017f62071986d6d36cc32c4c7f01fe6f023f0fd9311eddc57d8c94f",
|
||||
".trellis/.runtime/sessions/opencode_ses_0fa9bd669ffeYrt7zm7OK1GYM8.json": "0057637c43c0458e064360a5cdfb047da4a4107cf3e91bdcf9dab39f909af4b0",
|
||||
".trellis/.runtime/update-check-claude_2ab4f024-6de1-48a9-a1e6-ae4f26b174a7.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-claude_4ff99829-c447-424f-a6b9-a34607b049fa.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-claude_d9118ffd-8f45-42ea-9801-d82379b3c23a.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_0fa9ba12affeWK76gGIDEf0tDZ.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_0fa9baae2ffeqp0asVrd8rcWFl.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_0fa9bd669ffeYrt7zm7OK1GYM8.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_0fff4a7a5ffeSofnz1j0YF4O56.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_1005858f0ffeXfy2McZGWqgoG2.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_1019cfb14ffewFpp4foONH6Wu6.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/.runtime/update-check-opencode_ses_1019d29b8ffepGPHFwLKNJ0HlH.marker": "77c2ca150b61c7330da139378ffd3940d093f1bd74a1294689345d27e15b5124",
|
||||
".trellis/scripts/common/__pycache__/__init__.cpython-313.pyc": "c507bcf29f62120973aca3d193c223167ec29838a39b00c56748dfc3f431c6c7",
|
||||
".trellis/scripts/common/__pycache__/active_task.cpython-313.pyc": "3c357180210e0e2f2041ca45b56614e161959ab4809d72ebee33f43b9ac2aad8",
|
||||
".trellis/scripts/common/__pycache__/config.cpython-313.pyc": "12eaa5b7207125527c503acbd5620afede4a80e1ac1a7eee2091a928db8270b3",
|
||||
".trellis/scripts/common/__pycache__/developer.cpython-313.pyc": "0ef11d0d4912e31bf444d43584186ae22e5c94a915b6bb73bb1c5a6565c2f906",
|
||||
".trellis/scripts/common/__pycache__/git.cpython-313.pyc": "df26e82d048e295eee4c1cbfa4bb2e7f109bd44bb5aba37ef8a2d40174609bd8",
|
||||
".trellis/scripts/common/__pycache__/git_context.cpython-313.pyc": "ef792d63110597d6c1f0eabce437a4c5eecaf86d7582255c95f5d7c83a9a89a4",
|
||||
".trellis/scripts/common/__pycache__/io.cpython-313.pyc": "8d20ac0339b6b0e6a4457502844d13d8b050250ff7021e55fcd8bff61d987434",
|
||||
".trellis/scripts/common/__pycache__/log.cpython-313.pyc": "67224fab1a76d37d942f019b3d2a875c6497bb1d582f9dcc478e49c0c69d216a",
|
||||
".trellis/scripts/common/__pycache__/packages_context.cpython-313.pyc": "4ee8a87d8112d233d8310b1364223ec13835e378d2aa62fe84139d089e28b5f6",
|
||||
".trellis/scripts/common/__pycache__/paths.cpython-313.pyc": "a01b7eaf9ee4a61e42a4157da475e28655dec54ac2804895e052308dc91e8bca",
|
||||
".trellis/scripts/common/__pycache__/safe_commit.cpython-313.pyc": "b42206d0d64a1ea72548e88d9730f186334566af1e1bff58d095845db37db407",
|
||||
".trellis/scripts/common/__pycache__/session_context.cpython-313.pyc": "66dc9d914a744bb697f41f9187df38e8a00d39f93b2f73fc20cb3d3b112c2275",
|
||||
".trellis/scripts/common/__pycache__/task_context.cpython-313.pyc": "7de2ac31464c7502db0a147e9d5758906a9ba7e4ae54e5e9e289e95730956d33",
|
||||
".trellis/scripts/common/__pycache__/task_store.cpython-313.pyc": "29ae8e0e8b13f55b84a6271df2752b439bf4df7e6edba1f4ab77f69df04caa4c",
|
||||
".trellis/scripts/common/__pycache__/task_utils.cpython-313.pyc": "122c0d3bb365524ed6523f5e5ca5168b0e119a28000a9bf16a7a2d4ad3d5b7c3",
|
||||
".trellis/scripts/common/__pycache__/tasks.cpython-313.pyc": "b9db435c1953f006a6065881b8c1e1c350e010253930de0df4eea4f3062e51ed",
|
||||
".trellis/scripts/common/__pycache__/trellis_config.cpython-313.pyc": "fede1256e0abfe954c965e605b6bd6eb6cf9f062c47e9215e82879a5c0fa6f3c",
|
||||
".trellis/scripts/common/__pycache__/types.cpython-313.pyc": "9c3ac38bf04b034a8a6fb5c3dbd37918bac6bce28123c760d06c80a9b8502b75",
|
||||
".trellis/scripts/common/__pycache__/workflow_phase.cpython-313.pyc": "eed71dc42941cbccbf2d4c38673c9ec465286a03163bcebc39e1c4ca0bbb3dab"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"file": ".trellis/spec/rtl/xsim-tb-conventions.md", "reason": "检查 testbench 修改是否符合 XSIM 规范"}
|
||||
@@ -0,0 +1 @@
|
||||
{"file": ".trellis/spec/rtl/xsim-tb-conventions.md", "reason": "遵循 XSIM testbench 编写规范:时钟、复位、DUT驱动协议"}
|
||||
30
.trellis/tasks/06-27-sha3-g-test-specific-input/prd.md
Normal file
30
.trellis/tasks/06-27-sha3-g-test-specific-input/prd.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# 修改 sha3 TB 测试 G 模式指定输入
|
||||
|
||||
## 需求
|
||||
|
||||
修改 `sync_rtl/sha3/TB/tb_sha3_xsim_simple.v`,将其中硬编码的测试向量替换为指定的 d、k 值,测试 sha3_top 的 G (SHA3-512) 模式。
|
||||
|
||||
## 测试输入
|
||||
|
||||
```
|
||||
d = 0x6dbbc4375136df3b07f7c70e639e223e177e7fd53b161b3f4d57791794f12624 (256-bit)
|
||||
k = 2 (8-bit)
|
||||
mode = G (2'b00)
|
||||
```
|
||||
|
||||
在 RTL 中,G 模式的输入格式为 `data_i[263:0] = {d[255:0], k[7:0]}`(d 在低位,k 在高位),即:
|
||||
|
||||
```
|
||||
data_i = {248'd0, 8'd2, 256'h6dbbc4375136df3b07f7c70e639e223e177e7fd53b161b3f4d57791794f12624}
|
||||
```
|
||||
|
||||
## 修改方案
|
||||
|
||||
修改 `tb_sha3_xsim_simple.v`:
|
||||
1. 将 `data_i = 512'd0` 替换为指定值 `{248'd0, 8'd2, 256'h6dbbc4375136df3b07f7c70e639e223e177e7fd53b161b3f4d57791794f12624}`
|
||||
2. 删除 `G_EXPECTED_HASH` 参数和自检比较逻辑,改为仅打印 `hash_o` 结果
|
||||
3. 更新顶部的注释说明
|
||||
|
||||
## 预期输出
|
||||
|
||||
运行后打印 `hash_o` 的值,可通过 Python 参考实现 `SHA_3.G(d, k)` 交叉验证。
|
||||
26
.trellis/tasks/06-27-sha3-g-test-specific-input/task.json
Normal file
26
.trellis/tasks/06-27-sha3-g-test-specific-input/task.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "sha3-g-test-specific-input",
|
||||
"name": "sha3-g-test-specific-input",
|
||||
"title": "修改sha3 TB测试G模式指定输入d=k=2",
|
||||
"description": "",
|
||||
"status": "in_progress",
|
||||
"dev_type": null,
|
||||
"scope": null,
|
||||
"package": null,
|
||||
"priority": "P2",
|
||||
"creator": "FallenSigh",
|
||||
"assignee": "FallenSigh",
|
||||
"createdAt": "2026-06-27",
|
||||
"completedAt": null,
|
||||
"branch": null,
|
||||
"base_branch": "main",
|
||||
"worktree_path": null,
|
||||
"commit": null,
|
||||
"pr_url": null,
|
||||
"subtasks": [],
|
||||
"children": [],
|
||||
"parent": null,
|
||||
"relatedFiles": [],
|
||||
"notes": "",
|
||||
"meta": {}
|
||||
}
|
||||
@@ -33,6 +33,34 @@
|
||||
"params": {"mode": "decompress", "d": 4},
|
||||
"num_vectors": 10,
|
||||
"tolerance": "bit_exact"
|
||||
},
|
||||
{
|
||||
"id": "compress_du11",
|
||||
"description": "Compress with du=11 (ML-KEM-1024)",
|
||||
"params": {"mode": "compress", "d": 11},
|
||||
"num_vectors": 20,
|
||||
"tolerance": "bit_exact"
|
||||
},
|
||||
{
|
||||
"id": "compress_dv5",
|
||||
"description": "Compress with dv=5 (ML-KEM-1024)",
|
||||
"params": {"mode": "compress", "d": 5},
|
||||
"num_vectors": 20,
|
||||
"tolerance": "bit_exact"
|
||||
},
|
||||
{
|
||||
"id": "decompress_du11",
|
||||
"description": "Decompress with du=11 (ML-KEM-1024)",
|
||||
"params": {"mode": "decompress", "d": 11},
|
||||
"num_vectors": 10,
|
||||
"tolerance": "bit_exact"
|
||||
},
|
||||
{
|
||||
"id": "decompress_dv5",
|
||||
"description": "Decompress with dv=5 (ML-KEM-1024)",
|
||||
"params": {"mode": "decompress", "d": 5},
|
||||
"num_vectors": 10,
|
||||
"tolerance": "bit_exact"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user