summaryrefslogtreecommitdiffstats
path: root/usrp2/vrt
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-12-28 11:47:44 -0800
committerMatt Ettus <matt@ettus.com>2010-12-28 11:47:44 -0800
commite0db4716d58ed6788fceb276aeb27b56ed65fcf3 (patch)
tree4ae3e639f1bcefa484f221584ee63d119080b5e0 /usrp2/vrt
parentc97440838aa740fc335c59914f6dfd6f492b69f8 (diff)
downloaduhd-e0db4716d58ed6788fceb276aeb27b56ed65fcf3.tar.gz
uhd-e0db4716d58ed6788fceb276aeb27b56ed65fcf3.tar.bz2
uhd-e0db4716d58ed6788fceb276aeb27b56ed65fcf3.zip
should keep cordic spinning and the rest of the tx going through
underruns. There is a timeout so it won't go forever.
Diffstat (limited to 'usrp2/vrt')
-rw-r--r--usrp2/vrt/vita_tx_control.v37
1 files changed, 33 insertions, 4 deletions
diff --git a/usrp2/vrt/vita_tx_control.v b/usrp2/vrt/vita_tx_control.v
index ab6da8bd0..223e20112 100644
--- a/usrp2/vrt/vita_tx_control.v
+++ b/usrp2/vrt/vita_tx_control.v
@@ -17,14 +17,12 @@ module vita_tx_control
// To DSP Core
output [WIDTH-1:0] sample,
- output run,
+ output reg run,
input strobe,
output [31:0] debug
);
- assign sample = sample_fifo_i[5+64+16+WIDTH-1:5+64+16];
-
wire [63:0] send_time = sample_fifo_i[63:0];
wire [15:0] seqnum = sample_fifo_i[79:64];
wire eop = sample_fifo_i[80];
@@ -169,11 +167,42 @@ module vita_tx_control
send_error <= 0;
endcase // case (ibs_state)
+
assign sample_fifo_dst_rdy_o = (ibs_state == IBS_ERROR) | (strobe & (ibs_state == IBS_RUN)); // FIXME also cleanout
- assign run = (ibs_state == IBS_RUN) | (ibs_state == IBS_CONT_BURST);
+
+ assign sample = (ibs_state == IBS_RUN) ? sample_fifo_i[5+64+16+WIDTH-1:5+64+16] : {WIDTH{1'b0}};
+ //assign run = (ibs_state == IBS_RUN) | (ibs_state == IBS_CONT_BURST);
assign error = send_error;
assign ack = send_ack;
+ localparam MAX_IDLE = 1000000;
+ // approx 10 ms timeout with a 100 MHz clock, but burning samples will slow that down
+ reg [19:0] countdown;
+
+ always @(posedge clk)
+ if(reset | clear)
+ begin
+ run <= 0;
+ countdown <= 0;
+ end
+ else
+ if (sample_fifo_src_rdy_i & sample_fifo_dst_rdy_o)
+ begin
+ if(eob & eop)
+ run <= 0;
+ else
+ if(sob)
+ begin
+ run <= 1;
+ countdown <= MAX_IDLE;
+ end
+ end
+ else
+ if (countdown == 0)
+ run <= 0;
+ else
+ countdown <= countdown - 1;
+
always @(posedge clk)
if(reset | clear)
packet_consumed <= 0;