Skip to content

Commit 68e6ef2

Browse files
author
Mario Ruiz
committed
Sorting out the IP generation inside a folder.
1 parent 5161606 commit 68e6ef2

13 files changed

+197
-147
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ fsm_encoding.os
55
synlog.tcl
66
*prj/
77
*.dir/
8-
*.pb
8+
*.pb
9+
synthesis_results/

LICENSE.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
BSD 3-Clause License
22

33
Copyright (c) 2019,
4-
54
Xilinx, Inc (xilinx.com) and
6-
75
HPCN Group, UAM Spain (hpcn-uam.es)
8-
96
Systems Group, ETH Zurich (systems.ethz.ch)
107

118
All rights reserved.

Makefile

Lines changed: 8 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,13 @@
1-
TOPDIR=$(shell pwd)
2-
TOESCR=$(TOPDIR)/hls/TOE
3-
IPERFSRC=$(TOPDIR)/hls/iperf2_tcp
4-
ECHOSRC=$(TOPDIR)/hls/echo_replay
5-
ARPSRC=$(TOPDIR)/hls/arp_server
6-
ETHSRC=$(TOPDIR)/hls/ethernet_inserter
7-
ICMPSRC=$(TOPDIR)/hls/icmp_server
8-
PKTSRC=$(TOPDIR)/hls/packet_handler
9-
USRSRC=$(TOPDIR)/hls/user_abstraction
10-
PORTSRC=$(TOPDIR)/hls/port_handler
11-
TCLDIR=$(TOPDIR)/scripts
121

132

14-
project = TOE_hls_prj IPERF2_TCP_hls_prj ECHOSERVER_hls_prj ARP_hls_prj \
15-
ETH_inserter_hls_prj ICMP_hls_prj PKT_HANDLER_prj userAbstraction_prj \
16-
portHandler_prj
3+
.PHONY:all
4+
all: create_folder
5+
make -C synthesis_results
176

18-
all: build
19-
7+
create_folder:
8+
mkdir -p synthesis_results
9+
cp Makefile.synthesis synthesis_results/Makefile
2010

21-
build: $(project)
22-
@echo -e "\e[94mIP Completed: $(project)\e[39m"
2311

24-
clean:
25-
rm -rf *.log *.jou file* *.bak vivado*.str synlog.tcl .Xil fsm_encoding.os
26-
27-
distclean: clean
28-
rm -rf $(project)
29-
30-
31-
TOE_hls_prj: $(shell find $(TOESCR) -type f) \
32-
$(TCLDIR)/toe_script.tcl
33-
rm -rf TOE_hls_prj
34-
vivado_hls -f $(TCLDIR)/toe_script.tcl -tclargs $(project)
35-
36-
IPERF2_TCP_hls_prj: $(shell find $(IPERFSRC) -type f) \
37-
$(TCLDIR)/iperf2_tcp_script.tcl
38-
rm -rf IPERF2_TCP_hls_prj
39-
vivado_hls -f $(TCLDIR)/iperf2_tcp_script.tcl -tclargs $(project)
40-
41-
ECHOSERVER_hls_prj: $(shell find $(ECHOSRC) -type f) \
42-
$(TCLDIR)/echo_server_script.tcl
43-
rm -rf ECHOSERVER_hls_prj
44-
vivado_hls -f $(TCLDIR)/echo_server_script.tcl -tclargs $(project)
45-
46-
ARP_hls_prj: $(shell find $(ARPSRC) -type f) \
47-
$(TCLDIR)/arp_script.tcl
48-
rm -rf ARP_hls_prj
49-
vivado_hls -f $(TCLDIR)/arp_script.tcl -tclargs $(project)
50-
51-
ETH_inserter_hls_prj: $(shell find $(ETHSRC) -type f) \
52-
$(TCLDIR)/ethernet_inserter_script.tcl
53-
rm -rf ETH_inserter_hls_prj
54-
vivado_hls -f $(TCLDIR)/ethernet_inserter_script.tcl -tclargs $(project)
55-
56-
ICMP_hls_prj: $(shell find $(ICMPSRC) -type f) \
57-
$(TCLDIR)/icmp_script.tcl
58-
rm -rf ICMP_hls_prj
59-
vivado_hls -f $(TCLDIR)/icmp_script.tcl -tclargs $(project)
60-
61-
PKT_HANDLER_prj: $(shell find $(PKTSRC) -type f) \
62-
$(TCLDIR)/packet_handler_script.tcl
63-
rm -rf PKT_HANDLER_prj
64-
vivado_hls -f $(TCLDIR)/packet_handler_script.tcl -tclargs $(project)
65-
66-
userAbstraction_prj: $(shell find $(USRSRC) -type f) \
67-
$(TCLDIR)/userAbstraction.tcl
68-
rm -rf userAbstraction_prj
69-
vivado_hls -f $(TCLDIR)/userAbstraction.tcl -tclargs $(project)
70-
71-
portHandler_prj: $(shell find $(PORTSRC) -type f) \
72-
$(TCLDIR)/portHandler.tcl
73-
rm -rf $@
74-
vivado_hls -f $(TCLDIR)/portHandler.tcl -tclargs $(project)
75-
76-
.PHONY: list help
77-
list:
78-
@(make -rpn | sed -n -e '/^$$/ { n ; /^[^ .#][^% ]*:/p ; }' | sort | egrep --color '^[^ ]*:' )
79-
80-
81-
help:
82-
@echo "The basic usage of this makefile is:"
83-
@echo -e " 1) Create the IPs"
84-
@echo -e " \e[94mmake $(project)\e[39m"
85-
@echo ""
86-
@echo "Remember that you can always review this help with"
87-
@echo -e " \e[94mmake help\e[39m"
12+
distclean:
13+
rm -rf synthesis_results

