[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 52/148: seems to correctly deframe packets.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 52/148: seems to correctly deframe packets. now need to consume them. |
Date: |
Mon, 15 Aug 2016 00:47:23 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.
commit c9ed54929e945ac35ddcf618286c7bab8ef4696e
Author: Matt Ettus <address@hidden>
Date: Tue Dec 8 23:51:39 2009 -0800
seems to correctly deframe packets. now need to consume them.
---
usrp2/fpga/vrt/vita_tx_deframer.v | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/usrp2/fpga/vrt/vita_tx_deframer.v
b/usrp2/fpga/vrt/vita_tx_deframer.v
index 3df88d7..c58f235 100644
--- a/usrp2/fpga/vrt/vita_tx_deframer.v
+++ b/usrp2/fpga/vrt/vita_tx_deframer.v
@@ -38,8 +38,10 @@ module vita_tx_deframer
reg has_streamid_reg, has_classid_reg, has_secs_reg,
has_tics_reg;
reg has_trailer_reg, is_sob_reg, is_eob_reg;
- reg [1:0] vector_phase;
- wire line_done;
+
+ reg [15:0] pkt_len;
+ reg [1:0] vector_phase;
+ wire line_done;
// Output FIFO for packetized data
localparam VITA_HEADER = 0;
@@ -50,9 +52,14 @@ module vita_tx_deframer
localparam VITA_TICS = 5;
localparam VITA_TICS2 = 6;
localparam VITA_PAYLOAD = 7;
- localparam VITA_WAIT = 8;
+ localparam VITA_STORE = 8;
localparam VITA_TRAILER = 9;
+ 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?
+
always @(posedge clk)
if(reset | clear)
begin
@@ -61,20 +68,24 @@ module vita_tx_deframer
<= 0;
end
else
- if((vita_state == VITA_WAIT) & fifo_space)
- if(eof) // FIXME
+ if((vita_state == VITA_STORE) & fifo_space)
+ if(eop)
if(has_trailer_reg)
vita_state <= VITA_TRAILER;
else
vita_state <= VITA_HEADER;
else
- vita_state <= VITA_PAYLOAD;
+ begin
+ vita_state <= VITA_PAYLOAD;
+ pkt_len <= pkt_len - 1;
+ end
else if(src_rdy_i)
case(vita_state)
VITA_HEADER :
begin
{has_streamid_reg, has_classid_reg, has_secs_reg, has_tics_reg,
has_trailer_reg, is_sob_reg, is_eob_reg}
<= {has_streamid, has_classid, has_secs, has_tics,
has_trailer, is_sob, is_eob};
+ pkt_len <= data_i[15:0];
vector_phase <= 0;
if(has_streamid)
vita_state <= VITA_STREAMID;
@@ -118,13 +129,13 @@ module vita_tx_deframer
if(line_done)
begin
vector_phase <= 0;
- vita_state <= VITA_WAIT;
+ vita_state <= VITA_STORE;
end
else
vector_phase <= vector_phase + 1;
VITA_TRAILER :
vita_state <= VITA_HEADER;
- VITA_WAIT :
+ VITA_STORE :
;
default :
vita_state <= VITA_HEADER;
@@ -142,7 +153,7 @@ module vita_tx_deframer
send_time[63:32] <= data_i[31:0];
VITA_TICS2 :
send_time[31:0] <= data_i[31:0];
- VITA_WAIT, VITA_HEADER :
+ VITA_STORE, VITA_HEADER :
send_time[63:0] <= 64'd0;
endcase // case (vita_state)
@@ -155,14 +166,14 @@ module vita_tx_deframer
3: sample_d <= data_i[31:0];
endcase // case (vector_phase)
-
+ wire store = (vita_state == VITA_STORE);
fifo_short #(.WIDTH(4+64+32*MAXCHAN)) short_tx_q
(.clk(clk), .reset(reset), .clear(clear),
- .datain(fifo_i), .src_rdy_i(vita_state == VITA_IDLE),
.dst_rdy_o(fifo_space),
+ .datain(fifo_i), .src_rdy_i(store), .dst_rdy_o(fifo_space),
.dataout(sample_fifo_o), .src_rdy_o(sample_fifo_src_rdy_o),
.dst_rdy_i(sample_fifo_dst_rdy_i) );
// sob, eob, has_secs (send_at) ignored on all lines except first
- assign fifo_i =
{sample_d,sample_c,sample_b,sample_a,has_secs_reg,is_sob_reg,is_eob_reg,eof,send_time};
+ assign fifo_i =
{sample_d,sample_c,sample_b,sample_a,has_secs_reg,is_sob_reg,is_eob_reg,eop,send_time};
assign dst_rdy_o = (vita_state != VITA_PAYLOAD);
- [Commit-gnuradio] [gnuradio] 41/148: be a little more PC about it, (continued)
- [Commit-gnuradio] [gnuradio] 41/148: be a little more PC about it, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 32/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 27/148: new memory map for vita49. Apps won't compile, since symbol names are different, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 16/148: Put ethernet control transport into its own cc/h files. Ethernet control transport is in-charge of ethernet and transport headers, so that usrp2 impl knows nothing about ethernet stuff (as far as control goes)., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 24/148: vita rx instead of rx_control. Ready for firmware testing. Misses timing by a little bit, will worry later., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 33/148: got firmware compiling with vrt rx, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 34/148: forgot to declare wires, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 39/148: mostly just copied over from the rx side. Still needs a lot of work., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 40/148: Added missing flag to vrt header in txrx.c. Added parsing to vrt expanded header to copy out header entries. Modified usrp2 impl to use the correctly parsed header., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 35/148: got vrt rx somewhat working, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 52/148: seems to correctly deframe packets. now need to consume them.,
git <=
- [Commit-gnuradio] [gnuradio] 50/148: make the testbench work in this environment, without the crossclock settings bus, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 26/148: moved regs around for vita49, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 19/148: VITA49 rx (and tx skeleton) copied over from quad radio, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 43/148: minor tweak to transport loop and debug printf for vrt, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 44/148: Removed temporary u2_eth_packet_only_t. Removed the fixed header portion from the u2_eth_packet_t. Removed places in code where control uses the fixed header (always unused 0 for word, and -1 for timestamp). Flagged the fixed header stuff for removal (once we get vrt tx)., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 25/148: cleanup, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 42/148: Created a ring data structure held by the ring. It holds an sbuff and its parsed vrt data (header, payload, and len). The impl data handler parses the packets and enqueues them., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 48/148: Added interrupt call from transport::stop so the recv or callback will throw at interruption points. This fixes the issue where the app would hang in the stop method when exiting (we were hanging here: d_data_pending_cond.wait(l), but now wait throws() and we exit)., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 54/148: flag packets which arrive way too early so the device doesn't sit there forever., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 38/148: rx working with vrt header, git, 2016/08/14