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 5

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 2 eyalhoc
OUTFILE fir_NAME.v
31
INCLUDE def_fir.txt
32
 
33
ITER CX COEFF_NUM
34
 
35
##  Expected RobustVerilog parameters:
36
##  SWAP ORDER val       - order of FIR
37
##  SWAP COEFF_BITS val  - precision of coeeficients (bit num)
38
##  SWAP DIN_BITS val    - precision of input data (bit num)
39
##  SWAP MAC_NUM val     - number of multiplayers (determines architecture)
40
 
41
//  Built In Parameters:
42
//  
43
//    Filter Order              = ORDER
44
//    Input Precision           = DIN_BITS
45
//    Coefficient Precision     = COEFF_BITS
46
//    Number of serial FIR sons = MAC_NUM
47
//    Number of multiplayers    = MAC_NUM
48
//    Architecture              = ARCH
49
//    Sum of Products Latency   = LATENCY
50
 
51
module fir_NAME (PORTS);
52
 
53
        input  clk;
54
        input  reset;
55
        input  [EXPR(COEFF_BITS-1):0] kCX;
56
        input  [EXPR(DIN_BITS-1):0] data_in;
57
        output [EXPR(DOUT_BITS-1):0] data_out;
58
    input  valid_in;
59
        output valid_out;
60
 
61
 
62
IFDEF TRUE(MAC_NUM==1)
63
  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)
64
  fir_serial_TOPO fir(clk, reset, valid_in, CONCAT.REV(kCX ,), data_in, data_out, valid_out);
65
 
66
ELSE TRUE(MAC_NUM==1)
67
  IFDEF TRUE(COEFF_NUM==MAC_NUM)
68
  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)
69
  fir_parallel_TOPO fir(clk, reset, valid_in, CONCAT.REV(kCX ,), data_in, data_out, valid_out);
70
 
71
  ELSE TRUE(COEFF_NUM==MAC_NUM)
72
  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)
73
  fir_MAC_NUMserial_TOPO fir(clk, reset, valid_in, CONCAT.REV(kCX ,), data_in, data_out, valid_out);
74
 
75
  ENDIF TRUE(COEFF_NUM==MAC_NUM)
76
ENDIF TRUE(MAC_NUM==1)
77
 
78
 
79
endmodule

powered by: WebSVN 2.1.0

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