Makefile.synthesis

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
TOPDIR=$(shell pwd)/../
2+
TOESCR=$(TOPDIR)/hls/TOE
3+
IPERFSRC=$(TOPDIR)/hls/iperf2_tcp
4+
ECHOSRC=$(TOPDIR)/hls/echo_replay
5+
ARPSRC=$(TOPDIR)/hls/arp_server
6+
ETHSRC=$(TOPDIR)/hls/ethernet_inserter
7+
ICMPSRC=$(TOPDIR)/hls/icmp_server
8+
PKTSRC=$(TOPDIR)/hls/packet_handler
9+
USRSRC=$(TOPDIR)/hls/user_abstraction
10+
PORTSRC=$(TOPDIR)/hls/port_handler
11+
TCLDIR=$(TOPDIR)/scripts
12+
13+
14+
project = TOE_hls_prj IPERF2_TCP_hls_prj ECHOSERVER_hls_prj ARP_hls_prj \
15+
ETH_inserter_hls_prj ICMP_hls_prj PKT_HANDLER_prj userAbstraction_prj \
16+
portHandler_prj
17+
18+
19+
all: build
20+
21+
build: $(project)
22+
@echo -e "\e[94mIP Completed: $(project)\e[39m"
23+
24+
clean:
25+
rm -rf *.log *.jou file* *.bak vivado*.str synlog.tcl .Xil fsm_encoding.os
26+
27+
distclean: clean
28+
rm -rf $(project)
29+
30+
31+
TOE_hls_prj: $(shell find $(TOESCR) -type f) \
32+
$(TCLDIR)/toe_script.tcl
33+
rm -rf $@
34+
vivado_hls -f $(TCLDIR)/toe_script.tcl -tclargs $(TOPDIR) $@
35+
36+
IPERF2_TCP_hls_prj: $(shell find $(IPERFSRC) -type f) \
37+
$(TCLDIR)/iperf2_tcp_script.tcl
38+
rm -rf $@
39+
vivado_hls -f $(TCLDIR)/iperf2_tcp_script.tcl -tclargs $(TOPDIR) $@
40+
41+
ECHOSERVER_hls_prj: $(shell find $(ECHOSRC) -type f) $(TCLDIR)/echo_server_script.tcl
42+
rm -rf $@
43+
vivado_hls -f $(TCLDIR)/echo_server_script.tcl -tclargs $(TOPDIR) $@
44+
45+
ARP_hls_prj: $(shell find $(ARPSRC) -type f) $(TCLDIR)/arp_script.tcl
46+
rm -rf $@
47+
vivado_hls -f $(TCLDIR)/arp_script.tcl -tclargs $(TOPDIR) $@
48+
49+
ETH_inserter_hls_prj: $(shell find $(ETHSRC) -type f) $(TCLDIR)/ethernet_inserter_script.tcl
50+
rm -rf $@
51+
vivado_hls -f $(TCLDIR)/ethernet_inserter_script.tcl -tclargs $(TOPDIR) $@
52+
53+
ICMP_hls_prj: $(shell find $(ICMPSRC) -type f) $(TCLDIR)/icmp_script.tcl
54+
rm -rf $@
55+
vivado_hls -f $(TCLDIR)/icmp_script.tcl -tclargs $(TOPDIR) $@
56+
57+
PKT_HANDLER_prj: $(shell find $(PKTSRC) -type f) $(TCLDIR)/packet_handler_script.tcl
58+
rm -rf $@
59+
vivado_hls -f $(TCLDIR)/packet_handler_script.tcl -tclargs $(TOPDIR) $@
60+
61+
userAbstraction_prj: $(shell find $(USRSRC) -type f) $(TCLDIR)/userAbstraction.tcl
62+
rm -rf $@
63+
vivado_hls -f $(TCLDIR)/userAbstraction.tcl -tclargs $(TOPDIR) $@
64+
65+
portHandler_prj: $(shell find $(PORTSRC) -type f) $(TCLDIR)/portHandler.tcl
66+
rm -rf $@
67+
vivado_hls -f $(TCLDIR)/portHandler.tcl -tclargs $(TOPDIR) $@
68+
69+
.PHONY: list help
70+
list:
71+
@(make -rpn | sed -n -e '/^$$/ { n ; /^[^ .#][^% ]*:/p ; }' | sort | egrep --color '^[^ ]*:' )
72+
73+
74+
help:
75+
@echo "The basic usage of this makefile is:"
76+
@echo -e " 1) Create the IPs"
77+
@echo -e " \e[94mmake $(project)\e[39m"
78+
@echo ""
79+
@echo "Remember that you can always review this help with"
80+
@echo -e " \e[94mmake help\e[39m"

