Files
Mini-Nav/hw/sim/Makefile
SikongJueluo e4cbb5e30d feat(hw/rtl): implement full Top-K CAM search pipeline with serial result output
- add TOPK_K, FIFO_DEPTH, RESULT_SERIAL parameters to cam_params
- add candidate_fifo: synchronous ready/valid FIFO for (row, score) candidates
- add topk_tracker: tracks top-K candidates with clear/ready handshake
- add result_serializer: serializes packed Top-K array into rank-ordered stream
- refactor match_engine_pipeline from 4-state to 8-state Top-K pipeline
- extend cam_top with serial Top-K interface (result_rank/row/score/last)
- add backward-compatible top1_index/top1_score aliases from rank-0 beat
- add comprehensive tests for all new modules
2026-05-19 22:43:21 +08:00

43 lines
1.2 KiB
Makefile

PYTHON ?= python
MODULE_TESTS := cam_core_banked candidate_fifo match_engine_pipeline cam_write_noise cam_read_noise popcount_pipeline topk_tracker result_serializer
.PHONY: help test-all test-top test-modules test-module test-model test-perf clean $(MODULE_TESTS:%=test-module-%)
help:
@echo "Available hw/sim targets:"
@echo " make test-model"
@echo " make test-top"
@echo " make test-module MODULE=cam_core_banked"
@echo " make test-modules"
@echo " make test-perf"
@echo " make test-all"
@echo " make clean"
test-all: test-model test-top test-modules
test-top:
$(MAKE) -C tests/top
test-modules: $(MODULE_TESTS:%=test-module-%)
test-module:
@test -n "$(MODULE)" || (echo "Usage: make test-module MODULE=<name>"; exit 2)
$(MAKE) -C tests/modules/$(MODULE)
$(MODULE_TESTS:%=test-module-%):
$(MAKE) -C tests/modules/$(@:test-module-%=%)
test-model:
env -u PYTHONPATH -u PYTHONHOME $(PYTHON) -m pytest tests/model -q
test-perf:
$(MAKE) -C tests/perf
clean:
$(MAKE) -C tests/top clean
@for module in $(MODULE_TESTS); do \
$(MAKE) -C tests/modules/$$module clean || exit $$?; \
done
$(MAKE) -C tests/perf clean
rm -rf .pytest_cache tests/model/.pytest_cache