Commit Graph

5 Commits

Author SHA1 Message Date
8774e03a0e build(vivado): rewrite create_project.tcl for current KeyGen flow
The old script referenced 5 non-existent files (keccak_arbiter,
sha3_chain_top_shared, tb_mlkem_top_xsim, tb_kg/en/de) and stale
vectors, so read_verilog/elaborate failed outright.

Rewrite to mirror the verified XSIM flow (sync_rtl/top/TB/xsim_run.tcl):
  - load exactly the 14 sources mlkem_top depends on
  - sim top = tb_mlkem_kg_katK_xsim, runtime K via generic KP, case via
    -testplusarg CASE
  - copy KAT vectors into the xsim working dir via xsim.compile.tcl.pre
    (the only hook in 2019.2 that runs before $readmemh; an appended
    -tclbatch runs after Vivado's own 'run all', too late)
  - drop duplicate --relax (XSim adds it; passing again is an error)

Verified through the actual Vivado batch project flow:
  K=2 CASE 0 -> PASS (21403 cyc), K=4 CASE 2 -> PASS (54059 cyc),
  0 file-not-found warnings. gitignore the generated vivado_prj/.

Also rewrite README.md in Chinese documenting the mlkem_top workflow
and test flow.
2026-06-28 03:43:56 +08:00
0b7c76283b feat(create_project): add kg/en/de testbenches to Vivado project 2026-06-27 02:33:37 +08:00
6721c3c0c1 fix(create_project): replace -cd with -tclbatch pre-simulation vector copy
Vivado 2019.2 xsim does not support -cd flag. Instead:
- Generate copy_vectors_pre.tcl that copies hex files
- Pass via -tclbatch for pre-simulation execution
-  can then find vectors relative to xsim work dir
2026-06-27 02:19:22 +08:00
9ef6d96117 fix(create_project): set xsim working directory to project root
Add -cd flag so  finds vector files when running
from Vivado GUI (simulation dir ≠ project root)
2026-06-27 02:12:40 +08:00
ed83ef9da2 feat(tcl): add create_project.tcl for automatic Vivado project setup
Creates Vivado simulation project with all 25 RTL source files,
shared keccak variants, mlkem_top, and tb_mlkem_top_xsim.

Usage: vivado -mode batch -source create_project.tcl
2026-06-27 01:51:42 +08:00