summaryrefslogtreecommitdiffstats
path: root/usrp2/udp
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2011-03-14 17:51:46 -0700
committerMatt Ettus <matt@ettus.com>2011-03-16 12:26:38 -0700
commit61e351ac3db6afa061a828f4df3e6cb1a37d0380 (patch)
treec3fd9e89daee3ab046ad80f2074d2cc2e80afed4 /usrp2/udp
parentbea538ba3128d5bb4c728cda6e10534209e139d7 (diff)
downloaduhd-61e351ac3db6afa061a828f4df3e6cb1a37d0380.tar.gz
uhd-61e351ac3db6afa061a828f4df3e6cb1a37d0380.tar.bz2
uhd-61e351ac3db6afa061a828f4df3e6cb1a37d0380.zip
udp: speed up checksum calculation to meet timing
Diffstat (limited to 'usrp2/udp')
-rw-r--r--usrp2/udp/prot_eng_tx.v6
1 files changed, 4 insertions, 2 deletions
diff --git a/usrp2/udp/prot_eng_tx.v b/usrp2/udp/prot_eng_tx.v
index 322c6ec91..3adaaa32b 100644
--- a/usrp2/udp/prot_eng_tx.v
+++ b/usrp2/udp/prot_eng_tx.v
@@ -71,7 +71,9 @@ module prot_eng_tx
wire [15:0] ip_checksum;
add_onescomp #(.WIDTH(16)) add_onescomp
(.A(header_word[15:0]),.B(ip_length),.SUM(ip_checksum));
-
+ reg [15:0] ip_checksum_reg;
+ always @(posedge clk) ip_checksum_reg <= ip_checksum;
+
always @*
case(state)
1 : prot_data <= header_word; // ETH, top half ignored
@@ -80,7 +82,7 @@ module prot_eng_tx
4 : prot_data <= header_word; // ETH
5 : prot_data <= { header_word[31:16], ip_length }; // IP
6 : prot_data <= header_word; // IP
- 7 : prot_data <= { header_word[31:16], (16'hFFFF ^ ip_checksum) }; // IP
+ 7 : prot_data <= { header_word[31:16], (16'hFFFF ^ ip_checksum_reg) }; // IP
8 : prot_data <= header_word; // IP
9 : prot_data <= header_word; // IP
10: prot_data <= header_word; // UDP