Imported Upstream version 3.0.4
[debian/gnuradio] / usrp / fpga / toplevel / usrp_multi / usrp_multi.vh
1 // -*- verilog -*-
2 //
3 //  USRP - Universal Software Radio Peripheral
4 //
5 //  Copyright (C) 2006 Matt Ettus
6 //  Copyright (C) 2006 Martin Dudok van Heel
7 //
8 //  This program is free software; you can redistribute it and/or modify
9 //  it under the terms of the GNU General Public License as published by
10 //  the Free Software Foundation; either version 2 of the License, or
11 //  (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 //  GNU General Public License for more details.
17 //
18 //  You should have received a copy of the GNU General Public License
19 //  along with this program; if not, write to the Free Software
20 //  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
21 //
22
23 // ====================================================================
24 //            User control over what parts get included
25 //
26 //                  >>>> EDIT ONLY THIS SECTION <<<<
27 //                  Uncomment only ONE configuration
28 // ====================================================================
29
30 // ==== Multi usrp configurations ====
31 // Uncomment this for multi with 2 rx channels (w/ halfband) & 2 transmit channels
32 `include "usrp_multi_config_2rxhb_2tx.vh"
33
34 // Uncomment this for multi with 4 rx channels (w/o halfband) & 0 transmit channels
35 //`include "usrp_multi_config_4rx_0tx.vh"
36
37 // Uncomment this for multi with 2 rx channels (w/ halfband) & 0 transmit channels
38 //`include "usrp_multi_config_2rxhb_0tx.vh"
39
40 // Uncomment this for multi with 2 rx channels (w/o halfband) & 0 transmit channels
41 //`include "usrp_multi_config_2rx_0tx.vh"
42
43 // ==== Standard configurations (no multi support) ====
44 // Uncomment this for standard with 2 rx channels (w/ halfband) & 2 transmit channels
45 //  `include "../usrp_std/usrp_std_config_2rxhb_2tx.vh"
46
47 // Uncomment this for standard with 4 rx channels (w/o halfband) & 0 transmit channels
48 //`include "../usrp_std/usrp_std_config_4rx_0tx.vh"
49
50 // Add other "known to fit" configurations here...
51
52 // ====================================================================
53 // 
54 //                  >>>> DO NOT EDIT BELOW HERE <<<<
55 //
56 // [The stuff from here down is derived from the stuff included above]
57 //
58 // N.B., *all* the remainder of the code should be conditionalized
59 // only in terms of:
60 //
61 //  TX_ON, TX_EN_0, TX_EN_1, TX_EN_2, TX_EN_3, TX_CAP_NCHAN, TX_CAP_HB,
62 //  RX_ON, RX_EN_0, RX_EN_1, RX_EN_2, RX_EN_3, RX_CAP_NCHAN, RX_CAP_HB,
63 //  RX_NCO_ON, RX_CIC_ON
64 // ====================================================================
65 `ifdef MULTI_ON
66   `define COUNTER_32BIT_ON
67 `endif
68
69 `ifdef TX_ON
70
71  `ifdef TX_SINGLE
72   `define TX_EN_0
73   `define TX_CAP_NCHAN 3'd1
74  `endif
75
76  `ifdef TX_DUAL
77   `define TX_EN_0
78   `define TX_EN_1
79   `define TX_CAP_NCHAN 3'd2
80  `endif
81
82  `ifdef TX_QUAD
83   `define TX_EN_0
84   `define TX_EN_1
85   `define TX_EN_2
86   `define TX_EN_3
87   `define TX_CAP_NCHAN 3'd4
88  `endif
89
90  `ifdef TX_HB_ON
91   `define TX_CAP_HB   1
92  `else
93   `define TX_CAP_HB   0
94  `endif
95
96 `else   // !ifdef TX_ON
97
98  `define TX_CAP_NCHAN 3'd0
99  `define TX_CAP_HB 0
100
101 `endif // !ifdef TX_ON
102
103 // --------------------------------------------------------------------
104
105 `ifdef RX_ON
106
107  `ifdef RX_SINGLE
108   `define RX_EN_0
109   `define RX_CAP_NCHAN 3'd1
110  `endif
111
112  `ifdef RX_DUAL
113   `define RX_EN_0
114   `define RX_EN_1
115   `ifdef MULTI_ON
116     `define RX_CAP_NCHAN 3'd4
117   `else
118     `define RX_CAP_NCHAN 3'd2
119   `endif
120  `endif
121
122  `ifdef RX_QUAD
123   `define RX_EN_0
124   `define RX_EN_1
125   `define RX_EN_2
126   `define RX_EN_3
127   `define RX_CAP_NCHAN 3'd4
128  `endif
129
130  `ifdef RX_HB_ON
131   `define RX_CAP_HB   1
132  `else
133   `define RX_CAP_HB   0
134  `endif
135
136 `else   // !ifdef RX_ON
137
138  `define RX_CAP_NCHAN 3'd0
139  `define RX_CAP_HB 0
140
141 `endif // !ifdef RX_ON