[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5109 - in gnuradio/branches/developers/jcorgan/snd/gr
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r5109 - in gnuradio/branches/developers/jcorgan/snd/gr-sounder/src: fpga/lib fpga/rbf/rev2 fpga/rbf/rev4 fpga/top python |
Date: |
Wed, 25 Apr 2007 14:11:19 -0600 (MDT) |
Author: jcorgan
Date: 2007-04-25 14:11:18 -0600 (Wed, 25 Apr 2007)
New Revision: 5109
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev2/usrp_sounder.rbf
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev4/usrp_sounder.rbf
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.qsf
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py
Log:
Added loopback, clean-up, work in progress.
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
===================================================================
--- gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
2007-04-25 19:52:59 UTC (rev 5108)
+++ gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
2007-04-25 20:11:18 UTC (rev 5109)
@@ -50,24 +50,37 @@
output [15:0] rx_imp_i_o; // I channel impulse response to Rx FIFO
output [15:0] rx_imp_q_o; // Q channel impulse response to Rx FIFO
+ // Configuration
wire [4:0] degree; // LFSR register length
wire [15:0] mask; // LFSR parity mask
wire [15:0] len; // PN code sequence length
+ wire loopback; // Enable digital loopback
+ // Loopback implementation
+ wire [15:0] tx_i, tx_q, rx_i, rx_q; // Internal transmit and receive data
bus
+
+ assign tx_dac_i_o = loopback ? 16'b0 : tx_i;
+ assign tx_dac_q_o = loopback ? 16'b0 : tx_q;
+ assign rx_i = loopback ? tx_i : rx_adc_i_i;
+ assign rx_q = loopback ? tx_q : rx_adc_q_i;
+
setting_reg #(`FR_USER_0) sr_lfsr_degree
(
.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),.out(degree)
);
+ setting_reg #(`FR_USER_1) sr_mode
+ (
.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
+ .out({loopback}) );
+
lfsr_constants constants(.degree_i(degree),.mask_o(mask),.len_o(len));
-
+
sounder_tx transmitter
(
.clk_i(clk_i),.rst_i(tx_rst_i),.ena_i(tx_enable_i),.strobe_i(tx_strobe_i),.mask_i(mask),
- .tx_i_o(tx_dac_i_o),.tx_q_o(tx_dac_q_o) );
+ .tx_i_o(tx_i),.tx_q_o(tx_q) );
sounder_rx receiver
( .clk_i(clk_i),.rst_i(rx_rst_i),.ena_i(rx_enable_i),
.rx_strobe_i(rx_strobe_i),.tx_strobe_i(tx_strobe_i),.mask_i(mask),.len_i(len),
-
.rx_in_i_i(rx_adc_i_i),.rx_in_q_i(rx_adc_q_i),.rx_i_o(rx_imp_i_o),.rx_q_o(rx_imp_q_o),
+
.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) );
endmodule // sounder
-
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
2007-04-25 19:52:59 UTC (rev 5108)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
2007-04-25 20:11:18 UTC (rev 5109)
@@ -58,6 +58,9 @@
lfsr reference
(
.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(lfsr_strobe),.mask_i(mask_i),.pn_o(pn)
);
+ wire [31:0] rx_i_ext, rx_q_ext;
+ sign_extend #(16,32) i_extend(rx_in_i_i, rx_i_ext);
+ sign_extend #(16,32) q_extend(rx_in_q_i, rx_q_ext);
reg [31:0] accum;
always @(posedge clk_i)
@@ -69,9 +72,9 @@
accum <= 32'b0;
else
if (pn)
- accum <= accum + rx_in_i_i;
+ accum <= accum + rx_i_ext;
else
- accum <= accum - rx_in_i_i;
+ accum <= accum - rx_i_ext;
assign rx_i_o = accum[31:16];
assign rx_q_o = accum[15:0];
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev2/usrp_sounder.rbf
===================================================================
(Binary files differ)
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev4/usrp_sounder.rbf
===================================================================
(Binary files differ)
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.qsf
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.qsf
2007-04-25 19:52:59 UTC (rev 5108)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.qsf
2007-04-25 20:11:18 UTC (rev 5109)
@@ -368,6 +368,7 @@
set_instance_assignment -name PARTITION_HIERARCHY no_file_for_top_partition
-to | -section_id Top
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
+set_global_assignment -name VERILOG_FILE
../../../../usrp/fpga/sdr_lib/sign_extend.v
set_global_assignment -name VERILOG_FILE ../lib/lfsr_constants.v
set_global_assignment -name VERILOG_FILE ../lib/sounder.v
set_global_assignment -name VERILOG_FILE ../lib/lfsr.v
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
2007-04-25 19:52:59 UTC (rev 5108)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
2007-04-25 20:11:18 UTC (rev 5109)
@@ -3,6 +3,7 @@
// USRP - Universal Software Radio Peripheral
//
// Copyright (C) 2003,2004 Matt Ettus
+// Copyright (C) 2007 Corgan Enterprises LLC
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -27,8 +28,6 @@
// Uncomment the following to include optional circuitry
-`include "config.vh"
-
module usrp_sounder
(output MYSTERY_SIGNAL,
input master_clk,
@@ -67,9 +66,9 @@
wire [15:0] debugdata,debugctrl;
assign MYSTERY_SIGNAL = 1'b0;
- wire clk64,clk128;
+ wire clk64;
- wire WR = usbctl[0];
+ // wire WR = usbctl[0];
wire RD = usbctl[1];
wire OE = usbctl[2];
@@ -80,45 +79,27 @@
wire tx_underrun, rx_overrun;
wire clear_status = FX2_1;
assign FX2_2 = rx_overrun;
- assign FX2_3 = tx_underrun;
+ assign FX2_3 = 1'b0; // tx_underrun;
wire [15:0] usbdata_out;
- wire [3:0] dac0mux,dac1mux,dac2mux,dac3mux;
-
- wire tx_realsignals;
wire [3:0] rx_numchan;
- wire [2:0] tx_numchan;
-
- wire [7:0] interp_rate, decim_rate;
- wire [15:0] tx_debugbus, rx_debugbus;
-
wire enable_tx, enable_rx;
wire tx_dsp_reset, rx_dsp_reset, tx_bus_reset, rx_bus_reset;
- wire [7:0] settings;
// Tri-state bus macro
bustri bustri( .data(usbdata_out),.enabledt(OE),.tridata(usbdata) );
assign clk64 = master_clk;
- wire [15:0] ch0tx,ch1tx,ch2tx,ch3tx; //,ch4tx,ch5tx,ch6tx,ch7tx;
- wire [15:0] ch0rx,ch1rx,ch2rx,ch3rx,ch4rx,ch5rx,ch6rx,ch7rx;
-
// TX
- wire [15:0] i_out_0,i_out_1,q_out_0,q_out_1;
- wire [15:0] bb_tx_i0,bb_tx_q0,bb_tx_i1,bb_tx_q1; //
bb_tx_i2,bb_tx_q2,bb_tx_i3,bb_tx_q3;
-
- wire strobe_interp, tx_sample_strobe;
+ wire tx_sample_strobe;
wire tx_empty;
wire serial_strobe;
wire [6:0] serial_addr;
wire [31:0] serial_data;
- reg [15:0] debug_counter;
- reg [15:0] loopback_i_0,loopback_q_0;
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Transmit Side
@@ -162,7 +143,7 @@
.rxclk(clk64),.rxstrobe(rx_strobe),
.clear_status(clear_status),
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .debugbus(rx_debugbus) );
+ .debugbus() );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -181,16 +162,16 @@
// Control Functions
wire [31:0] capabilities;
- assign capabilities[7] = 0; // `TX_CAP_HB;
- assign capabilities[6:4] = 2; // `TX_CAP_NCHAN;
- assign capabilities[3] = 0; // `RX_CAP_HB;
- assign capabilities[2:0] = 2; // `RX_CAP_NCHAN;
+ assign capabilities[7] = 0; // `TX_CAP_HB;
+ assign capabilities[6:4] = 2; // `TX_CAP_NCHAN;
+ assign capabilities[3] = 0; // `RX_CAP_HB;
+ assign capabilities[2:0] = 2; // `RX_CAP_NCHAN;
serial_io serial_io
( .master_clk(clk64),.serial_clock(SCLK),.serial_data_in(SDI),
.enable(SEN_FPGA),.reset(1'b0),.serial_data_out(SDO),
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
-
.readback_0({io_rx_a,io_tx_a}),.readback_1({io_rx_b,io_tx_b}),.readback_2(capabilities),.readback_3(32'hf0f0931a),
+ .readback_0(),.readback_1(),.readback_2(capabilities),.readback_3(),
.readback_4(),.readback_5(),.readback_6(),.readback_7()
);
@@ -201,9 +182,9 @@
.tx_bus_reset(tx_bus_reset),.rx_bus_reset(rx_bus_reset),
.tx_dsp_reset(tx_dsp_reset),.rx_dsp_reset(rx_dsp_reset),
.enable_tx(enable_tx),.enable_rx(enable_rx),
- .interp_rate(interp_rate),.decim_rate(decim_rate),
- .tx_sample_strobe(tx_sample_strobe),.strobe_interp(strobe_interp),
- .rx_sample_strobe(rx_sample_strobe),.strobe_decim(strobe_decim),
+ .interp_rate(),.decim_rate(),
+ .tx_sample_strobe(tx_sample_strobe),.strobe_interp(),
+ .rx_sample_strobe(rx_sample_strobe),.strobe_decim(),
.tx_empty(tx_empty),
.debug_0(),.debug_1(),
.debug_2(),.debug_3(),
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py
2007-04-25 19:52:59 UTC (rev 5108)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py
2007-04-25 20:11:18 UTC (rev 5109)
@@ -34,13 +34,14 @@
_tx_freq_divisor = 32e6*(TX_RATE_MAX+1)
class sounder_tx:
- def __init__(self, frequency, degree):
+ def __init__(self, frequency, degree, loopback):
self.trans = usrp.sink_s(fpga_filename='usrp_sounder.rbf')
self.subdev_spec = usrp.pick_tx_subdevice(self.trans)
self.subdev = usrp.selected_subdev(self.trans, self.subdev_spec)
self.trans.tune(0, self.subdev, frequency)
self.set_degree(degree);
-
+ self.set_loopback(loopback)
+
def turn_on(self):
self.trans.start()
@@ -50,6 +51,9 @@
def set_degree(self, value):
return self.trans._write_fpga_reg(usrp.FR_USER_0, value);
+ def set_loopback(self, value):
+ return self.trans._write_fpga_reg(usrp.FR_USER_1, value==True);
+
class sounder_rx:
def __init__(self, frequency, degree, samples):
self.fg = gr.flow_graph()
@@ -89,6 +93,9 @@
parser.add_option("-n", "--samples", type="int", default=-1,
help="number of samples to capture on receive, default
is infinite")
+ parser.add_option("-l", "--loopback", action="store_true", default=False,
+ help="enable digital loopback, default is disabled")
+
(options, args) = parser.parse_args()
if len(args) != 0 or not (options.transmit | options.receive):
@@ -100,7 +107,9 @@
if (options.transmit):
print "Enabling sounder transmitter."
- tx = sounder_tx(options.frequency, options.degree)
+ if (options.loopback):
+ print "Enabling digital loopback."
+ tx = sounder_tx(options.frequency, options.degree, options.loopback)
tx.turn_on()
try:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5109 - in gnuradio/branches/developers/jcorgan/snd/gr-sounder/src: fpga/lib fpga/rbf/rev2 fpga/rbf/rev4 fpga/top python,
jcorgan <=