forked from fpgasystems/fpga-network-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (77 loc) · 2.38 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Author: David Sidler ([email protected])
cmake_minimum_required(VERSION 3.0)
project(network-stack-example)
# Include custom Find<Module>.cmake scripts to enable searching for Vivado HLS
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
# Check if parent directory
get_directory_property(hasParent PARENT_DIRECTORY)
if (DEFINED ENV{IPREPO_DIR})
set(IPREPO_DIR $ENV{IPREPO_DIR})
elseif (NOT IPREPO_DIR)
set(IPREPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/iprepo)
message("set iprepor dir ${IPREPO_DIR}")
endif()
# set(DEVICE_NAME
if (NOT hasParent)
if (DEVICE_NAME STREQUAL "vc709")
set(FPGA_PART xc7vx690tffg1761-2)
set(FPGA_FAMILY 7series)
set(NETWORK_BANDWIDTH 10 CACHE STRING "Network bandwidth")
endif()
if (DEVICE_NAME STREQUAL "adm7v3")
set(FPGA_PART xc7vx690tffg1157-2)
set(FPGA_FAMILY 7series)
set(NETWORK_BANDWIDTH 10 CACHE STRING "Network bandwidth")
endif()
if (DEVICE_NAME STREQUAL "vcu118")
set(FPGA_PART xcvu9p-flga2104-2L-e)
set(FPGA_FAMILY ultraplus)
set(NETWORK_BANDWIDTH 100 CACHE STRING "Network bandwidth")
endif()
endif()
# set bandwidth
if (NETWORK_BANDWIDTH STREQUAL "10")
if (NOT DEFINED NETWORK_INTERFACE)
set(NETWORK_INTERFACE 10)
endif()
if (NOT DEFINED DATA_WIDTH)
set(DATA_WIDTH 8)
endif()
if (NOT DEFINED CLOCK_PERIOD)
set(CLOCK_PERIOD 6.4)
endif()
endif()
if (NETWORK_BANDWIDTH STREQUAL "100")
if (NOT DEFINED NETWORK_INTERFACE)
set(NETWORK_INTERFACE 100)
endif()
if (NOT DEFINED DATA_WIDTH)
set(DATA_WIDTH 64)
endif()
if (NOT DEFINED CLOCK_PERIOD)
set(CLOCK_PERIOD 3.2)
endif()
if (NOT DEFINED ${TCP_STACK_MSS})
set(TCP_STACK_MSS 4096)
endif()
if (NOT DEFINED ${TCP_STACK_WINDOW_SCALING_EN})
set(TCP_STACK_WINDOW_SCALING_EN 1)
endif()
endif()
#HLS IPs
add_subdirectory(hls/arp_server_subnet)
add_subdirectory(hls/dhcp_client)
add_subdirectory(hls/echo_server_application)
add_subdirectory(hls/icmp_server)
add_subdirectory(hls/iperf_client)
add_subdirectory(hls/iperf_udp)
add_subdirectory(hls/ip_handler)
add_subdirectory(hls/ipv4)
add_subdirectory(hls/mac_ip_encode)
add_subdirectory(hls/toe)
add_subdirectory(hls/udp)
add_subdirectory(hls/rocev2)
add_subdirectory(hls/hash_table)
if (NOT hasParent)
add_subdirectory(hls/ethernet_frame_padding)
endif()