diff options
Diffstat (limited to 'gr-sounder/src/fpga/tb')
-rw-r--r-- | gr-sounder/src/fpga/tb/.gitignore | 5 | ||||
-rw-r--r-- | gr-sounder/src/fpga/tb/Makefile.am | 30 | ||||
-rw-r--r-- | gr-sounder/src/fpga/tb/sounder_tb.sav | 57 | ||||
-rwxr-xr-x | gr-sounder/src/fpga/tb/sounder_tb.sh | 6 | ||||
-rw-r--r-- | gr-sounder/src/fpga/tb/sounder_tb.v | 238 | ||||
-rwxr-xr-x | gr-sounder/src/fpga/tb/sounder_tb_wave.sh | 2 |
6 files changed, 0 insertions, 338 deletions
diff --git a/gr-sounder/src/fpga/tb/.gitignore b/gr-sounder/src/fpga/tb/.gitignore deleted file mode 100644 index b05ab62aa..000000000 --- a/gr-sounder/src/fpga/tb/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/Makefile -/Makefile.in -/*.vcd -/sounder_tb -/*.out* diff --git a/gr-sounder/src/fpga/tb/Makefile.am b/gr-sounder/src/fpga/tb/Makefile.am deleted file mode 100644 index b21cb5f96..000000000 --- a/gr-sounder/src/fpga/tb/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright 2007,2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio 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 3, or (at your option) -# any later version. -# -# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += \ - sounder_tb.v \ - sounder_tb.sav \ - sounder_tb.sh \ - sounder_tb_wave.sh - -MOSTLYCLEANFILES += *.vcd *.out* sounder_tb diff --git a/gr-sounder/src/fpga/tb/sounder_tb.sav b/gr-sounder/src/fpga/tb/sounder_tb.sav deleted file mode 100644 index 25bc512bc..000000000 --- a/gr-sounder/src/fpga/tb/sounder_tb.sav +++ /dev/null @@ -1,57 +0,0 @@ -*-29.807737 317080000 -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 -@200 -- -@28 -sounder_tb.s_strobe -@22 -sounder_tb.saddr[6:0] -@200 -- -@28 -sounder_tb.uut.reset -sounder_tb.uut.transmit -sounder_tb.uut.receive -sounder_tb.uut.loopback -@200 -- -@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] -@28 -sounder_tb.tx_strobe -@200 -- -@8420 -sounder_tb.fifo_i[15:0] -@28 -sounder_tb.fifo_strobe -@200 -- -@28 -sounder_tb.uut.ref_strobe -sounder_tb.uut.sum_strobe -@200 -- -@28 -sounder_tb.clk -sounder_tb.uut.transmitter.pn -sounder_tb.uut.receiver.pn_ref -@8420 -sounder_tb.uut.receiver.prod_i[31:0] -sounder_tb.uut.receiver.scaled_i[31:0] -@8421 -sounder_tb.uut.receiver.sum_i[31:0] -@8420 -sounder_tb.uut.receiver.total_i[31:0] -@200 -- -@22 -sounder_tb.uut.master.len[16:0] -@200 -- diff --git a/gr-sounder/src/fpga/tb/sounder_tb.sh b/gr-sounder/src/fpga/tb/sounder_tb.sh deleted file mode 100755 index 28efc8d31..000000000 --- a/gr-sounder/src/fpga/tb/sounder_tb.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -iverilog -y ../lib/ -y ../../../../usrp/fpga/sdr_lib \ - sounder_tb.v -o sounder_tb && \ -./sounder_tb > sounder_tb.out && \ - grep 'r=0' sounder_tb.out | grep 'c=1' > sounder_tb.out2 - diff --git a/gr-sounder/src/fpga/tb/sounder_tb.v b/gr-sounder/src/fpga/tb/sounder_tb.v deleted file mode 100644 index 0e0cb55c2..000000000 --- a/gr-sounder/src/fpga/tb/sounder_tb.v +++ /dev/null @@ -1,238 +0,0 @@ -// -*- 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 -// - -`timescale 1ns/100ps - -`include "../lib/sounder.v" - -`define FR_MODE 7'd64 -`define bmFR_MODE_RESET 32'h0001 -`define bmFR_MODE_TX 32'h0002 -`define bmFR_MODE_RX 32'h0004 -`define bmFR_MODE_LP 32'h0008 - -`define FR_DEGREE 7'd65 -`define FR_AMPL 7'd66 - -module sounder_tb; - - // System bus - reg clk; - reg rst; - reg ena; - - // Configuration bus - reg [6:0] saddr; - reg [31:0] sdata; - reg s_strobe; - - // DAC bus - wire tx_strobe; - wire [13:0] tx_dac_i; - wire [13:0] tx_dac_q; - - // ADC bus - reg [15:0] rx_adc_i; - reg [15:0] rx_adc_q; - - // FIFO bus - wire fifo_strobe; - wire [15:0] fifo_i; - wire [15:0] fifo_q; - - // Configuration shadow registers - reg [31:0] mode; - reg [31:0] degree; - - sounder uut - (.clk_i(clk),.saddr_i(saddr),.sdata_i(sdata),.s_strobe_i(s_strobe), - .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)); - - // Start up initialization - initial - begin - clk = 0; - rst = 0; - ena = 0; - saddr = 0; - sdata = 0; - s_strobe = 0; - rx_adc_i = 0; - rx_adc_q = 0; - mode = 0; - degree = 0; - - @(posedge clk); - rst = 1; - @(posedge clk); - rst = 0; - @(posedge clk); - ena = 1; - end - - always - #5 clk <= ~clk; - - initial - begin - $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 - - // Test tasks - task write_cfg_register; - input [6:0] regno; - input [31:0] value; - - begin - @(posedge clk); - saddr <= #5 regno; - sdata <= #5 value; - s_strobe <= #5 1'b1; - @(posedge clk); - s_strobe <= #5 0; - end - endtask // write_cfg_register - - // Application reset line - task set_reset; - input reset; - - begin - mode = reset ? (mode | `bmFR_MODE_RESET) : (mode & ~`bmFR_MODE_RESET); - write_cfg_register(`FR_MODE, mode); - end - endtask // reset - - // Set the PN code degree - task set_degree; - input [5:0] degree; - begin - write_cfg_register(`FR_DEGREE, degree); - end - endtask // set_degree - - // Set the PN amplitude - task set_amplitude; - input [13:0] ampl; - begin - write_cfg_register(`FR_AMPL, ampl); - end - endtask // set_ampl - - // Turn on or off the transmitter - task enable_tx; - input tx; - - begin - mode = tx ? (mode | `bmFR_MODE_TX) : (mode & ~`bmFR_MODE_TX); - write_cfg_register(`FR_MODE, mode); - end - endtask // enable_tx - - // Turn on or off the receiver - task enable_rx; - input rx; - - begin - mode = rx ? (mode | `bmFR_MODE_RX) : (mode & ~`bmFR_MODE_RX); - write_cfg_register(`FR_MODE, mode); - end - endtask // enable_rx - - - // Turn on or off digital loopback - task enable_lp; - input lp; - - begin - mode = lp ? (mode | `bmFR_MODE_LP) : (mode & ~`bmFR_MODE_LP); - write_cfg_register(`FR_MODE, mode); - end - endtask // enable_lp - - // Test transmitter functionality - task test_tx; - input [5:0] degree; - input [31:0] test_len; - - begin - #20 set_reset(1); - #20 set_degree(degree); - #20 set_amplitude(14'h1000); - #20 enable_tx(1); - #20 enable_rx(0); - #20 enable_lp(0); - #20 set_reset(0); - #(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); - #20 set_degree(degree); - #20 enable_tx(1); - #20 enable_rx(1); - #20 enable_lp(1); - #20 set_reset(0); - #(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); - #20 set_degree(degree); - #20 enable_tx(0); - #20 enable_rx(1); - #20 enable_lp(0); - #20 set_reset(0); - #(test_len); - end - endtask // test_rx - - // Execute tests - initial - begin - #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 - diff --git a/gr-sounder/src/fpga/tb/sounder_tb_wave.sh b/gr-sounder/src/fpga/tb/sounder_tb_wave.sh deleted file mode 100755 index 4551d5c59..000000000 --- a/gr-sounder/src/fpga/tb/sounder_tb_wave.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -gtkwave sounder_tb.vcd sounder_tb.sav |