scripts/arp_script.tcl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
open_project ARP_hls_prj
1+
# Get the root folder
2+
set root_folder [lindex $argv 2]
3+
# Get project name from the arguments
4+
set proj_name [lindex $argv 3]
5+
# Create project
6+
open_project ${proj_name}
27

38
set_top arp_server
4-
add_files hls/arp_server/arp_server.cpp
9+
add_files ${root_folder}/hls/arp_server/arp_server.cpp
510

611
open_solution "ultrascale_plus"
712
set_part {xcvu9p-flga2104-2l-e} -tool vivado

scripts/echo_server_script.tcl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
open_project ECHOSERVER_hls_prj
1+
# Get the root folder
2+
set root_folder [lindex $argv 2]
3+
# Get project name from the arguments
4+
set proj_name [lindex $argv 3]
5+
# Create project
6+
open_project ${proj_name}
27

38
set_top echo_server_application
49

5-
add_files hls/echo_replay/echo_server_application.cpp
6-
add_files -tb hls/echo_replay/test_echo_server_application.cpp
10+
add_files ${root_folder}/hls/echo_replay/echo_server_application.cpp
11+
add_files -tb ${root_folder}/hls/echo_replay/test_echo_server_application.cpp
712

813
open_solution "ultrascale_plus"
914
set_part {xcvu9p-flga2104-2l-e} -tool vivado

scripts/ethernet_inserter_script.tcl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
open_project ETH_inserter_hls_prj
1+
# Get the root folder
2+
set root_folder [lindex $argv 2]
3+
# Get project name from the arguments
4+
set proj_name [lindex $argv 3]
5+
# Create project
6+
open_project ${proj_name}
27

38
set_top ethernet_header_inserter
49

5-
add_files hls/ethernet_inserter/ethernet_header_inserter.cpp
6-
add_files -tb hls/ethernet_inserter/ethernet_header_inserter_test.cpp
10+
add_files ${root_folder}/hls/ethernet_inserter/ethernet_header_inserter.cpp
11+
add_files -tb ${root_folder}/hls/ethernet_inserter/ethernet_header_inserter_test.cpp
712

