mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
- Split cam_core into pure memory (cam_core.sv) and match engine (match_engine.sv) - Add cam_params.svh with centralized parameter definitions (NUM_ROWS, HASH_BITS, LANES, etc.) - Update cam_top.sv to use shared parameters and compose match_engine - Update Makefile to include new match_engine module and correct Verilator define syntax
34 lines
1.1 KiB
Makefile
34 lines
1.1 KiB
Makefile
# Minimal cocotb Makefile.
|
|
# Examples:
|
|
# make TESTCASE=basic_write_query_no_noise
|
|
# make TESTCASE=external_noise_mask EXTRA_DEFINES="+define+SIM_NOISE +define+SIM_DEBUG"
|
|
#
|
|
# Verilator is preferred. Icarus may not support all SystemVerilog constructs used here.
|
|
|
|
SIM ?= verilator
|
|
TOPLEVEL_LANG ?= verilog
|
|
TOPLEVEL := cam_top
|
|
MODULE ?= tests.test_cam_basic
|
|
|
|
NUM_ROWS ?= 512
|
|
HASH_BITS ?= 512
|
|
LANES ?= 16
|
|
|
|
EXTRA_ARGS += +define+NUM_ROWS=$(NUM_ROWS) +define+HASH_BITS=$(HASH_BITS) +define+LANES=$(LANES)
|
|
|
|
# cocotb passes PLUSARGS/EXTRA_ARGS differently across simulators. Keep
|
|
# SystemVerilog parameters explicit through COMPILE_ARGS for Verilator.
|
|
COMPILE_ARGS += -Wall -Wno-fatal
|
|
COMPILE_ARGS += -I$(PWD)/../rtl
|
|
COMPILE_ARGS += +define+SIM_DEBUG
|
|
COMPILE_ARGS += $(EXTRA_DEFINES)
|
|
|
|
VERILOG_SOURCES += $(PWD)/../rtl/popcount.sv
|
|
VERILOG_SOURCES += $(PWD)/../rtl/argmax_update.sv
|
|
|
|
VERILOG_SOURCES += $(PWD)/../rtl/cam_core.sv
|
|
VERILOG_SOURCES += $(PWD)/../rtl/match_engine.sv
|
|
VERILOG_SOURCES += $(PWD)/../rtl/cam_top.sv
|
|
|
|
include $(shell uv run cocotb-config --makefiles)/Makefile.sim
|