mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
- 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
44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
# synth_cam_top_hier.ys — Hierarchy-preserving CAM top resource reference flow
|
|
# Run from hw/syn: yosys -s synth_cam_top_hier.ys
|
|
|
|
# Set include directories before reading RTL
|
|
verilog_defaults -push
|
|
verilog_defaults -add -I../rtl
|
|
verilog_defaults -add -I../rtl/core
|
|
verilog_defaults -add -I../rtl/noise
|
|
verilog_defaults -add -I../rtl/random
|
|
|
|
# Read RTL sources in canonical order
|
|
read_verilog -sv -D SYNTHESIS ../rtl/random/random128.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/noise/noise_mask_grouped.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/noise/cam_write_noise.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/noise/cam_read_noise.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/core/cam_core_banked.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/core/popcount_pipeline.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/core/candidate_fifo.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/core/topk_tracker.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/core/result_serializer.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/core/match_engine_pipeline.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/cam_noisy.sv
|
|
read_verilog -sv -D SYNTHESIS ../rtl/cam_top.sv
|
|
|
|
# Restore verilog defaults
|
|
verilog_defaults -pop
|
|
|
|
# Hierarchy check and elaboration
|
|
hierarchy -top cam_top -check
|
|
|
|
# Process and optimize
|
|
proc
|
|
opt
|
|
memory -nomap
|
|
|
|
# Ensure build directory exists for output files
|
|
exec -- mkdir -p build
|
|
|
|
# Resource statistics (JSON to file via tee, not mixed into logs)
|
|
tee -q -o build/cam_top_hier_resources.json stat -tech xilinx -json
|
|
|
|
# Final checks
|
|
check -noinit
|