summaryrefslogtreecommitdiff
path: root/gr-sounder/src/fpga/lib/sounder.v
diff options
context:
space:
mode:
Diffstat (limited to 'gr-sounder/src/fpga/lib/sounder.v')
-rw-r--r--gr-sounder/src/fpga/lib/sounder.v34
1 files changed, 16 insertions, 18 deletions
diff --git a/gr-sounder/src/fpga/lib/sounder.v b/gr-sounder/src/fpga/lib/sounder.v
index 58b563448..675be8881 100644
--- a/gr-sounder/src/fpga/lib/sounder.v
+++ b/gr-sounder/src/fpga/lib/sounder.v
@@ -23,8 +23,8 @@
`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
module sounder(clk_i, saddr_i, sdata_i, s_strobe_i,
- tx_strobe_i, tx_dac_i_o,tx_dac_q_o,
- rx_strobe_i, rx_adc_i_i,rx_adc_q_i,
+ tx_strobe_o, tx_dac_i_o, tx_dac_q_o,
+ rx_adc_i_i,rx_adc_q_i,
rx_strobe_o, rx_imp_i_o,rx_imp_q_o);
// System interface
@@ -34,12 +34,11 @@ module sounder(clk_i, saddr_i, sdata_i, s_strobe_i,
input s_strobe_i; // Configuration bus write
// Transmit subsystem
- input tx_strobe_i; // Generate an transmitter output sample
+ output tx_strobe_o; // Generate an transmitter output sample
output [13:0] tx_dac_i_o; // I channel transmitter output to DAC
output [13:0] tx_dac_q_o; // Q channel transmitter output to DAC
// Receive subsystem
- input rx_strobe_i; // Indicates receive sample ready from ADC
output rx_strobe_o; // Indicates output samples ready for Rx FIFO
input [15:0] rx_adc_i_i; // I channel input from ADC interface module
input [15:0] rx_adc_q_i; // Q channel input from ADC interface module
@@ -53,18 +52,17 @@ module sounder(clk_i, saddr_i, sdata_i, s_strobe_i,
wire loopback;
wire [4:0] degree;
+ wire [13:0] ampl;
wire [15:0] mask;
- wire [15:0] len;
-
- setting_reg #(`FR_USER_0) sr_mode
- ( .clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out({loopback,receive,transmit,reset}) );
-
- setting_reg #(`FR_USER_1) sr_lfsr_degree
- ( .clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),.out(degree) );
-
- lfsr_constants constants(.degree_i(degree),.mask_o(mask),.len_o(len));
+ wire ref_strobe;
+ wire sum_strobe;
+ sounder_ctrl master(.clk_i(clk_i),.rst_i(reset),.saddr_i(saddr_i),
+ .sdata_i(sdata_i),.s_strobe_i(s_strobe_i),
+ .reset_o(reset),.transmit_o(transmit),.receive_o(receive),.loopback_o(loopback),
+ .degree_o(degree),.ampl_o(ampl),.mask_o(mask),.tx_strobe_o(tx_strobe_o),
+ .rx_strobe_o(rx_strobe_o),.sum_strobe_o(sum_strobe),.ref_strobe_o(ref_strobe));
+
// Loopback implementation
wire [13:0] tx_i, tx_q;
wire [15:0] tx_i_ext, tx_q_ext;
@@ -80,13 +78,13 @@ module sounder(clk_i, saddr_i, sdata_i, s_strobe_i,
sounder_tx transmitter
( .clk_i(clk_i),.rst_i(reset),.ena_i(transmit),
- .strobe_i(tx_strobe_i),.mask_i(mask),
+ .strobe_i(tx_strobe_o),.mask_i(mask),.ampl_i(ampl),
.tx_i_o(tx_i),.tx_q_o(tx_q) );
sounder_rx receiver
( .clk_i(clk_i),.rst_i(reset),.ena_i(receive),
- .rx_strobe_i(rx_strobe_i),.tx_strobe_i(tx_strobe_i),.mask_i(mask),.degree_i(degree),.len_i(len),
- .rx_in_i_i(rx_i),.rx_in_q_i(rx_q),.rx_i_o(rx_imp_i_o),.rx_q_o(rx_imp_q_o),
- .rx_strobe_o(rx_strobe_o),.loop_i(loopback));
+ .sum_strobe_i(sum_strobe),.ref_strobe_i(ref_strobe),
+ .mask_i(mask),.degree_i(degree),
+ .rx_in_i_i(rx_i),.rx_in_q_i(rx_q),.rx_i_o(rx_imp_i_o),.rx_q_o(rx_imp_q_o));
endmodule // sounder