refactor(build): consolidate CAM test commands under new make targets

- .envrc: add conda compiler flags (CFLAGS, CXXFLAGS, LDFLAGS) for zlib support
- .justfile: replace inline make commands with reusable targets (test-top, test-all, test-model, test-module)
- environment.yml: reformat YAML, add zlib/gtkwave, rename withbullet → with_bullet
This commit is contained in:
2026-05-16 19:53:51 +08:00
parent ca167e79c6
commit e7765cdb76
3 changed files with 37 additions and 27 deletions

View File

@@ -46,19 +46,23 @@ remote-dry cmd:
# 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"
just remote "make -C hw/sim clean && make -C hw/sim test-top NUM_ROWS=64 LANES=8 HASH_BITS=512 WRITE_NOISE_EN=0 READ_NOISE_EN=0"
just remote "make -C hw/sim clean && make -C hw/sim test-top 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"
just remote "make -C hw/sim clean && make -C hw/sim test-top 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"
just remote "make -C hw/sim clean && make -C hw/sim test-top 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"
# Run all CAM tests in one pass (model + top + all modules)
cam-test-full:
just remote "make -C hw/sim clean && make -C hw/sim test-all"
# Run Python reference model tests
cam-test-py:
PYTHONPATH=hw/sim uv run pytest hw/sim/tests/test_ref_model_noise.py -q
make -C hw/sim test-model
# Run a specific CAM test module (e.g., cam-test-module MODULE=test_cam_core_banked)
# Run a specific CAM module test (e.g., cam-test-module MODULE=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 }}"
just remote "make -C hw/sim clean && make -C hw/sim test-module MODULE={{ MODULE }}"
# Run a single test case within a module (e.g., cam-test MODULE=test_cam_basic TESTCASE=baseline_no_noise)
# Run a single test case within a module (e.g., cam-test MODULE=cam_core_banked TESTCASE=banked_core_reads_aligned_eight_row_batch_after_one_cycle)
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 }}"
just remote "make -C hw/sim clean && make -C hw/sim test-module MODULE={{ MODULE }} COCOTB_TESTCASE={{ TESTCASE }}"