1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2014 iZsh <izsh at fail0verflow.com>
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // testbench for lp20khz_1MSa_iir_filter
9 `include "lp20khz_1MSa_iir_filter.v"
11 `define FIN "tb_tmp/data.in"
12 `define FOUT "tb_tmp/data.filtered"
14 module lp20khz_1MSa_iir_filter_tb;
21 wire [7:0] adc_filtered;
26 fin = $fopen(`FIN, "r");
28 $display("ERROR: can't open the data file");
31 fout = $fopen(`FOUT, "w+");
33 adc_d = $fgetc(fin); // read the first value
42 r = $fputc(adc_filtered, fout);
53 lp20khz_1MSa_iir_filter filter(clk, adc_d, data_rdy, adc_filtered);