This week I took the bandpass filter piece from last week’s Python reference model and implemented it in SystemVerilog, then built a way to prove the hardware version actually matches the software version.
I wrote the filter as a pipelined chain of small multiply-add stages rather than one big calculation, since that structure runs much faster on real hardware. I also set up an automatic export from the Python model that generates matching test files — the same filter settings, a test signal, and the expected correct output — so both versions could be fed identical inputs and compared directly. First run surfaced two real bugs: a scaling error from how the lower-precision hardware numbers get converted back to normal values, and a timing offset where the hardware’s early outputs (before its internal pipeline fully “warms up”) were being compared against the wrong reference samples. After fixing both, the hardware version matched the software version exactly, sample for sample.
For later reference, here’s what I used/researched this week:
- Icarus Verilog for simulating and running the hardware version
- SystemVerilog, using a pipelined “transposed” filter structure suited for FPGAs
- Fixed-point number formatting (converting between normal numbers and the limited-precision format hardware uses)
I am scheduled on track relative to our project roadmap.
For next week, I plan to:
- Implement the fractional delay stage in SystemVerilog, verified the same way against the Python reference
- Replace the placeholder ultrasonic passband with a real measured leak recording once available
- Update mic spacing/count to match Wes’s finalized PCB geometry
- Coordinate with Wes to confirm the final array geometry matches the delay-table assumptions
