-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
104 lines (73 loc) · 4.03 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Author: Huang hongjing (21515069@zju.edu.cn)
cmake_minimum_required(VERSION 3.0)
project(example_module)
# 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(NETWORK_BANDWIDTH 100)
set(NETWORK_INTERFACE 100)
set(CLOCK_PERIOD 3.2)
set(DATA_WIDTH 64)
#HLS IPs
add_subdirectory(hls/mem_write_cmd_page_boundary_check_512)
add_subdirectory(hls/tlb)
add_subdirectory(hls/ethernet_frame_padding_512)
add_subdirectory(hls/arp_server_subnet)
add_subdirectory(hls/hash_table)
add_subdirectory(hls/icmp_server)
add_subdirectory(hls/ip_handler)
add_subdirectory(hls/mac_ip_encode)
add_subdirectory(hls/toe)
###VIVADO project
# Find Xilinx Vivado
find_package(Vivado REQUIRED)
if (NOT VIVADO_FOUND)
message(FATAL_ERROR "Vivado not found.")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_common_ip.tcl.in ${CMAKE_BINARY_DIR}/create_xdma_common_ip.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_ip.tcl.in ${CMAKE_BINARY_DIR}/create_xdma_ip.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_bypass_ip.tcl.in ${CMAKE_BINARY_DIR}/create_xdma_bypass_ip.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_project.tcl.in ${CMAKE_BINARY_DIR}/create_project.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_pcie_benchmark.tcl.in ${CMAKE_BINARY_DIR}/pcie_benchmark.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_tcp_benchmark.tcl.in ${CMAKE_BINARY_DIR}/tcp_benchmark.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_tcp_latency.tcl.in ${CMAKE_BINARY_DIR}/tcp_latency.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_allreduce.tcl.in ${CMAKE_BINARY_DIR}/allreduce.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_hyperloglog.tcl.in ${CMAKE_BINARY_DIR}/hyperloglog.tcl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_tcpip_100g_common_ip.tcl.in ${CMAKE_BINARY_DIR}/create_tcpip_100g_common_ip.tcl)
set (PROJECT_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/rtl/example_module.vh
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_project.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_pcie_benchmark.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_tcp_benchmark.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_tcp_latency.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_allreduce.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_project_hyperloglog.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_common_ip.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_ip.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_xdma_bypass_ip.tcl.in
${CMAKE_CURRENT_SOURCE_DIR}/scripts/create_tcpip_100g_common_ip.tcl.in)
add_custom_target(direct
COMMAND ${VIVADO_BINARY} -mode batch -source ${CMAKE_BINARY_DIR}/create_project.tcl
DEPENDS ${PROJECT_DEPENDS})
add_custom_target(pcie_benchmark
COMMAND ${VIVADO_BINARY} -mode batch -source ${CMAKE_BINARY_DIR}/pcie_benchmark.tcl
DEPENDS ${PROJECT_DEPENDS})
add_custom_target(tcp_benchmark
COMMAND ${VIVADO_BINARY} -mode batch -source ${CMAKE_BINARY_DIR}/tcp_benchmark.tcl
DEPENDS ${PROJECT_DEPENDS})
add_custom_target(tcp_latency
COMMAND ${VIVADO_BINARY} -mode batch -source ${CMAKE_BINARY_DIR}/tcp_latency.tcl
DEPENDS ${PROJECT_DEPENDS})
add_custom_target(allreduce
COMMAND ${VIVADO_BINARY} -mode batch -source ${CMAKE_BINARY_DIR}/allreduce.tcl
DEPENDS ${PROJECT_DEPENDS})
add_custom_target(hyperloglog
COMMAND ${VIVADO_BINARY} -mode batch -source ${CMAKE_BINARY_DIR}/hyperloglog.tcl
DEPENDS ${PROJECT_DEPENDS})