From 775a1811d026da521c3be3a32cc5b181b3b0eb93 Mon Sep 17 00:00:00 2001
From: David Sidler <david.sidler@inf.ethz.ch>
Date: Wed, 11 Sep 2019 17:06:57 +0200
Subject: [PATCH] fixing ip header drop

---
 CMakeLists.txt                  | 1 -
 hls/toe/rx_engine/rx_engine.cpp | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 795d632..b7bfe02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,6 @@ if (NETWORK_BANDWIDTH STREQUAL "100")
       set(NETWORK_INTERFACE 100)
    endif()
    if (NOT DEFINED DATA_WIDTH)
-      message( "abc")
       set(DATA_WIDTH 64)
    endif()
    if (NOT DEFINED CLOCK_PERIOD)
diff --git a/hls/toe/rx_engine/rx_engine.cpp b/hls/toe/rx_engine/rx_engine.cpp
index d44aab8..7e54d9c 100755
--- a/hls/toe/rx_engine/rx_engine.cpp
+++ b/hls/toe/rx_engine/rx_engine.cpp
@@ -102,7 +102,8 @@ void drop_optional_ip_header(	stream<ap_uint<4> >&	process2dropLengthFifo,
 			process2dropLengthFifo.read(length);
 			std::cout << "(Optional) Header length: " << length << std::endl;
 
-			if (WIDTH == 64)
+			//TODO for WIDTH == 128 this only works if no IP options
+			if (WIDTH == 64 || WIDTH == 128)
 			{
 				if (length > 1)
 				{
@@ -114,9 +115,9 @@ void drop_optional_ip_header(	stream<ap_uint<4> >&	process2dropLengthFifo,
 					doh_state = SHIFT;
 				}
 			}
-			if (WIDTH == 512)
+			if (WIDTH == 256 || WIDTH == 512)
 			{
-				//TODO this is hack and works for AXI_WIDTH ==  512bit
+				//TODO this is a hack and only works if there are no IP options
 				if (length == 5)
 				{
 					process2dropFifo.read(prevWord);
-- 
GitLab