summaryrefslogtreecommitdiffstats
path: root/usrp2/vrt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-04 16:50:14 -0800
committerJosh Blum <josh@joshknows.com>2011-01-04 16:50:14 -0800
commit71b24ebf00d5549c97e1341594948232e33b1807 (patch)
treecbdff2ce481a6cd82d434285ad0bc16f7b3fcae6 /usrp2/vrt
parent8fda3238d3c169df96afd170d7eb7d7a8685660b (diff)
parenta83e88f8233fbea7ec60230acb04a573b9902a8b (diff)
downloaduhd-71b24ebf00d5549c97e1341594948232e33b1807.tar.gz
uhd-71b24ebf00d5549c97e1341594948232e33b1807.tar.bz2
uhd-71b24ebf00d5549c97e1341594948232e33b1807.zip
Merge branch 'cordic_policy' into next
Conflicts: usrp2/top/u2_rev3/u2_core.v usrp2/top/u2plus/u2plus_core.v
Diffstat (limited to 'usrp2/vrt')
-rw-r--r--usrp2/vrt/vita_tx_control.v34
1 files changed, 30 insertions, 4 deletions
diff --git a/usrp2/vrt/vita_tx_control.v b/usrp2/vrt/vita_tx_control.v
index ab6da8bd0..e966d987c 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,39 @@ 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 (ibs_state == IBS_RUN)
+ if(eob & eop & strobe & sample_fifo_src_rdy_i)
+ run <= 0;
+ else
+ begin
+ run <= 1;
+ countdown <= MAX_IDLE;
+ end
+ else
+ if (countdown == 0)
+ run <= 0;
+ else
+ countdown <= countdown - 1;
+
always @(posedge clk)
if(reset | clear)
packet_consumed <= 0;