feat(sim): enable read noise by default and improve test infrastructure

- Set READ_NOISE_EN=1 as default in cam_top.sv
- Wire READ_NOISE_* parameters to NOISE_* makefile variables in cocotb-common.mk
- Add PYTHON env variable support in Makefile for test invocation
- Update .gitignore with glob patterns (**/sim_build/, **/results.xml, *.fst)
- Add justfile recipe for remote cam-test-top execution
This commit is contained in:
2026-05-16 20:44:47 +08:00
parent e7765cdb76
commit e8c890a69f
5 changed files with 14 additions and 8 deletions

View File

@@ -55,6 +55,10 @@ cam-test-all:
cam-test-full:
just remote "make -C hw/sim clean && make -C hw/sim test-all"
# Run top CAM tests
cam-test-top:
just remote "make -C hw/sim clean && make -C hw/sim test-top"
# Run Python reference model tests
cam-test-py:
make -C hw/sim test-model

5
hw/.gitignore vendored
View File

@@ -1,2 +1,3 @@
sim/sim_build
sim/results.xml
**/sim_build/
**/results.xml
*.fst

View File

@@ -7,7 +7,7 @@ module cam_top #(
parameter int WRITE_NOISE_RATE_DEN = 100,
parameter int WRITE_NOISE_BITS = 8,
parameter logic [63:0] WRITE_NOISE_SEED = 64'hB504_F32D_B504_F32D,
parameter bit READ_NOISE_EN = 1'b0,
parameter bit READ_NOISE_EN = 1'b1,
parameter int READ_NOISE_RATE_NUM = 1,
parameter int READ_NOISE_RATE_DEN = 100,
parameter int READ_NOISE_BITS = 8,

View File

@@ -1,3 +1,4 @@
PYTHON ?= python
MODULE_TESTS := cam_core_banked match_engine_pipeline cam_write_noise cam_read_noise
.PHONY: help test-all test-top test-modules test-module test-model test-perf clean $(MODULE_TESTS:%=test-module-%)
@@ -27,7 +28,7 @@ $(MODULE_TESTS:%=test-module-%):
$(MAKE) -C tests/modules/$(@:test-module-%=%)
test-model:
uv run pytest tests/model -q
env -u PYTHONPATH -u PYTHONHOME $(PYTHON) -m pytest tests/model -q
test-perf:
$(MAKE) -C tests/perf

View File

@@ -37,10 +37,10 @@ WRITE_NOISE_EN ?= $(NOISE_EN)
WRITE_NOISE_RATE_NUM ?= $(NOISE_RATE_NUM)
WRITE_NOISE_RATE_DEN ?= $(NOISE_RATE_DEN)
WRITE_NOISE_BITS ?= $(NOISE_BITS)
READ_NOISE_EN ?=
READ_NOISE_RATE_NUM ?=
READ_NOISE_RATE_DEN ?=
READ_NOISE_BITS ?=
READ_NOISE_EN ?= $(NOISE_EN)
READ_NOISE_RATE_NUM ?= $(NOISE_RATE_NUM)
READ_NOISE_RATE_DEN ?= $(NOISE_RATE_DEN)
READ_NOISE_BITS ?= $(NOISE_BITS)
ifneq ($(strip $(WRITE_NOISE_EN)),)
COMPILE_ARGS += -GWRITE_NOISE_EN=$(WRITE_NOISE_EN)