Skip to content

Commit 04650e4

Browse files
committed
Upating all examples with perl script solution
1 parent e2dfc1e commit 04650e4

File tree

161 files changed

+1244
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1244
-183
lines changed

common/utility/makefile_gen/makegen.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ def mk_run(target, data):
472472
target.write(arg)
473473
if not ("platform_type" in data and data["platform_type"] == "pcie"):
474474
target.write("\nelse\n")
475-
target.write("\t$(ABS_COMMON_REPO)/common/utility/run_emulation.pl \"${LAUNCH_EMULATOR} | tee run_app.log\" \"${RUN_APP_SCRIPT} $(TARGET)\" \"${RESULT_STRING}\" \"7\"")
475+
target.write("\t$(LAUNCH_EMULATOR_CMD)")
476476
if "containers" in data:
477477
target.write("\n")
478478
else:
@@ -537,7 +537,7 @@ def mk_run(target, data):
537537
target.write(arg)
538538
if not ("platform_type" in data and data["platform_type"] == "pcie"):
539539
target.write("\nelse\n")
540-
target.write("\t$(ABS_COMMON_REPO)/common/utility/run_emulation.pl \"${LAUNCH_EMULATOR} | tee embedded_run.log\" \"${RUN_APP_SCRIPT} $(TARGET)\" \"${RESULT_STRING}\" \"7\"")
540+
target.write("\t$(LAUNCH_EMULATOR_CMD)")
541541
if "containers" in data:
542542
target.write("\n")
543543
else:
@@ -694,6 +694,19 @@ def report_gen(target, data):
694694

695695
target.write("DEBUG := no\n")
696696
target.write("B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)`\n")
697+
target.write("PERL := \n")
698+
target.write("QEMU_IMODE := no\n")
699+
target.write("LAUNCH_EMULATOR_CMD := \n")
700+
target.write("\n")
701+
target.write("ifneq ($(PERL), /tools/xgs/perl/5.8.5/bin/perl)\n")
702+
target.write("\tQEMU_IMODE = yes\n")
703+
target.write("endif\n")
704+
target.write("\n")
705+
target.write("ifeq ($(QEMU_IMODE), yes)\n")
706+
target.write("\tLAUNCH_EMULATOR_CMD = $(LAUNCH_EMULATOR)\n")
707+
target.write("else\n")
708+
target.write("\tLAUNCH_EMULATOR_CMD = $(PERL) $(ABS_COMMON_REPO)/common/utility/run_emulation.pl \"${LAUNCH_EMULATOR} | tee run_app.log\" \"${RUN_APP_SCRIPT} $(TARGET)\" \"${RESULT_STRING}\" \"7\"\n")
709+
target.write("endif\n")
697710
target.write("\n")
698711
target.write("#Generates debug summary report\n")
699712
target.write("ifeq ($(DEBUG), yes)\n")

common/utility/run_emulation.pl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/tools/xgs/perl/5.8.5/bin/perl
2-
31
use strict;
42
use warnings;
53
use Expect;

cpp_kernels/array_partition/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ ifeq ($(HOST_ARCH), x86)
141141
$(CP) $(EMCONFIG_DIR)/emconfig.json .
142142
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) $(BUILD_DIR)/matmul.xclbin
143143
else
144-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
144+
$(LAUNCH_EMULATOR_CMD)
145145
endif
146146
else
147147
ifeq ($(HOST_ARCH), x86)
@@ -156,7 +156,7 @@ ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
156156
ifeq ($(HOST_ARCH), x86)
157157
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) $(BUILD_DIR)/matmul.xclbin
158158
else
159-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee embedded_run.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
159+
$(LAUNCH_EMULATOR_CMD)
160160
endif
161161
else
162162
ifeq ($(HOST_ARCH), x86)
Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +0,0 @@
1-
Array Partition (HLS C/C++ Kernel)
2-
==================================
3-
4-
This is a simple example of matrix multiplication (Row x Col) to demonstrate how to achieve better performance by array partitioning, using HLS kernel in Vitis Environment.
5-
6-
**KEY CONCEPTS:** Kernel Optimization, HLS C Kernel, Array Partition
7-
8-
**KEYWORDS:** #pragma HLS ARRAY_PARTITION, complete
9-
10-
DESIGN FILES
11-
------------
12-
13-
Application code is located in the src directory. Accelerator binary files will be compiled to the xclbin directory. The xclbin directory is required by the Makefile and its contents will be filled during compilation. A listing of all the files in this example is shown below
14-
15-
::
16-
17-
src/host.cpp
18-
src/matmul.cpp
19-
src/matmul_partition.cpp
20-
21-
COMMAND LINE ARGUMENTS
22-
----------------------
23-
24-
Once the environment has been configured, the application can be executed by
25-
26-
::
27-
28-
./array_partition <matmul XCLBIN>
29-

cpp_kernels/array_partition/utils.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55

