diff options
author | Matt Ettus <matt@ettus.com> | 2010-10-12 23:21:39 -0700 |
---|---|---|
committer | Matt Ettus <matt@ettus.com> | 2010-11-11 18:07:08 -0800 |
commit | 7fd21927c3c5d8d95eed7ff66ed1a060c9affad2 (patch) | |
tree | 6369c40412bea51e11e0ca0fea0812085fca273c /usrp2/vrt/vita_tx_deframer.v | |
parent | 10427284e0e270a5b5bdc735da09d8fde9040537 (diff) | |
download | uhd-7fd21927c3c5d8d95eed7ff66ed1a060c9affad2.tar.gz uhd-7fd21927c3c5d8d95eed7ff66ed1a060c9affad2.tar.bz2 uhd-7fd21927c3c5d8d95eed7ff66ed1a060c9affad2.zip |
now handles frames larger than the vita packet (i.e. with padding)
Diffstat (limited to 'usrp2/vrt/vita_tx_deframer.v')
-rw-r--r-- | usrp2/vrt/vita_tx_deframer.v | 22 |
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 : |