summaryrefslogtreecommitdiffstats
path: root/usrp2/udp/fifo19_rxrealign.v
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-05-27 17:31:46 -0700
committerMatt Ettus <matt@ettus.com>2010-05-27 17:31:46 -0700
commit3d06fb26c5a59451b26680b6096fca7ee37e8018 (patch)
treece172a14304474b2a46854bea6b47c2ed1f8380b /usrp2/udp/fifo19_rxrealign.v
parent621ad7cc9e68b4e304b616d8f840d3a03a047c8b (diff)
parentb38d2424b1ac3242146fc9305d9e4ae80e21dede (diff)
downloaduhd-3d06fb26c5a59451b26680b6096fca7ee37e8018.tar.gz
uhd-3d06fb26c5a59451b26680b6096fca7ee37e8018.tar.bz2
uhd-3d06fb26c5a59451b26680b6096fca7ee37e8018.zip
Merge branch 'udp' into master_merge_take2
* udp: (67 commits) better test program for just the tx side fix typo, no functionality difference ignores move dsp settings regs to reclocked setting bus. Works, gets us to within 18ps of passing timing reverting logic clean up which should have made timing better, but made it worse instead moved fifos around, now easier to see where they are and how big bigger fifo on UDP TX path, to possibly fix overruns on decim=4 Xilinx ISE is incorrectly parsing the verilog case statement, this is a workaround pps and vita time debug pins ignore emacs backup files more debug for fixing E's better debug pins for going after cascading E's copy in wrong place copied over from quad radio just debug pin changes typo caused the tx udp chain to be disconnected moved into subdir speed up timing by ignoring the too_early error. We'll need to FIXME this later Added set time and set time at next pps. Removed the old sync pps commands, they dont make sense to use anymore. moved around regs, added a bit to allow for alternate PPS source ...
Diffstat (limited to 'usrp2/udp/fifo19_rxrealign.v')
-rw-r--r--usrp2/udp/fifo19_rxrealign.v42
1 files changed, 42 insertions, 0 deletions
diff --git a/usrp2/udp/fifo19_rxrealign.v b/usrp2/udp/fifo19_rxrealign.v
new file mode 100644
index 000000000..35ad90951
--- /dev/null
+++ b/usrp2/udp/fifo19_rxrealign.v
@@ -0,0 +1,42 @@
+
+
+// Adds a junk line at the beginning of every packet, which the
+// following stages should ignore. This gives us proper alignment due
+// to the 14 byte ethernet header
+
+// Bit 18 -- odd length
+// Bit 17 -- eof
+// Bit 16 -- sof
+// Bit 15:0 -- data
+
+module fifo19_rxrealign
+ (input clk, input reset, input clear,
+ input [18:0] datain, input src_rdy_i, output dst_rdy_o,
+ output [18:0] dataout, output src_rdy_o, input dst_rdy_i);
+
+ reg rxre_state;
+ localparam RXRE_DUMMY = 0;
+ localparam RXRE_PKT = 1;
+
+ assign dataout[18] = datain[18];
+ assign dataout[17] = datain[17];
+ assign dataout[16] = (rxre_state==RXRE_DUMMY) | (datain[17] & datain[16]); // allows for passing error signal
+ assign dataout[15:0] = datain[15:0];
+
+ always @(posedge clk)
+ if(reset | clear)
+ rxre_state <= RXRE_DUMMY;
+ else if(src_rdy_i & dst_rdy_i)
+ case(rxre_state)
+ RXRE_DUMMY :
+ rxre_state <= RXRE_PKT;
+ RXRE_PKT :
+ if(datain[17]) // if eof or error
+ rxre_state <= RXRE_DUMMY;
+ endcase // case (rxre_state)
+
+ assign src_rdy_o = src_rdy_i & dst_rdy_i; // Send anytime both sides are ready
+ assign dst_rdy_o = src_rdy_i & dst_rdy_i & (rxre_state == RXRE_PKT); // Only consume after the dummy
+
+endmodule // fifo19_rxrealign
+