66
DEBUG := no
77
B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)`
8+
PERL :=
9+
QEMU_IMODE := no
10+
LAUNCH_EMULATOR_CMD :=
11+
12+
ifneq ($(PERL), /tools/xgs/perl/5.8.5/bin/perl)
13+
QEMU_IMODE = yes
14+
endif
15+
16+
ifeq ($(QEMU_IMODE), yes)
17+
LAUNCH_EMULATOR_CMD = $(LAUNCH_EMULATOR)
18+
else
19+
LAUNCH_EMULATOR_CMD = $(PERL) $(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
20+
endif
821

922
#Generates debug summary report
1023
ifeq ($(DEBUG), yes)

cpp_kernels/bind_op_storage/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ ifeq ($(HOST_ARCH), x86)
144144
$(CP) $(EMCONFIG_DIR)/emconfig.json .
145145
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) $(BUILD_DIR)/vadd.xclbin
146146
else
147-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
147+
$(LAUNCH_EMULATOR_CMD)
148148
endif
149149
else
150150
ifeq ($(HOST_ARCH), x86)
@@ -159,7 +159,7 @@ ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
159159
ifeq ($(HOST_ARCH), x86)
160160
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) $(BUILD_DIR)/vadd.xclbin
161161
else
162-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee embedded_run.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
162+
$(LAUNCH_EMULATOR_CMD)
163163
endif
164164
else
165165
ifeq ($(HOST_ARCH), x86)

cpp_kernels/bind_op_storage/utils.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ endif
1212

1313
DEBUG := no
1414
B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)`
15+
PERL :=
16+
QEMU_IMODE := no
17+
LAUNCH_EMULATOR_CMD :=
18+
19+
ifneq ($(PERL), /tools/xgs/perl/5.8.5/bin/perl)
20+
QEMU_IMODE = yes
21+
endif
22+
23+
ifeq ($(QEMU_IMODE), yes)
24+
LAUNCH_EMULATOR_CMD = $(LAUNCH_EMULATOR)
25+
else
26+
LAUNCH_EMULATOR_CMD = $(PERL) $(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
27+
endif
1528

1629
#Generates debug summary report
1730
ifeq ($(DEBUG), yes)

cpp_kernels/burst_rw/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ ifeq ($(HOST_ARCH), x86)
138138
$(CP) $(EMCONFIG_DIR)/emconfig.json .
139139
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) $(BUILD_DIR)/vadd.xclbin
140140
else
141-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
141+
$(LAUNCH_EMULATOR_CMD)
142142
endif
143143
else
144144
ifeq ($(HOST_ARCH), x86)
@@ -153,7 +153,7 @@ ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
153153
ifeq ($(HOST_ARCH), x86)
154154
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) $(BUILD_DIR)/vadd.xclbin
155155
else
156-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee embedded_run.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
156+
$(LAUNCH_EMULATOR_CMD)
157157
endif
158158
else
159159
ifeq ($(HOST_ARCH), x86)

cpp_kernels/burst_rw/utils.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ endif
1212

1313
DEBUG := no
1414
B_TEMP = `$(ABS_COMMON_REPO)/common/utility/parse_platform_list.py $(DEVICE)`
15+
PERL :=
16+
QEMU_IMODE := no
17+
LAUNCH_EMULATOR_CMD :=
18+
19+
ifneq ($(PERL), /tools/xgs/perl/5.8.5/bin/perl)
20+
QEMU_IMODE = yes
21+
endif
22+
23+
ifeq ($(QEMU_IMODE), yes)
24+
LAUNCH_EMULATOR_CMD = $(LAUNCH_EMULATOR)
25+
else
26+
LAUNCH_EMULATOR_CMD = $(PERL) $(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
27+
endif
1528

1629
#Generates debug summary report
1730
ifeq ($(DEBUG), yes)

cpp_kernels/critical_path/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ ifeq ($(HOST_ARCH), x86)
142142
$(CP) $(EMCONFIG_DIR)/emconfig.json .
143143
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) -x $(BUILD_DIR)/apply_watermark_GOOD.xclbin -i ./data/input.bmp -c ./data/golden.bmp
144144
else
145-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee run_app.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
145+
$(LAUNCH_EMULATOR_CMD)
146146
endif
147147
else
148148
ifeq ($(HOST_ARCH), x86)
@@ -157,7 +157,7 @@ ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
157157
ifeq ($(HOST_ARCH), x86)
158158
XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE) -x $(BUILD_DIR)/apply_watermark_GOOD.xclbin -i ./data/input.bmp -c ./data/golden.bmp
159159
else
160-
$(ABS_COMMON_REPO)/common/utility/run_emulation.pl "${LAUNCH_EMULATOR} | tee embedded_run.log" "${RUN_APP_SCRIPT} $(TARGET)" "${RESULT_STRING}" "7"
160+
$(LAUNCH_EMULATOR_CMD)
161161
endif
162162
else
163163
ifeq ($(HOST_ARCH), x86)

0 commit comments

Comments
 (0)