| AUTO_BUILD_ARGS = [] | |
| #!/usr/bin/env python3 | |
| """cocotb testbench for LPF_select module.""" | |
| import cocotb | |
| from cocotb.clock import Clock | |
| from cocotb.triggers import RisingEdge, Timer | |
| from pathlib import Path | |
| import sys | |
| async def test_lpf_select_basic_functionality(dut): | |
| """Test basic LPF selection functionality based on frequency thresholds.""" | |
| # Create and start a clock | |
| clock_period = 10 # ns | |
| cocotb.start_soon(Clock(dut.clock, clock_period, unit="ns").start()) | |
| # Initial reset-like condition - wait for some cycles | |
| await Timer(clock_period * 2, unit="ns") | |
| # Test cases: (frequency, expected LPF) | |
| # Format: (frequency in Hz, expected 7-bit LPF value) | |
| if __name__ == "__main__": | |
| from pathlib import Path | |
| from cocotb_tools.runner import get_runner | |
| project_root = Path(__file__).resolve().parents[1] | |
| sources = [ | |
| project_root / "reference" / "top.v" | |
| ] | |
| runner = get_runner("icarus") | |
| runner.build( | |
| sources=[str(path) for path in sources], | |
| hdl_toplevel='LPF_select', | |
| build_args=AUTO_BUILD_ARGS, | |
| always=True, | |
| ) | |
| runner.test( | |
| hdl_toplevel='LPF_select', | |
| test_module="tb", | |
| waves=False, | |
| ) | |
Xet Storage Details
- Size:
- 1.25 kB
- Xet hash:
- ef92840a65bda4c514d225c11a5e41878174c9406e5d070c5e1e0a779bd2964d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.