813
open_solution "ultrascale_plus"
914
set_part {xcvu9p-flga2104-2l-e} -tool vivado

scripts/icmp_script.tcl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
open_project ICMP_hls_prj
1+
# Get the root folder
2+
set root_folder [lindex $argv 2]
3+
# Get project name from the arguments
4+
set proj_name [lindex $argv 3]
5+
# Create project
6+
open_project ${proj_name}
27

38
set_top icmp_server
49

5-
set root_dir [exec pwd]
6-
7-
add_files hls/icmp_server/icmp_server.cpp
8-
#add_files hls/TOE/common_utilities/common_utilities.cpp
9-
add_files -tb hls/icmp_server/test_icmp_server.cpp -cflags "-Ihls/TOE/testbench/."
10-
add_files -tb hls/TOE/testbench/pcap2stream.cpp -cflags "-Ihls/TOE/testbench/."
11-
add_files -tb hls/TOE/testbench/pcap.cpp -cflags "-Ihls/TOE/testbench/."
10+
add_files ${root_folder}/hls/icmp_server/icmp_server.cpp
11+
#add_files ${root_folder}/hls/TOE/common_utilities/common_utilities.cpp
12+
add_files -tb ${root_folder}/hls/icmp_server/test_icmp_server.cpp -cflags "-Ihls/TOE/testbench/."
13+
add_files -tb ${root_folder}/hls/TOE/testbench/pcap2stream.cpp -cflags "-Ihls/TOE/testbench/."
14+
add_files -tb ${root_folder}/hls/TOE/testbench/pcap.cpp -cflags "-Ihls/TOE/testbench/."
1215

1316
open_solution "ultrascale_plus"
1417
set_part {xcvu9p-flga2104-2l-e} -tool vivado
1518
create_clock -period 3.1 -name default
1619
set_clock_uncertainty 0.2
17-
#csim_design -argv "${root_dir}/hls/icmp_server/icmp.pcap ${root_dir}/hls/icmp_server/icmp_golden.pcap"
20+
#csim_design -argv "${root_folder}/hls/icmp_server/icmp.pcap ${root_dir}/hls/icmp_server/icmp_golden.pcap"
1821

1922
csynth_design
2023

scripts/iperf2_tcp_script.tcl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
open_project IPERF2_TCP_hls_prj
1+
# Get the root folder
2+
set root_folder [lindex $argv 2]
3+
# Get project name from the arguments
4+
set proj_name [lindex $argv 3]
5+
# Create project
6+
open_project ${proj_name}
7+
28

39
set_top iperf2_client
410

5-
add_files hls/iperf2_tcp/iperf_client.cpp
6-
add_files hls/TOE/common_utilities/common_utilities.cpp
11+
add_files ${root_folder}/hls/iperf2_tcp/iperf_client.cpp
12+
add_files ${root_folder}/hls/TOE/common_utilities/common_utilities.cpp
713

8-
add_files -tb hls/iperf2_tcp/test_iperf_client.cpp
14+
add_files -tb ${root_folder}/hls/iperf2_tcp/test_iperf_client.cpp
915

1016
open_solution "ultrascale_plus"
1117
set_part {xcvu9p-flga2104-2l-e} -tool vivado

scripts/packet_handler_script.tcl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
open_project PKT_HANDLER_prj
1+
# Get the root folder
2+
set root_folder [lindex $argv 2]
3+
# Get project name from the arguments
4+
set proj_name [lindex $argv 3]
5+
# Create project
6+
open_project ${proj_name}
27

38
set_top packet_handler
49

5-
add_files hls/packet_handler/packet_handler.cpp
6-
add_files -tb hls/packet_handler/test_packet_hanlder.cpp
10+
add_files ${root_folder}/hls/packet_handler/packet_handler.cpp
11+
add_files -tb ${root_folder}/hls/packet_handler/test_packet_hanlder.cpp
712

813
open_solution "ultrascale_plus"
914
set_part {xcvu9p-flga2104-2l-e} -tool vivado

0 commit comments

Comments
 (0)