@@ -42,8 +42,9 @@ def create_params(target,data):
4242 target .write ("\n " )
4343
4444 target .write ("VPP := v++\n " )
45- target .write ("SDCARD := " )
46- target .write ("sd_card\n " )
45+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
46+ target .write ("SDCARD := " )
47+ target .write ("sd_card\n " )
4748 target .write ("\n " )
4849 target .write ("include $(ABS_COMMON_REPO)/common/includes/opencl/opencl.mk\n " )
4950 if "config_make" in data :
@@ -191,7 +192,8 @@ def add_kernel_flags(target, data):
191192 target .write ("\n " )
192193
193194 target .write ("EMCONFIG_DIR = $(TEMP_DIR)\n " )
194- target .write ("EMU_DIR = $(SDCARD)/data/emulation\n " )
195+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
196+ target .write ("EMU_DIR = $(SDCARD)/data/emulation\n " )
195197 target .write ("\n " )
196198
197199 if "v++" in data :
@@ -335,8 +337,8 @@ def building_kernel_rtl(target, data):
335337def building_host (target , data ):
336338 target .write ("############################## Setting Rules for Host (Building Host Executable) ##############################\n " )
337339
338- target .write ("$(EXECUTABLE): check-xrt $(HOST_SRCS) $(HOST_HDRS) \n " )
339- target .write ("\t $(CXX) $(CXXFLAGS) $(HOST_SRCS) $(HOST_HDRS) -o '$@' $(LDFLAGS)\n " )
340+ target .write ("$(EXECUTABLE): $(HOST_SRCS) | check-xrt \n " )
341+ target .write ("\t $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)\n " )
340342 target .write ("\n " )
341343 target .write ("emconfig:$(EMCONFIG_DIR)/emconfig.json\n " )
342344 target .write ("$(EMCONFIG_DIR)/emconfig.json:\n " )
@@ -364,7 +366,10 @@ def mk_clean(target, data):
364366 target .write ("\n " )
365367
366368 target .write ("cleanall: clean\n " )
367- target .write ("\t -$(RMDIR) build_dir* sd_card*\n " )
369+ target .write ("\t -$(RMDIR) build_dir*" )
370+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
371+ target .write (" sd_card*" )
372+ target .write ("\n " )
368373 target .write ("\t -$(RMDIR) package.*\n " )
369374 target .write ("\t -$(RMDIR) _x* *xclbin.run_summary qemu-memory-_* emulation _vimage pl* start_simulation.sh *.xclbin\n " )
370375 if "output_files" in data :
@@ -392,8 +397,10 @@ def mk_build_all(target, data):
392397 target .write ("\n " )
393398
394399 target .write (".PHONY: all clean cleanall docs emconfig\n " )
395- target .write ("all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig sd_card\n " )
396- target .write ("\n " )
400+ target .write ("all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig" )
401+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
402+ target .write (" sd_card" )
403+ target .write ("\n \n " )
397404
398405 target .write (".PHONY: host\n " )
399406 target .write ("host: $(EXECUTABLE)\n " )
@@ -450,7 +457,8 @@ def mk_run(target, data):
450457 target .write ("endif\n " )
451458 target .write ("\n " )
452459 target .write ("ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))\n " )
453- target .write ("ifeq ($(HOST_ARCH), x86)\n " )
460+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
461+ target .write ("ifeq ($(HOST_ARCH), x86)\n " )
454462 target .write ("\t $(CP) $(EMCONFIG_DIR)/emconfig.json .\n " )
455463 target .write ("\t XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE)" )
456464
@@ -462,15 +470,18 @@ def mk_run(target, data):
462470 arg = arg .replace ('BUILD' , '$(BUILD_DIR)' )
463471 arg = arg .replace ('PROJECT' , '.' )
464472 target .write (arg )
465- target .write ("\n else\n " )
466- target .write ("\t $(ABS_COMMON_REPO)/common/utility/run_emulation.pl \" ${LAUNCH_EMULATOR} | tee run_app.log\" \" ${RUN_APP_SCRIPT} $(TARGET)\" \" ${RESULT_STRING}\" \" 7\" " )
473+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
474+ target .write ("\n else\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\" " )
467476 if "containers" in data :
468477 target .write ("\n " )
469478 else :
470479 target .write (" -ps-only\n " )
471- target .write ("endif\n " )
480+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
481+ target .write ("endif\n " )
472482 target .write ("else\n " )
473- target .write ("ifeq ($(HOST_ARCH), x86)\n " )
483+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
484+ target .write ("ifeq ($(HOST_ARCH), x86)\n " )
474485 target .write ("\t $(EXECUTABLE)" )
475486
476487 if "launch" in data :
@@ -490,8 +501,9 @@ def mk_run(target, data):
490501 args = args .replace ("REPO_DIR" ,"$(ABS_COMMON_REPO)" )
491502 args = args .replace ('HOST_EXE' , '$(EXE_FILE)' )
492503 target .write ("\t " + args )
504+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
505+ target .write ("\n endif" )
493506 target .write ("\n endif\n " )
494- target .write ("endif\n " )
495507 if "targets" in data :
496508 target .write ("ifneq ($(TARGET),$(findstring $(TARGET)," )
497509 args = data ["targets" ]
@@ -511,7 +523,8 @@ def mk_run(target, data):
511523 target .write (".PHONY: test\n " )
512524 target .write ("test: $(EXECUTABLE)\n " )
513525 target .write ("ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))\n " )
514- target .write ("ifeq ($(HOST_ARCH), x86)\n " )
526+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
527+ target .write ("ifeq ($(HOST_ARCH), x86)\n " )
515528 target .write ("\t XCL_EMULATION_MODE=$(TARGET) $(EXECUTABLE)" )
516529
517530 if "launch" in data :
@@ -522,15 +535,18 @@ def mk_run(target, data):
522535 arg = arg .replace ('BUILD' , '$(BUILD_DIR)' )
523536 arg = arg .replace ('PROJECT' , '.' )
524537 target .write (arg )
525- target .write ("\n else\n " )
526- target .write ("\t $(ABS_COMMON_REPO)/common/utility/run_emulation.pl \" ${LAUNCH_EMULATOR} | tee embedded_run.log\" \" ${RUN_APP_SCRIPT} $(TARGET)\" \" ${RESULT_STRING}\" \" 7\" " )
538+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
539+ target .write ("\n else\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\" " )
527541 if "containers" in data :
528542 target .write ("\n " )
529543 else :
530544 target .write (" -ps-only\n " )
531- target .write ("endif\n " )
545+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
546+ target .write ("endif\n " )
532547 target .write ("else\n " )
533- target .write ("ifeq ($(HOST_ARCH), x86)\n " )
548+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
549+ target .write ("ifeq ($(HOST_ARCH), x86)\n " )
534550 target .write ("\t $(EXECUTABLE)" )
535551
536552 if "launch" in data :
@@ -550,10 +566,11 @@ def mk_run(target, data):
550566 args = args .replace ("REPO_DIR" ,"$(ABS_COMMON_REPO)" )
551567 args = args .replace ('HOST_EXE' , '$(EXE_FILE)' )
552568 target .write ("\t " + args )
553- target .write ("\n else\n " )
554- target .write ("\t $(ECHO) \" Please copy the content of sd_card folder and data to an SD Card and run on the board\" " )
569+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
570+ target .write ("\n else\n " )
571+ target .write ("\t $(ECHO) \" Please copy the content of sd_card folder and data to an SD Card and run on the board\" " )
572+ target .write ("\n endif" )
555573 target .write ("\n endif\n " )
556- target .write ("endif\n " )
557574 if "targets" in data :
558575 target .write ("ifneq ($(TARGET),$(findstring $(TARGET)," )
559576 args = data ["targets" ]
@@ -632,11 +649,11 @@ def mk_help(target):
632649 target .write ("\t $(ECHO) \" Command to run the application. This is same as 'run' target but does not have any makefile dependency.\" \n " )
633650 target .write ("\t $(ECHO) \" \" \n " )
634651
635-
636- target .write ("\t $(ECHO) \" make sd_card TARGET=<sw_emu/hw_emu/hw> DEVICE=<FPGA platform> HOST_ARCH=<aarch32/aarch64/x86> EDGE_COMMON_SW=<rootfs and kernel image path>\" \n " );
637- target .write ("\t $(ECHO) \" Command to prepare sd_card files.\" \n " )
638- target .write ("\t $(ECHO) \" By default, HOST_ARCH=x86. HOST_ARCH and EDGE_COMMON_SW is required for SoC shells\" \n " )
639- target .write ("\t $(ECHO) \" \" \n " )
652+ if not ( "platform_type" in data and data [ "platform_type" ] == "pcie" ):
653+ target .write ("\t $(ECHO) \" make sd_card TARGET=<sw_emu/hw_emu/hw> DEVICE=<FPGA platform> HOST_ARCH=<aarch32/aarch64/x86> EDGE_COMMON_SW=<rootfs and kernel image path>\" \n " );
654+ target .write ("\t $(ECHO) \" Command to prepare sd_card files.\" \n " )
655+ target .write ("\t $(ECHO) \" By default, HOST_ARCH=x86. HOST_ARCH and EDGE_COMMON_SW is required for SoC shells\" \n " )
656+ target .write ("\t $(ECHO) \" \" \n " )
640657 target .write ("\t $(ECHO) \" make run TARGET=<sw_emu/hw_emu/hw> DEVICE=<FPGA platform> HOST_ARCH=<aarch32/aarch64/x86> EDGE_COMMON_SW=<rootfs and kernel image path>\" \n " );
641658 target .write ("\t $(ECHO) \" Command to run application in emulation.\" \n " )
642659 target .write ("\t $(ECHO) \" By default, HOST_ARCH=x86. HOST_ARCH and EDGE_COMMON_SW is required for SoC shells\" \n " )
@@ -749,30 +766,31 @@ def util_checks(target):
749766 target .write ("endif\n " )
750767 target .write ("endif\n \n " )
751768
752- target .write ("gen_run_app:\n " )
753- target .write ("ifneq ($(HOST_ARCH), x86)\n " )
754- target .write ("\t rm -rf run_app.sh\n " )
755- target .write ("\t $(ECHO) 'export LD_LIBRARY_PATH=/mnt:/tmp:$(LD_LIBRARY_PATH)' >> run_app.sh\n " )
756- target .write ("\t $(ECHO) 'export XILINX_XRT=/usr' >> run_app.sh\n " )
757- target .write ("ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))\n " )
758- target .write ("\t $(ECHO) 'export XILINX_VITIS=/mnt' >> run_app.sh\n " )
759- target .write ("\t $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> run_app.sh\n " )
760- target .write ("endif\n " )
761- target .write ("\t $(ECHO) '$(EXECUTABLE)" )
762- if "launch" in data :
763- if "cmd_args" in data ["launch" ][0 ]:
764- args = data ["launch" ][0 ]["cmd_args" ].split (" " )
765- for arg in args :
766- arg_name = arg .split ("/" )
767- target .write (" " )
768- target .write (arg_name [- 1 ])
769- target .write ("' >> run_app.sh\n " )
770- target .write ("\t $(ECHO) 'return_code=$$?' >> run_app.sh\n " )
771- target .write ("\t $(ECHO) 'if [ $$return_code -ne 0 ]; then' >> run_app.sh\n " )
772- target .write ("\t $(ECHO) 'echo \" ERROR: host run failed, RC=$$return_code\" ' >> run_app.sh\n " )
773- target .write ("\t $(ECHO) 'fi' >> run_app.sh\n " )
774- target .write ("\t $(ECHO) 'echo \" INFO: host run completed.\" ' >> run_app.sh\n " )
775- target .write ("endif\n " )
769+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
770+ target .write ("gen_run_app:\n " )
771+ target .write ("ifneq ($(HOST_ARCH), x86)\n " )
772+ target .write ("\t rm -rf run_app.sh\n " )
773+ target .write ("\t $(ECHO) 'export LD_LIBRARY_PATH=/mnt:/tmp:$(LD_LIBRARY_PATH)' >> run_app.sh\n " )
774+ target .write ("\t $(ECHO) 'export XILINX_XRT=/usr' >> run_app.sh\n " )
775+ target .write ("ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))\n " )
776+ target .write ("\t $(ECHO) 'export XILINX_VITIS=/mnt' >> run_app.sh\n " )
777+ target .write ("\t $(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> run_app.sh\n " )
778+ target .write ("endif\n " )
779+ target .write ("\t $(ECHO) '$(EXECUTABLE)" )
780+ if "launch" in data :
781+ if "cmd_args" in data ["launch" ][0 ]:
782+ args = data ["launch" ][0 ]["cmd_args" ].split (" " )
783+ for arg in args :
784+ arg_name = arg .split ("/" )
785+ target .write (" " )
786+ target .write (arg_name [- 1 ])
787+ target .write ("' >> run_app.sh\n " )
788+ target .write ("\t $(ECHO) 'return_code=$$?' >> run_app.sh\n " )
789+ target .write ("\t $(ECHO) 'if [ $$return_code -ne 0 ]; then' >> run_app.sh\n " )
790+ target .write ("\t $(ECHO) 'echo \" ERROR: host run failed, RC=$$return_code\" ' >> run_app.sh\n " )
791+ target .write ("\t $(ECHO) 'fi' >> run_app.sh\n " )
792+ target .write ("\t $(ECHO) 'echo \" INFO: host run completed.\" ' >> run_app.sh\n " )
793+ target .write ("endif\n " )
776794
777795 target .write ("check-devices:\n " )
778796 target .write ("ifndef DEVICE\n " )
@@ -804,7 +822,8 @@ def create_mk(target, data):
804822 add_containers (target , data )
805823 mk_build_all (target , data )
806824 mk_run (target , data )
807- mk_sdcard (target , data )
825+ if not ("platform_type" in data and data ["platform_type" ] == "pcie" ):
826+ mk_sdcard (target , data )
808827 mk_clean (target ,data )
809828 return
810829
0 commit comments