OpenCores
URL https://opencores.org/ocsvn/robust_fir/robust_fir/trunk

Subversion Repositories robust_fir

[/] [robust_fir/] [trunk/] [src/] [base/] [fir.v] - Blame information for rev 10

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 eyalhoc
<##//////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  Author: Eyal Hochberg                                      ////
4
////          eyal@provartec.com                                 ////
5
////                                                             ////
6
////  Downloaded from: http://www.opencores.org                  ////
7
/////////////////////////////////////////////////////////////////////
8
////                                                             ////
9
//// Copyright (C) 2010 Provartec LTD                            ////
10
//// www.provartec.com                                           ////
11
//// info@provartec.com                                          ////
12
////                                                             ////
13
//// This source file may be used and distributed without        ////
14
//// restriction provided that this copyright statement is not   ////
15
//// removed from the file and that any derivative work contains ////
16
//// the original copyright notice and the associated disclaimer.////
17
////                                                             ////
18
//// This source file is free software; you can redistribute it  ////
19
//// and/or modify it under the terms of the GNU Lesser General  ////
20
//// Public License as published by the Free Software Foundation.////
21
////                                                             ////
22
//// This source is distributed in the hope that it will be      ////
23
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
24
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
25
//// PURPOSE.  See the GNU Lesser General Public License for more////
26
//// details. http://www.gnu.org/licenses/lgpl.html              ////
27
////                                                             ////
28
//////////////////////////////////////////////////////////////////##>
29
 
30 7 eyalhoc
OUTDIR  fir_NAME
31 2 eyalhoc
OUTFILE fir_NAME.v
32
INCLUDE def_fir.txt
33
 
34
ITER CX COEFF_NUM
35
 
36
##  Expected RobustVerilog parameters:
37
##  SWAP ORDER val       - order of FIR
38
##  SWAP COEFF_BITS val  - precision of coeeficients (bit num)
39
##  SWAP DIN_BITS val    - precision of input data (bit num)
40
##  SWAP MAC_NUM val     - number of multiplayers (determines architecture)
41
 
42
//  Built In Parameters:
43
//  
44
//    Filter Order              = ORDER
45
//    Input Precision           = DIN_BITS
46
//    Coefficient Precision     = COEFF_BITS
47
//    Number of serial FIR sons = MAC_NUM
48
//    Number of multiplayers    = MAC_NUM
49
//    Architecture              = ARCH
50
//    Sum of Products Latency   = LATENCY
51
 
52
module fir_NAME (PORTS);
53
 
54
        input  clk;
55
        input  reset;
56
        input  [EXPR(COEFF_BITS-1):0] kCX;
57
        input  [EXPR(DIN_BITS-1):0] data_in;
58
        output [EXPR(DOUT_BITS-1):0] data_out;
59
    input  valid_in;
60
        output valid_out;
61
 
62
 
63
IFDEF TRUE(MAC_NUM==1)
64
  CREATE fir_serial.v def_fir_basic.txt DEFCMD(SWAP CONST(ORDER) ORDER) DEFCMD(SWAP CONST(COEFF_BITS) COEFF_BITS) DEFCMD(SWAP CONST(DIN_BITS) DIN_BITS)
65
  fir_serial_TOPO fir(clk, reset, valid_in, CONCAT.REV(kCX ,), data_in, data_out, valid_out);
66
 
67
ELSE TRUE(MAC_NUM==1)
68
  IFDEF TRUE(COEFF_NUM==MAC_NUM)
69
  CREATE fir_parallel.v def_fir_basic.txt DEFCMD(SWAP CONST(ORDER) ORDER) DEFCMD(SWAP CONST(COEFF_BITS) COEFF_BITS) DEFCMD(SWAP CONST(DIN_BITS) DIN_BITS)
70
  fir_parallel_TOPO fir(clk, reset, valid_in, CONCAT.REV(kCX ,), data_in, data_out, valid_out);
71
 
72
  ELSE TRUE(COEFF_NUM==MAC_NUM)
73
  CREATE fir_Nserial.v def_fir_Nserial.txt DEFCMD(SWAP CONST(ORDER) ORDER) DEFCMD(SWAP CONST(COEFF_BITS) COEFF_BITS) DEFCMD(SWAP CONST(DIN_BITS) DIN_BITS) DEFCMD(SWAP CONST(MAC_NUM) MAC_NUM)
74
  fir_MAC_NUMserial_TOPO fir(clk, reset, valid_in, CONCAT.REV(kCX ,), data_in, data_out, valid_out);
75
 
76
  ENDIF TRUE(COEFF_NUM==MAC_NUM)
77
ENDIF TRUE(MAC_NUM==1)
78
 
79
 
80
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.