summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-10-12 23:21:39 -0700
committerMatt Ettus <matt@ettus.com>2010-10-12 23:21:39 -0700
commitee03f1d4acf5c7d3359c86baba5085660d63ebae (patch)
tree7dc719947066a31914c111fc867db51bf995782b
parentecea1b5b4a0c7eb6683d15ca15e176f57a5a372a (diff)
downloaduhd-ee03f1d4acf5c7d3359c86baba5085660d63ebae.tar.gz
uhd-ee03f1d4acf5c7d3359c86baba5085660d63ebae.tar.bz2
uhd-ee03f1d4acf5c7d3359c86baba5085660d63ebae.zip
now handles frames larger than the vita packet (i.e. with padding)
-rw-r--r--usrp2/vrt/vita_tx_deframer.v22
1 files changed, 16 insertions, 6 deletions
diff --git a/usrp2/vrt/vita_tx_deframer.v b/usrp2/vrt/vita_tx_deframer.v
index 40867cc55..7fb8e3893 100644
--- a/usrp2/vrt/vita_tx_deframer.v
+++ b/usrp2/vrt/vita_tx_deframer.v
@@ -70,11 +70,13 @@ module vita_tx_deframer
localparam VITA_PAYLOAD = 8;
localparam VITA_STORE = 9;
localparam VITA_TRAILER = 10;
+ localparam VITA_DUMP = 11;
wire [15:0] hdr_len = 2 + has_streamid_reg + has_classid_reg + has_classid_reg + has_secs_reg +
has_tics_reg + has_tics_reg + has_trailer_reg;
- wire eop = eof | (pkt_len==hdr_len); // FIXME would ignoring eof allow larger VITA packets?
+ wire vita_eof = (pkt_len==hdr_len);
+ wire eop = eof | vita_eof; // FIXME would ignoring eof allow larger VITA packets?
wire fifo_space;
always @(posedge clk)
@@ -101,12 +103,14 @@ module vita_tx_deframer
end
else
if((vita_state == VITA_STORE) & fifo_space)
- if(eop)
- if(has_trailer_reg)
+ if(vita_eof)
+ if(eof)
+ vita_state <= (USE_TRANS_HEADER==1) ? VITA_TRANS_HEADER : VITA_HEADER;
+ else if(has_trailer_reg)
vita_state <= VITA_TRAILER;
else
- vita_state <= (USE_TRANS_HEADER==1) ? VITA_TRANS_HEADER : VITA_HEADER;
- else
+ vita_state <= VITA_DUMP;
+ else
begin
vita_state <= VITA_PAYLOAD;
pkt_len <= pkt_len - 1;
@@ -172,7 +176,13 @@ module vita_tx_deframer
else
vector_phase <= vector_phase + 1;
VITA_TRAILER :
- vita_state <= (USE_TRANS_HEADER==1) ? VITA_TRANS_HEADER : VITA_HEADER;
+ if(eof)
+ vita_state <= (USE_TRANS_HEADER==1) ? VITA_TRANS_HEADER : VITA_HEADER;
+ else
+ vita_state <= VITA_DUMP;
+ VITA_DUMP :
+ if(eof)
+ vita_state <= (USE_TRANS_HEADER==1) ? VITA_TRANS_HEADER : VITA_HEADER;
VITA_STORE :
;
default :