source: PlatformSupport/Deprecated/pcores/radio_bridge_v1_08_a/hdl/verilog/radio_bridge.v

Last change on this file was 596, checked in by murphpo, 17 years ago

Adding register stage to ADC data inputs

File size: 11.4 KB
Line 
1//////////////////////////////////////////////////////////
2// Copyright (c) 2006 Rice University           //
3// All Rights Reserved                  //
4// This code is covered by the Rice-WARP license    //
5// See http://warp.rice.edu/license/ for details    //
6//////////////////////////////////////////////////////////
7
8module radio_bridge
9(
10    converter_clock_in,
11    converter_clock_out,
12   
13    user_RSSI_ADC_clk,
14    radio_RSSI_ADC_clk,
15
16    user_RSSI_ADC_D,
17
18    user_EEPROM_IO_T,
19    user_EEPROM_IO_O,
20    user_EEPROM_IO_I,
21   
22    user_TxModelStart,
23
24    radio_EEPROM_IO,
25   
26    radio_DAC_I,
27    radio_DAC_Q,
28   
29    radio_ADC_I,
30    radio_ADC_Q,
31
32    user_DAC_I,
33    user_DAC_Q,
34   
35    user_ADC_I,
36    user_ADC_Q,
37   
38    radio_B,
39    user_Tx_gain,
40    user_RxBB_gain,
41    user_RxRF_gain,
42
43    user_SHDN_external,
44    user_RxEn_external,
45    user_TxEn_external,
46    user_RxHP_external,
47
48    controller_spi_clk,
49    controller_spi_data,
50    controller_radio_cs,
51    controller_dac_cs,
52    controller_SHDN,
53    controller_TxEn,
54    controller_RxEn,
55    controller_RxHP,
56    controller_24PA,
57    controller_5PA,
58    controller_ANTSW,
59    controller_LED,
60    controller_RX_ADC_DCS,
61    controller_RX_ADC_DFS,
62    controller_RX_ADC_PWDNA,
63    controller_RX_ADC_PWDNB,
64    controller_DIPSW,
65    controller_RSSI_ADC_CLAMP,
66    controller_RSSI_ADC_HIZ,
67    controller_RSSI_ADC_SLEEP,
68    controller_RSSI_ADC_D,
69    controller_TxStart,
70
71    controller_LD,
72    controller_RX_ADC_OTRA,
73    controller_RX_ADC_OTRB,
74    controller_RSSI_ADC_OTR,
75    controller_DAC_PLL_LOCK,
76    controller_DAC_RESET,
77
78    controller_SHDN_external,
79    controller_RxEn_external,
80    controller_TxEn_external,
81    controller_RxHP_external,
82
83    dac_spi_data,
84    dac_spi_cs,
85    dac_spi_clk,
86
87    radio_spi_clk,
88    radio_spi_data,
89    radio_spi_cs,
90
91    radio_SHDN,
92    radio_TxEn,
93    radio_RxEn,
94    radio_RxHP,
95    radio_24PA,
96    radio_5PA,
97    radio_ANTSW,
98    radio_LED,
99    radio_RX_ADC_DCS,
100    radio_RX_ADC_DFS,
101    radio_RX_ADC_PWDNA,
102    radio_RX_ADC_PWDNB,
103    radio_DIPSW,
104    radio_RSSI_ADC_CLAMP,
105    radio_RSSI_ADC_HIZ,
106    radio_RSSI_ADC_SLEEP,
107    radio_RSSI_ADC_D,
108
109    radio_LD,
110    radio_RX_ADC_OTRA,
111    radio_RX_ADC_OTRB,
112    radio_RSSI_ADC_OTR,
113    radio_DAC_PLL_LOCK,
114    radio_DAC_RESET
115);
116
117/**********************/
118/* Clock & Data Ports */
119/**********************/
120input   converter_clock_in;
121output  converter_clock_out;
122
123input   user_RSSI_ADC_clk;
124output  radio_RSSI_ADC_clk;
125output  [0:9] user_RSSI_ADC_D;
126
127input   user_EEPROM_IO_T;
128input   user_EEPROM_IO_O;
129output  user_EEPROM_IO_I;
130
131output  user_TxModelStart;
132
133output  [0:15] radio_DAC_I;
134output  [0:15] radio_DAC_Q;
135
136input   [0:13] radio_ADC_I;
137input   [0:13] radio_ADC_Q;
138
139input   [0:15] user_DAC_I;
140input   [0:15] user_DAC_Q;
141
142output  [0:13] user_ADC_I;
143output  [0:13] user_ADC_Q;
144
145input   [0:1] user_RxRF_gain;
146input   [0:4] user_RxBB_gain;
147
148input   [0:5] user_Tx_gain;
149
150/* radio_B is a 7-bit bus */
151/* In Rx mode, radio_B[0:1] = RF gain, radio_B[2:6] = baseband gain */
152/* In Tx mode, radio_B[1:6] = gain, radio_B[0] is unused */
153output  [0:6] radio_B;
154
155input   user_SHDN_external;
156input   user_RxEn_external;
157input   user_TxEn_external;
158input   user_RxHP_external;
159
160/*******************************************/
161/* Radio Controller <-> Radio Bridge Ports */
162/*******************************************/
163input   controller_spi_clk;
164input   controller_spi_data;
165input   controller_radio_cs;
166input   controller_dac_cs;
167
168input   controller_SHDN;
169input   controller_TxEn;
170input   controller_RxEn;
171input   controller_RxHP;
172input   controller_24PA;
173input   controller_5PA;
174input   [0:1] controller_ANTSW;
175input   [0:2] controller_LED;
176input   controller_RX_ADC_DCS;
177input   controller_RX_ADC_DFS;
178input   controller_RX_ADC_PWDNA;
179input   controller_RX_ADC_PWDNB;
180input   controller_RSSI_ADC_CLAMP;
181input   controller_RSSI_ADC_HIZ;
182input   controller_RSSI_ADC_SLEEP;
183input   controller_DAC_RESET;
184input   controller_TxStart;
185
186output  [0:3] controller_DIPSW;
187output  [0:9] controller_RSSI_ADC_D;
188output  controller_LD;
189output  controller_RX_ADC_OTRA;
190output  controller_RX_ADC_OTRB;
191output  controller_RSSI_ADC_OTR;
192output  controller_DAC_PLL_LOCK;
193
194output  controller_SHDN_external;
195output  controller_RxEn_external;
196output  controller_TxEn_external;
197output  controller_RxHP_external;
198
199/**************************************/
200/* Radio Bridge <-> Radio Board Ports */
201/**************************************/
202output  dac_spi_data;
203output  dac_spi_cs;
204output  dac_spi_clk;
205
206output  radio_spi_clk;
207output  radio_spi_data;
208output  radio_spi_cs;
209
210output  radio_SHDN;
211output  radio_TxEn;
212output  radio_RxEn;
213output  radio_RxHP;
214output  radio_24PA;
215output  radio_5PA;
216output  [0:1] radio_ANTSW;
217output  [0:2] radio_LED;
218output  radio_RX_ADC_DCS;
219output  radio_RX_ADC_DFS;
220output  radio_RX_ADC_PWDNA;
221output  radio_RX_ADC_PWDNB;
222output  radio_RSSI_ADC_CLAMP;
223output  radio_RSSI_ADC_HIZ;
224output  radio_RSSI_ADC_SLEEP;
225output  radio_DAC_RESET;
226
227input   [0:9] radio_RSSI_ADC_D;
228input   radio_LD;
229input   radio_RX_ADC_OTRA;
230input   radio_RX_ADC_OTRB;
231input   radio_RSSI_ADC_OTR;
232input   radio_DAC_PLL_LOCK;
233input   [0:3] radio_DIPSW;
234
235inout   radio_EEPROM_IO;
236
237//All the outputs will be registered using IOB registers
238reg radio_RSSI_ADC_clk;
239reg [0:9] user_RSSI_ADC_D;
240reg [0:15] radio_DAC_I;
241reg [0:15] radio_DAC_Q;
242
243reg [0:13] user_ADC_I;
244reg [0:13] user_ADC_Q;
245
246reg [0:13] radio_ADC_I_nReg;
247reg [0:13] radio_ADC_Q_nReg;
248
249reg [0:6] radio_B;
250reg [0:3] controller_DIPSW;
251reg [0:9] controller_RSSI_ADC_D;
252reg controller_LD;
253reg controller_RX_ADC_OTRA;
254reg controller_RX_ADC_OTRB;
255reg controller_RSSI_ADC_OTR;
256reg controller_DAC_PLL_LOCK;
257reg dac_spi_data;
258reg dac_spi_cs;
259reg dac_spi_clk;
260reg radio_spi_clk;
261reg radio_spi_data;
262reg radio_spi_cs;
263reg radio_SHDN;
264reg radio_TxEn;
265reg radio_RxEn;
266reg radio_RxHP;
267reg radio_24PA;
268reg radio_5PA;
269reg [0:1] radio_ANTSW;
270reg [0:2] radio_LED;
271reg radio_RX_ADC_DCS;
272reg radio_RX_ADC_DFS;
273reg radio_RX_ADC_PWDNA;
274reg radio_RX_ADC_PWDNB;
275reg radio_RSSI_ADC_CLAMP;
276reg radio_RSSI_ADC_HIZ;
277reg radio_RSSI_ADC_SLEEP;
278reg radio_DAC_RESET;
279
280//Drive the clock out to the ADC/DACs
281//synthesis attribute IOB of converter_clock_out IS true;
282OFDDRRSE OFDDRRSE_inst (
283    .Q(converter_clock_out),      // Data output (connect directly to top-level port)
284    .C0(converter_clock_in),    // 0 degree clock input
285    .C1(~converter_clock_in),    // 180 degree clock input
286    .CE(1'b1),    // Clock enable input
287    .D0(1'b1),    // Posedge data input
288    .D1(1'b0),    // Negedge data input
289    .R(1'b0),      // Synchronous reset input
290    .S(1'b0)       // Synchronous preset input
291);
292
293//Pass the Tx start signal through to the user port
294// This is an internal signal, so it won't be registered here
295assign  user_TxModelStart = controller_TxStart;
296
297// Pass user_external signals to the controller
298assign controller_SHDN_external = user_SHDN_external;
299assign controller_RxEn_external = user_RxEn_external;
300assign controller_TxEn_external = user_TxEn_external;
301assign controller_RxHP_external = user_RxHP_external;
302
303
304//Make the gain mux default to the Tx settings, unless Rx is active
305//The Tx gain needs to be zero when TxEn is raised
306//The radio controller outputs zero for TxGain by default
307wire    [0:6] radio_B_preReg;
308assign radio_B_preReg = radio_RxEn ? {user_RxRF_gain, user_RxBB_gain} : {1'b0, user_Tx_gain};
309
310
311/********************************************/
312/* Instantiate the IOBUF for EEPROM Devices */
313/********************************************/
314IOBUF xIOBUF(
315    .T(user_EEPROM_IO_T),
316    .I(user_EEPROM_IO_O),
317    .O(user_EEPROM_IO_I),
318    .IO(radio_EEPROM_IO)
319);
320
321//Capture the incoming ADC signals on the negative
322// edge of the converter clock
323//synthesis attribute IOB of radio_ADC_I_nReg IS true;
324//synthesis attribute IOB of radio_ADC_Q_nReg IS true;
325always @( negedge converter_clock_in )
326begin
327    radio_ADC_I_nReg <= radio_ADC_I;
328    radio_ADC_Q_nReg <= radio_ADC_Q;
329end
330
331always @( posedge converter_clock_in )
332begin
333    /*******************************************/
334    /* OFDM Cores -> Radio Board Drivers */
335    /*******************************************/
336    radio_B <= radio_B_preReg;
337
338    radio_RSSI_ADC_clk <= user_RSSI_ADC_clk;
339
340    user_ADC_I <= radio_ADC_I_nReg;
341    user_ADC_Q <= radio_ADC_Q_nReg;
342
343    radio_DAC_I <= user_DAC_I;
344    radio_DAC_Q <= user_DAC_Q;
345
346    /*******************************************/
347    /* Radio Controller -> Radio Board Drivers */
348    /*******************************************/
349    dac_spi_clk <= controller_spi_clk;
350    dac_spi_data <= controller_spi_data;
351    dac_spi_cs <= controller_dac_cs;
352    radio_spi_clk <= controller_spi_clk;
353    radio_spi_data <= controller_spi_data;
354    radio_spi_cs <= controller_radio_cs;
355    radio_SHDN <= controller_SHDN;
356    radio_TxEn <= controller_TxEn;
357    radio_RxEn <= controller_RxEn;
358    radio_RxHP <= controller_RxHP;
359    radio_24PA <= controller_24PA;
360    radio_5PA <= controller_5PA;
361    radio_ANTSW <= controller_ANTSW;
362    radio_LED <= controller_LED;
363    radio_RX_ADC_DCS <= controller_RX_ADC_DCS;
364    radio_RX_ADC_DFS <= controller_RX_ADC_DFS;
365    radio_RX_ADC_PWDNA <= controller_RX_ADC_PWDNA;
366    radio_RX_ADC_PWDNB <= controller_RX_ADC_PWDNB;
367    radio_RSSI_ADC_CLAMP <= controller_RSSI_ADC_CLAMP;
368    radio_RSSI_ADC_HIZ <= controller_RSSI_ADC_HIZ;
369    radio_RSSI_ADC_SLEEP <= controller_RSSI_ADC_SLEEP;
370
371    /*******************************************/
372    /* Radio Board -> Radio Controller Drivers */
373    /*******************************************/
374    controller_DIPSW <= radio_DIPSW;
375    controller_RSSI_ADC_D <= radio_RSSI_ADC_D;
376    user_RSSI_ADC_D <= radio_RSSI_ADC_D;
377    controller_LD <= radio_LD;
378    controller_RX_ADC_OTRA <= radio_RX_ADC_OTRA;
379    controller_RX_ADC_OTRB <= radio_RX_ADC_OTRB;
380    controller_RSSI_ADC_OTR <= radio_RSSI_ADC_OTR;
381    controller_DAC_PLL_LOCK <= radio_DAC_PLL_LOCK;
382    radio_DAC_RESET <= controller_DAC_RESET;
383end
384
385//Use XST attributes to force the registers for these signals into the IOBs
386//synthesis attribute IOB of radio_RSSI_ADC_clk IS true;
387//synthesis attribute IOB of user_RSSI_ADC_D IS true;
388//synthesis attribute IOB of radio_DAC_I IS true;
389//synthesis attribute IOB of radio_DAC_Q IS true;
390//synthesis attribute IOB of radio_B IS true;
391//synthesis attribute IOB of controller_DIPSW IS true;
392//synthesis attribute IOB of controller_RSSI_ADC_D IS true;
393//synthesis attribute IOB of controller_LD IS true;
394//synthesis attribute IOB of controller_RX_ADC_OTRA IS true;
395//synthesis attribute IOB of controller_RX_ADC_OTRB IS true;
396//synthesis attribute IOB of controller_RSSI_ADC_OTR IS true;
397//synthesis attribute IOB of controller_DAC_PLL_LOCK IS true;
398//synthesis attribute IOB of dac_spi_data IS true;
399//synthesis attribute IOB of dac_spi_cs IS true;
400//synthesis attribute IOB of dac_spi_clk IS true;
401//synthesis attribute IOB of radio_spi_clk IS true;
402//synthesis attribute IOB of radio_spi_data IS true;
403//synthesis attribute IOB of radio_spi_cs IS true;
404//synthesis attribute IOB of radio_SHDN IS true;
405//synthesis attribute IOB of radio_TxEn IS true;
406//synthesis attribute IOB of radio_RxEn IS true;
407//synthesis attribute IOB of radio_RxHP IS true;
408//synthesis attribute IOB of radio_24PA IS true;
409//synthesis attribute IOB of radio_5PA IS true;
410//synthesis attribute IOB of radio_ANTSW IS true;
411//synthesis attribute IOB of radio_LED IS true;
412//synthesis attribute IOB of radio_RX_ADC_DCS IS true;
413//synthesis attribute IOB of radio_RX_ADC_DFS IS true;
414//synthesis attribute IOB of radio_RX_ADC_PWDNA IS true;
415//synthesis attribute IOB of radio_RX_ADC_PWDNB IS true;
416//synthesis attribute IOB of radio_RSSI_ADC_CLAMP IS true;
417//synthesis attribute IOB of radio_RSSI_ADC_HIZ IS true;
418//synthesis attribute IOB of radio_RSSI_ADC_SLEEP IS true;
419//synthesis attribute IOB of radio_DAC_RESET IS true;
420
421endmodule
Note: See TracBrowser for help on using the repository browser.