[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5674 - in gnuradio/branches/developers/jcorgan/snd/gr
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r5674 - in gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga: lib tb top |
Date: |
Mon, 4 Jun 2007 20:16:27 -0600 (MDT) |
Author: jcorgan
Date: 2007-06-04 20:16:27 -0600 (Mon, 04 Jun 2007)
New Revision: 5674
Added:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_ctrl.v
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/dac_interface.v
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr.v
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
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/lib/strobe.v
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sav
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sh
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.v
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.rbf
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
Log:
Work in progress, still debugging receiver.
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/dac_interface.v
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/dac_interface.v
2007-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/dac_interface.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -43,11 +43,11 @@
// Register the clk64 clock in the clk128 domain
always @(posedge clk128)
- clk64_d <= clk_i;
+ clk64_d <= #1 clk_i;
// Register the tx data in the clk128 domain
always @(posedge clk128)
- tx_data_o <= clk64_d ? tx_i_i : tx_q_i;
+ tx_data_o <= #1 clk64_d ? tx_i_i : tx_q_i;
assign tx_sync_o = clk64_d;
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr.v
===================================================================
--- gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr.v
2007-06-05 01:55:20 UTC (rev 5673)
+++ gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -36,10 +36,10 @@
always @(posedge clk_i)
if (rst_i | ~ena_i)
- shifter <= 1;
+ shifter <= #5 1;
else
if (strobe_i)
- shifter <= {shifter[width-2:0],parity};
+ shifter <= #5 {shifter[width-2:0],parity};
assign pn_o = shifter[0];
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
2007-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -19,47 +19,44 @@
// Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
//
-module lfsr_constants(clk_i,rst_i,degree_i,mask_o,rx_len_o,tx_len_o);
+module lfsr_constants(clk_i,rst_i,degree_i,mask_o,len_o);
input clk_i;
input rst_i;
input [4:0] degree_i;
output reg [15:0] mask_o;
- output reg [16:0] tx_len_o;
- output reg [16:0] rx_len_o;
+ output reg [16:0] len_o;
integer len;
always @(posedge clk_i)
if (rst_i)
begin
- tx_len_o <= 17'b0;
- rx_len_o <= 17'b0;
- mask_o <= 16'b0;
+ len_o <= #5 17'b0;
+ mask_o <= #5 16'b0;
end
else
begin
- tx_len_o <= (1 << degree_i)-2;
- rx_len_o <= ((1 << degree_i) << 1)-3;
+ len_o <= #5 ((1 << degree_i) << 1)-3;
case (degree_i)
- 5'd00: mask_o <= 16'h0000;
- 5'd01: mask_o <= 16'h0001;
- 5'd02: mask_o <= 16'h0003;
- 5'd03: mask_o <= 16'h0005;
- 5'd04: mask_o <= 16'h0009;
- 5'd05: mask_o <= 16'h0012;
- 5'd06: mask_o <= 16'h0021;
- 5'd07: mask_o <= 16'h0041;
- 5'd08: mask_o <= 16'h008E;
- 5'd09: mask_o <= 16'h0108;
- 5'd10: mask_o <= 16'h0204;
- 5'd11: mask_o <= 16'h0402;
- 5'd12: mask_o <= 16'h0829;
- 5'd13: mask_o <= 16'h100D;
- 5'd14: mask_o <= 16'h2015;
- 5'd15: mask_o <= 16'h4001;
- 5'd16: mask_o <= 16'h8016;
- default: mask_o <= 16'h0000;
+ 5'd00: mask_o <= #5 16'h0000;
+ 5'd01: mask_o <= #5 16'h0001;
+ 5'd02: mask_o <= #5 16'h0003;
+ 5'd03: mask_o <= #5 16'h0005;
+ 5'd04: mask_o <= #5 16'h0009;
+ 5'd05: mask_o <= #5 16'h0012;
+ 5'd06: mask_o <= #5 16'h0021;
+ 5'd07: mask_o <= #5 16'h0041;
+ 5'd08: mask_o <= #5 16'h008E;
+ 5'd09: mask_o <= #5 16'h0108;
+ 5'd10: mask_o <= #5 16'h0204;
+ 5'd11: mask_o <= #5 16'h0402;
+ 5'd12: mask_o <= #5 16'h0829;
+ 5'd13: mask_o <= #5 16'h100D;
+ 5'd14: mask_o <= #5 16'h2015;
+ 5'd15: mask_o <= #5 16'h4001;
+ 5'd16: mask_o <= #5 16'h8016;
+ default: mask_o <= #5 16'h0000;
endcase // case(degree_i)
end // else: !if(rst_i)
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-06-05 01:55:20 UTC (rev 5673)
+++ gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -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 @@
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
@@ -55,25 +54,15 @@
wire [4:0] degree;
wire [13:0] ampl;
wire [15:0] mask;
- wire [16:0] tx_len;
- wire [16:0] rx_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) );
-
- setting_reg #(`FR_USER_2) sr_lfsr_ampl
- (
.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(ampl) );
-
- lfsr_constants constants
- (.clk_i(clk_i),.rst_i(rst_i),.degree_i(degree),.mask_o(mask),
- .rx_len_o(rx_len),.tx_len_o(tx_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;
@@ -89,14 +78,13 @@
sounder_tx transmitter
( .clk_i(clk_i),.rst_i(reset),.ena_i(transmit),
- .strobe_i(tx_strobe_i),.mask_i(mask),.ampl_i(ampl),
+ .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),.tx_len_i(tx_len),.rx_len_i(rx_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));
+ .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
Added:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_ctrl.v
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_ctrl.v
(rev 0)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_ctrl.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -0,0 +1,97 @@
+// -*- verilog -*-
+//
+// USRP - Universal Software Radio Peripheral
+//
+// 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
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
+//
+
+`include "../../../../usrp/firmware/include/fpga_regs_common.v"
+`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
+
+module sounder_ctrl(clk_i,rst_i,saddr_i,sdata_i,s_strobe_i,
+ reset_o,transmit_o,receive_o,loopback_o,
+ degree_o,ampl_o,mask_o,
+ tx_strobe_o,rx_strobe_o,sum_strobe_o,ref_strobe_o);
+
+ input clk_i; // Master clock @ 64 MHz
+ input rst_i; // Master synchronous reset
+ input [6:0] saddr_i; // Configuration bus address
+ input [31:0] sdata_i; // Configuration bus data
+ input s_strobe_i; // Configuration bus write
+ output reset_o;
+ output transmit_o;
+ output receive_o;
+ output loopback_o;
+ output [4:0] degree_o;
+ output [13:0] ampl_o;
+ output [15:0] mask_o;
+ output tx_strobe_o;
+ output rx_strobe_o;
+ output sum_strobe_o;
+ output ref_strobe_o;
+
+ 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_o,receive_o,transmit_o,reset_o}) );
+
+ 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_o) );
+
+ setting_reg #(`FR_USER_2) sr_lfsr_ampl
+ (
.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
+ .out(ampl_o) );
+
+ wire [16:0] len;
+ lfsr_constants constants
+ (.clk_i(clk_i),.rst_i(rst_i),.degree_i(degree_o),.mask_o(mask_o),
+ .len_o(len) );
+
+ reg [15:0] phase;
+ assign tx_strobe_o = ~phase[0];
+ assign ref_strobe_o = tx_strobe_o & !(phase>>1 == len>>1);
+ assign sum_strobe_o = (phase == len);
+
+ reg rx_strobe_o;
+ always @(posedge clk_i)
+ if (rst_i)
+ begin
+ phase <= #5 0;
+ rx_strobe_o <= #5 0;
+ end
+ else
+ if (phase == len)
+ begin
+ phase <= #5 0;
+ rx_strobe_o <= #5 1'b1;
+ end
+ else
+ begin
+ phase <= #5 phase + 16'b1;
+ rx_strobe_o <= #5 0;
+ end
+
+
+
+
+
+
+
+
+
+
+endmodule // sounder_ctrl
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-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -19,77 +19,63 @@
// Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
//
-module sounder_rx(clk_i,rst_i,ena_i,rx_strobe_i,tx_strobe_i,mask_i,degree_i,
- rx_len_i,tx_len_i,rx_in_i_i,rx_in_q_i,rx_i_o,rx_q_o,
- rx_strobe_o);
+module sounder_rx(clk_i,rst_i,ena_i,sum_strobe_i,ref_strobe_i,
+ mask_i,degree_i,rx_in_i_i,rx_in_q_i,rx_i_o,rx_q_o);
input clk_i; // Master clock
input rst_i; // Subsystem reset
input ena_i; // Subsystem enable
- input rx_strobe_i; // Strobe every received sample
- input tx_strobe_i; // Strobe every transmitted sample
+ input sum_strobe_i; // Strobe on last sample per period
+ input ref_strobe_i; // PN code reference retarded one sample per
period
input [15:0] mask_i; // PN code LFSR mask
input [4:0] degree_i; // PN code LFSR sequency degree
- input [16:0] rx_len_i; // PN code length in receiver clocks
- input [16:0] tx_len_i; // PN code length in transmit clocks
input [15:0] rx_in_i_i; // I channel on receive
input [15:0] rx_in_q_i; // Q channel on receive
output [15:0] rx_i_o; // I channel of impulse response
output [15:0] rx_q_o; // Q channel of impulse response
- output rx_strobe_o; // Impulse response value ready
- strobe #(17) rx_phase_strobe(.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),
-
.rate_i(rx_len_i),.strobe_i(rx_strobe_i),.strobe_o(rx_strobe_o),
- .count_o());
-
- wire ref_skip;
- strobe #(17) tx_phase_strobe(.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),
-
.rate_i(tx_len_i),.strobe_i(tx_strobe_i),.strobe_o(ref_skip),
- .count_o());
-
- wire pn_ref;
- wire ref_strobe = tx_strobe_i & ~ref_skip; // Retard reference phase once
per period
- lfsr ref_code
- (
.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(ref_strobe),.mask_i(mask_i),.pn_o(pn_ref)
);
-
- wire [5:0] offset = (5'd16-degree_i);
-
reg [31:0] sum_i, sum_q;
reg [31:0] total_i, total_q;
- wire [31:0] scaled_i = total_i << offset;
- wire [31:0] scaled_q = total_q << offset;
wire [31:0] i_ext, q_ext;
sign_extend #(16,32) i_extender(rx_in_i_i, i_ext);
sign_extend #(16,32) q_extender(rx_in_q_i, q_ext);
+ wire pn_ref;
+ lfsr ref_code
+ (
.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(ref_strobe_i),.mask_i(mask_i),.pn_o(pn_ref)
);
+
wire [31:0] prod_i = pn_ref ? i_ext : -i_ext;
wire [31:0] prod_q = pn_ref ? q_ext : -q_ext;
-
+
always @(posedge clk_i)
if (rst_i | ~ena_i)
begin
- sum_i <= 0;
- sum_q <= 0;
- total_i <= 0;
- total_q <= 0;
+ sum_i <= #5 0;
+ sum_q <= #5 0;
+ total_i <= #5 0;
+ total_q <= #5 0;
end
- else if (rx_strobe_o)
- begin
- total_i <= sum_i + prod_i;
- total_q <= sum_q + prod_q;
- sum_i <= 0;
- sum_q <= 0;
- end
- else if (rx_strobe_i)
- begin
- sum_i = sum_i + prod_i;
- sum_q = sum_q + prod_q;
- end
-
+ else
+ if (sum_strobe_i)
+ begin
+ total_i <= #5 sum_i + prod_i;
+ total_q <= #5 sum_q + prod_q;
+ sum_i <= #5 0;
+ sum_q <= #5 0;
+ end
+ else
+ begin
+ sum_i <= #5 sum_i + prod_i;
+ sum_q <= #5 sum_q + prod_q;
+ end
+
+ wire [5:0] offset = (5'd16-degree_i);
+ wire [31:0] scaled_i = total_i << offset;
+ wire [31:0] scaled_q = total_q << offset;
assign rx_i_o = scaled_i[31:16];
assign rx_q_o = scaled_q[31:16];
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/strobe.v
===================================================================
--- gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/strobe.v
2007-06-05 01:55:20 UTC (rev 5673)
+++ gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/strobe.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -35,12 +35,12 @@
always @(posedge clk_i)
if(rst_i | ~ena_i)
- counter <= 32'hFFFFFFFF; // First period is short by one
+ counter <= #5 32'hFFFFFFFF; // First period is short by one
else if(strobe_i)
if(counter == rate_i)
- counter <= 0;
+ counter <= #5 0;
else
- counter <= counter + 1;
+ counter <= #5 counter + 1;
assign strobe_o = (counter == rate_i) & strobe_i;
assign count_o = counter;
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sav
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sav
2007-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sav
2007-06-05 02:16:27 UTC (rev 5674)
@@ -1,11 +1,16 @@
-*-30.950331 3972700000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
+*-15.886647 5560000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
@28
-sounder_tb.uut.clk_i
-sounder_tb.rst
+sounder_tb.clk
address@hidden
+-
address@hidden
sounder_tb.s_strobe
@22
-sounder_tb.sdata[31:0]
+sounder_tb.saddr[6:0]
address@hidden
+-
@28
+sounder_tb.uut.reset
sounder_tb.uut.transmit
sounder_tb.uut.receive
sounder_tb.uut.loopback
@@ -13,34 +18,37 @@
-
@22
sounder_tb.uut.degree[4:0]
+sounder_tb.uut.mask[15:0]
+sounder_tb.uut.ampl[13:0]
+sounder_tb.uut.receiver.offset[5:0]
@200
-
@8420
+sounder_tb.tx_dac_i[13:0]
address@hidden
+sounder_tb.tx_strobe
address@hidden
+-
address@hidden
sounder_tb.fifo_i[15:0]
-sounder_tb.fifo_q[15:0]
address@hidden
+sounder_tb.fifo_strobe
@200
-
address@hidden
-sounder_tb.tx_dac_i[13:0]
address@hidden
+sounder_tb.uut.ref_strobe
+sounder_tb.uut.sum_strobe
@200
-
--
@28
-sounder_tb.uut.reset
-sounder_tb.uut.receiver.rx_strobe_i
-sounder_tb.uut.receiver.tx_strobe_i
address@hidden
-sounder_tb.fifo_strobe
address@hidden
-sounder_tb.uut.receiver.ref_strobe
sounder_tb.uut.transmitter.pn
sounder_tb.uut.receiver.pn_ref
address@hidden
+sounder_tb.uut.receiver.prod_i[31:0]
+sounder_tb.uut.receiver.scaled_i[31:0]
+sounder_tb.uut.receiver.sum_i[31:0]
+sounder_tb.uut.receiver.total_i[31:0]
@200
-
address@hidden
-sounder_tb.uut.receiver.rx_len_i[16:0]
-sounder_tb.uut.receiver.tx_len_i[16:0]
address@hidden
-sounder_tb.uut.receiver.prod_i[31:0]
address@hidden
-sounder_tb.uut.receiver.sum_i[31:0]
address@hidden
+sounder_tb.uut.master.len[16:0]
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sh
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sh
2007-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.sh
2007-06-05 02:16:27 UTC (rev 5674)
@@ -1,7 +1,6 @@
#!/bin/sh
iverilog -y ../lib/ -y ../../../../usrp/fpga/sdr_lib \
sounder_tb.v -o sounder_tb && \
-./sounder_tb > sounder_tb.out && \
-grep 'rst=0' sounder_tb.out | grep 'clk=1' > sounder_tb.out2 && \
-grep 'tx_strobe=1' sounder_tb.out2 > sounder_tb.out3
+./sounder_tb > sounder_tb.out && \
+ grep 'r=0' sounder_tb.out | grep 'c=1' > sounder_tb.out2
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.v
===================================================================
---
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.v
2007-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/tb/sounder_tb.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -45,12 +45,11 @@
reg s_strobe;
// DAC bus
- reg tx_strobe;
+ wire tx_strobe;
wire [13:0] tx_dac_i;
wire [13:0] tx_dac_q;
// ADC bus
- reg rx_strobe;
reg [15:0] rx_adc_i;
reg [15:0] rx_adc_q;
@@ -65,14 +64,10 @@
sounder uut
(.clk_i(clk),.saddr_i(saddr),.sdata_i(sdata),.s_strobe_i(s_strobe),
- .tx_strobe_i(tx_strobe),.tx_dac_i_o(tx_dac_i),.tx_dac_q_o(tx_dac_q),
- .rx_strobe_i(rx_strobe),.rx_adc_i_i(rx_adc_i),.rx_adc_q_i(rx_adc_q),
- .rx_strobe_o(fifo_strobe),.rx_imp_i_o(fifo_i),.rx_imp_q_o(fifo_q));
+ .tx_strobe_o(tx_strobe),.tx_dac_i_o(tx_dac_i),.tx_dac_q_o(tx_dac_q),
+ .rx_strobe_o(fifo_strobe),.rx_adc_i_i(rx_adc_i),.rx_adc_q_i(rx_adc_q),
+ .rx_imp_i_o(fifo_i),.rx_imp_q_o(fifo_q));
- // Drive tx_strobe @ half clock rate
- always @(posedge clk)
- tx_strobe <= ~tx_strobe;
-
// Start up initialization
initial
begin
@@ -82,8 +77,6 @@
saddr = 0;
sdata = 0;
s_strobe = 0;
- tx_strobe = 0;
- rx_strobe = 1;
rx_adc_i = 0;
rx_adc_q = 0;
mode = 0;
@@ -102,10 +95,11 @@
initial
begin
- $monitor($time, " clk=%b rst=%b tx_strobe=%b fifo_strobe=%b rxphs=%x
txphs=%x pn_o=%b pn_ref=%b sum_i=%x sum_q=%x fifo_i=%x fifo_q=",
- clk, uut.reset, tx_strobe, fifo_strobe,
uut.receiver.rx_phase_strobe.count_o,
-
uut.receiver.tx_phase_strobe.count_o,uut.transmitter.pn, uut.receiver.pn_ref,
- uut.receiver.sum_i,uut.receiver.sum_q,fifo_i, fifo_q);
+ $monitor($time, " c=%b r=%b phs=%d txs=%b rfs=%b rxs=%b sms=%b pn=%b
pnr=%b prd=%x sum=%x tot=%x",
+ clk, rst, uut.master.phase, uut.tx_strobe_o, uut.ref_strobe,
uut.rx_strobe_o,
+ uut.sum_strobe, uut.transmitter.pn, uut.receiver.pn_ref,
uut.receiver.prod_i,
+ uut.receiver.sum_i, uut.receiver.total_i);
+
$dumpfile("sounder_tb.vcd");
$dumpvars(0, sounder_tb);
end
@@ -117,11 +111,11 @@
begin
@(posedge clk);
- saddr <= regno;
- sdata <= value;
- s_strobe <= 1'b1;
+ saddr <= #5 regno;
+ sdata <= #5 value;
+ s_strobe <= #5 1'b1;
@(posedge clk);
- s_strobe <= 0;
+ s_strobe <= #5 0;
end
endtask // write_cfg_register
@@ -185,6 +179,7 @@
// Test transmitter functionality
task test_tx;
input [5:0] degree;
+ input [31:0] test_len;
begin
#20 set_reset(1);
@@ -194,14 +189,14 @@
#20 enable_rx(0);
#20 enable_lp(0);
#20 set_reset(0);
- #(uut.rx_len*20); // One PN code period
-
+ #(test_len);
end
endtask // test_tx
// Test loopback functionality
task test_lp;
input [5:0] degree;
+ input [31:0] test_len;
begin
#20 set_reset(1);
@@ -210,13 +205,14 @@
#20 enable_rx(1);
#20 enable_lp(1);
#20 set_reset(0);
- #((uut.rx_len+1)*uut.rx_len*20*2);
+ #(test_len);
end
endtask // test_lp
// Test receiver only functionality
task test_rx;
input [5:0] degree;
+ input [31:0] test_len;
begin
#20 set_reset(1);
@@ -225,17 +221,17 @@
#20 enable_rx(1);
#20 enable_lp(0);
#20 set_reset(0);
- #((uut.rx_len+1)*uut.rx_len*20*2);
+ #(test_len);
end
- endtask // test_lp
+ endtask // test_rx
// Execute tests
initial
begin
- #20 test_tx(8);
- #20 test_lp(8);
- #20 test_rx(8);
- #100 $finish;
+ #20 test_tx(8,255*20);
+ #20 test_lp(8,255*255*20*5);
+ //#20 test_rx(8,255*255*20*5);
+ #500 $finish;
end
endmodule
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-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.qsf
2007-06-05 02:16:27 UTC (rev 5674)
@@ -232,9 +232,9 @@
set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
set_global_assignment -name OPTIMIZE_HOLD_TIMING OFF
set_global_assignment -name OPTIMIZE_TIMING "NORMAL COMPILATION"
-set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC ON
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION ON
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING ON
+set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC OFF
+set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF
+set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF
set_global_assignment -name IO_PLACEMENT_OPTIMIZATION OFF
set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT EXTRA
set_global_assignment -name INC_PLC_MODE OFF
@@ -368,6 +368,8 @@
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 PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING
OFF
+set_global_assignment -name FITTER_EARLY_TIMING_ESTIMATE_MODE REALISTIC
set_global_assignment -name VERILOG_FILE ../lib/strobe.v
set_global_assignment -name VERILOG_FILE ../lib/lfsr_constants.v
set_global_assignment -name VERILOG_FILE ../lib/lfsr.v
@@ -375,6 +377,7 @@
set_global_assignment -name VERILOG_FILE ../lib/dacpll.v
set_global_assignment -name VERILOG_FILE ../lib/sounder_rx.v
set_global_assignment -name VERILOG_FILE ../lib/sounder_tx.v
+set_global_assignment -name VERILOG_FILE ../lib/sounder_ctrl.v
set_global_assignment -name VERILOG_FILE ../lib/sounder.v
set_global_assignment -name VERILOG_FILE
../../../../usrp/fpga/sdr_lib/atr_delay.v
set_global_assignment -name VERILOG_FILE
../../../../usrp/fpga/sdr_lib/sign_extend.v
@@ -391,5 +394,4 @@
set_global_assignment -name VERILOG_FILE
../../../../usrp/fpga/sdr_lib/rx_dcoffset.v
set_global_assignment -name VERILOG_FILE
../../../../usrp/fpga/sdr_lib/serial_io.v
set_global_assignment -name VERILOG_FILE usrp_sounder.v
-set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING
ON
-set_global_assignment -name FITTER_EARLY_TIMING_ESTIMATE_MODE PESSIMISTIC
\ No newline at end of file
+set_global_assignment -name FITTER_EFFORT "STANDARD FIT"
\ No newline at end of file
Modified:
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.rbf
===================================================================
(Binary files differ)
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-06-05 01:55:20 UTC (rev 5673)
+++
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
2007-06-05 02:16:27 UTC (rev 5674)
@@ -151,8 +151,8 @@
sounder sounder
(
.clk_i(clk64),.saddr_i(serial_addr),.sdata_i(serial_data),.s_strobe_i(serial_strobe),
- .tx_strobe_i(tx_sample_strobe),.tx_dac_i_o(tx_i),.tx_dac_q_o(tx_q),
-
.rx_strobe_i(rx_sample_strobe),.rx_adc_i_i(rx_adc0_i),.rx_adc_q_i(rx_adc0_q),
+ .tx_strobe_o(tx_sample_strobe),.tx_dac_i_o(tx_i),.tx_dac_q_o(tx_q),
+ .rx_adc_i_i(rx_adc0_i),.rx_adc_q_i(rx_adc0_q),
.rx_strobe_o(rx_strobe),.rx_imp_i_o(rx_buf_i),.rx_imp_q_o(rx_buf_q)
);
@@ -182,7 +182,7 @@
.tx_dsp_reset(tx_dsp_reset),.rx_dsp_reset(rx_dsp_reset),
.enable_tx(enable_tx),.enable_rx(enable_rx),
.interp_rate(),.decim_rate(),
- .tx_sample_strobe(tx_sample_strobe),.strobe_interp(),
+ .tx_sample_strobe(),.strobe_interp(),
.rx_sample_strobe(rx_sample_strobe),.strobe_decim(),
.tx_empty(tx_empty),
.debug_0(),.debug_1(),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5674 - in gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga: lib tb top,
jcorgan <=