summaryrefslogtreecommitdiffstats
path: root/usrp2/extramfifo
diff options
context:
space:
mode:
authorIan Buckley <ianb@server2.(none)>2010-09-01 00:44:39 -0700
committerMatt Ettus <matt@ettus.com>2010-11-11 12:08:00 -0800
commit0a272630e605b1ba71c0b7c8de9011c047cc578c (patch)
treeb4f9d98745b5afea8a36908d22af9b653132ec26 /usrp2/extramfifo
parentc81569139be394d514994833644ef710be1c886c (diff)
downloaduhd-0a272630e605b1ba71c0b7c8de9011c047cc578c.tar.gz
uhd-0a272630e605b1ba71c0b7c8de9011c047cc578c.tar.bz2
uhd-0a272630e605b1ba71c0b7c8de9011c047cc578c.zip
Enhanced test bench to be more like real world application
Diffstat (limited to 'usrp2/extramfifo')
-rw-r--r--usrp2/extramfifo/ext_fifo_tb.sh3
-rw-r--r--usrp2/extramfifo/ext_fifo_tb.v18
2 files changed, 14 insertions, 7 deletions
diff --git a/usrp2/extramfifo/ext_fifo_tb.sh b/usrp2/extramfifo/ext_fifo_tb.sh
index a56574102..dcfede37a 100644
--- a/usrp2/extramfifo/ext_fifo_tb.sh
+++ b/usrp2/extramfifo/ext_fifo_tb.sh
@@ -1 +1,2 @@
-fuse -prj ext_fifo_tb.prj -t work.glbl -t work.ext_fifo_tb -L unisims_ver -L xilinxcorelib_ver -o ext_fifo_tb
+#fuse -prj ext_fifo_tb.prj -t work.glbl -t work.ext_fifo_tb -L unisims_ver -L xilinxcorelib_ver -o ext_fifo_tb
+iverilog -c ext_fifo_tb.cmd -o ext_fifo_tb ext_fifo_tb.v
diff --git a/usrp2/extramfifo/ext_fifo_tb.v b/usrp2/extramfifo/ext_fifo_tb.v
index db5f31a9d..0eda89769 100644
--- a/usrp2/extramfifo/ext_fifo_tb.v
+++ b/usrp2/extramfifo/ext_fifo_tb.v
@@ -84,11 +84,17 @@ module ext_fifo_tb();
initial
begin
- repeat (20) @(negedge int_clk);
+ repeat (5) @(negedge int_clk);
+ dst_rdy_i <= 1;
+
+ while (src_rdy_o !== 1)
+ @(negedge int_clk);
// Fall through fifo, first output already valid
if (dataout !== ref_dataout)
- $display("Error: Expected %x, got %x",ref_dataout, dataout);
+ $display("Error: Expected %x, got %x @%d",ref_dataout, dataout, $time);
+ ref_dataout <= ref_dataout + src_rdy_o ;
+
// Decimate by 16 rate
while (ref_dataout < 2000)
begin
@@ -96,7 +102,7 @@ module ext_fifo_tb();
ref_dataout <= ref_dataout + src_rdy_o ;
dst_rdy_i <= src_rdy_o;
if ((dataout !== ref_dataout) && src_rdy_o)
- $display("Error: Expected %x, got %x",ref_dataout, dataout);
+ $display("Error: Expected %x, got %x @%d",ref_dataout, dataout, $time);
@(negedge int_clk);
dst_rdy_i <= 0;
repeat(14) @(negedge int_clk);
@@ -108,7 +114,7 @@ module ext_fifo_tb();
ref_dataout <= ref_dataout + src_rdy_o ;
dst_rdy_i <= src_rdy_o;
if ((dataout !== ref_dataout) && src_rdy_o)
- $display("Error: Expected %x, got %x",ref_dataout, dataout);
+ $display("Error: Expected %x, got %x @%d",ref_dataout, dataout, $time);
@(negedge int_clk);
dst_rdy_i <= 0;
repeat(6) @(negedge int_clk);
@@ -120,7 +126,7 @@ module ext_fifo_tb();
ref_dataout <= ref_dataout + src_rdy_o ;
dst_rdy_i <= src_rdy_o;
if ((dataout !== ref_dataout) && src_rdy_o)
- $display("Error: Expected %x, got %x",ref_dataout, dataout);
+ $display("Error: Expected %x, got %x @%d",ref_dataout, dataout, $time);
@(negedge int_clk);
dst_rdy_i <= 0;
repeat(2) @(negedge int_clk);
@@ -132,7 +138,7 @@ module ext_fifo_tb();
ref_dataout <= ref_dataout + src_rdy_o ;
dst_rdy_i <= src_rdy_o;
if ((dataout !== ref_dataout) && src_rdy_o)
- $display("Error: Expected %x, got %x",ref_dataout, dataout);
+ $display("Error: Expected %x, got %x @%d",ref_dataout, dataout, $time);
end // while (ref_dataout < 10000)