From c41e64d1c67f020f651e07e44d61cf40f5fdbfe9 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Wed, 13 May 2026 18:10:42 +0800 Subject: [PATCH] feat(dev): add CAM test recipes and update ignore files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `.opencode/` and `**/sim_build` to ignore lists - Fix justfile syntax: `set dotenv-required := true` (explicit assignment) - Update SSH tunnel port 8384 → 42705 for local port forwarding - Add CAM verification recipes: cam-test-all, cam-test-py, cam-test-module, cam-test --- .gitignore | 1 + .justfile | 26 +++++++++++++++++++++++--- .stignore | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 636c795..9539dbe 100644 --- a/.gitignore +++ b/.gitignore @@ -220,6 +220,7 @@ outputs/ openspec/changes/ .logs/ docs/superpowers +.opencode/ # Devenv .devenv* diff --git a/.justfile b/.justfile index 1446ea2..0b35fb2 100644 --- a/.justfile +++ b/.justfile @@ -1,8 +1,7 @@ -set dotenv-required +set dotenv-required := true export MSYS2_ARG_CONV_EXCL := "*" export MSYS2_ENV_CONV_EXCL := "*" - remote_ssh_target := env("REMOTE_SSH_TARGET") remote_docker_container := env("REMOTE_DOCKER_CONTAINER") @@ -15,7 +14,7 @@ sync-data: ssh: ssh \ - -L 127.0.0.1:8385:127.0.0.1:8384 \ + -L 127.0.0.1:8385:127.0.0.1:42705 \ -L 127.0.0.1:9098:127.0.0.1:9098 \ -L 127.0.0.1:2718:172.30.0.2:2718 \ {{ remote_ssh_target }} @@ -42,3 +41,24 @@ remote-check: remote-dry cmd: uv run python scripts/remote_docker_run.py run --dry-run -- {{ quote(cmd) }} + +# ── CAM verification ────────────────────────────────────────────────────────── + +# Run all 4 integrated CAM configurations (no-noise, write-only, read-only, combined) +cam-test-all: + just remote "make -C hw/sim clean && make -C hw/sim NUM_ROWS=64 LANES=8 HASH_BITS=512 WRITE_NOISE_EN=0 READ_NOISE_EN=0 COCOTB_TEST_MODULES=tests.test_cam_basic" + just remote "make -C hw/sim clean && make -C hw/sim NUM_ROWS=64 LANES=8 HASH_BITS=512 WRITE_NOISE_EN=1 WRITE_NOISE_RATE_NUM=1 WRITE_NOISE_RATE_DEN=100 READ_NOISE_EN=0 COCOTB_TEST_MODULES=tests.test_cam_basic" + just remote "make -C hw/sim clean && make -C hw/sim NUM_ROWS=64 LANES=8 HASH_BITS=512 WRITE_NOISE_EN=0 READ_NOISE_EN=1 READ_NOISE_RATE_NUM=1 READ_NOISE_RATE_DEN=100 COCOTB_TEST_MODULES=tests.test_cam_basic" + just remote "make -C hw/sim clean && make -C hw/sim NUM_ROWS=64 LANES=8 HASH_BITS=512 WRITE_NOISE_EN=1 WRITE_NOISE_RATE_NUM=1 WRITE_NOISE_RATE_DEN=100 READ_NOISE_EN=1 READ_NOISE_RATE_NUM=1 READ_NOISE_RATE_DEN=100 COCOTB_TEST_MODULES=tests.test_cam_basic" + +# Run Python reference model tests +cam-test-py: + PYTHONPATH=hw/sim uv run pytest hw/sim/tests/test_ref_model_noise.py -q + +# Run a specific CAM test module (e.g., cam-test-module MODULE=test_cam_core_banked) +cam-test-module MODULE: + just remote "make -C hw/sim clean && make -C hw/sim NUM_ROWS=64 LANES=8 HASH_BITS=512 COCOTB_TEST_MODULES=tests.{{ MODULE }}" + +# Run a single test case within a module (e.g., cam-test MODULE=test_cam_basic TESTCASE=baseline_no_noise) +cam-test MODULE TESTCASE: + just remote "make -C hw/sim clean && make -C hw/sim NUM_ROWS=64 LANES=8 HASH_BITS=512 COCOTB_TEST_MODULES=tests.{{ MODULE }} COCOTB_TESTCASE={{ TESTCASE }}" diff --git a/.stignore b/.stignore index b3af8ed..c61d905 100644 --- a/.stignore +++ b/.stignore @@ -13,3 +13,4 @@ deps outputs .sisyphus **/__pycache__ +**/sim_build