Skip to content

Commit 1d85cdd

Browse files
Virat AgarwalGitHub Enterprise
Virat Agarwal
authored and
GitHub Enterprise
committed
Updating makegen.py to have cleaner systemC part
1 parent c1a1af4 commit 1d85cdd

File tree

2 files changed

+23
-61
lines changed

2 files changed

+23
-61
lines changed

common/utility/makefile_gen/makegen.py

+21-60
Original file line numberDiff line numberDiff line change
@@ -306,24 +306,34 @@ def building_kernel(target, data):
306306
for con in data["containers"]:
307307
if "accelerators" in con:
308308
for acc in con["accelerators"]:
309-
target.write("$(TEMP_DIR)/")
309+
type_systemC = 0
310+
if "kernel_type" in acc:
311+
if acc["kernel_type"] == "SystemC":
312+
type_systemC = 1
313+
if not type_systemC:
314+
target.write("$(TEMP_DIR)/")
310315
target.write(acc["name"])
311316
target.write(".xo: ")
312317
location = acc["location"]
313318
location = location.replace('PROJECT', '.')
314319
target.write(location)
315320
target.write("\n")
316321
target.write("\tmkdir -p $(TEMP_DIR)\n")
317-
target.write("\t$(VPP) ")
318-
target.write("$(VPP_FLAGS) ")
319-
if "clflags" in acc:
320-
target.write("$(VPP_FLAGS_"+acc["name"]+") ")
321-
target.write("-c -k ")
322-
target.write(acc["name"])
323-
target.write(" --temp_dir ")
324-
target.write("$(TEMP_DIR) ")
325-
target.write(" -I'$(<D)'")
326-
target.write(" -o'$@' '$<'\n")
322+
if type_systemC:
323+
target.write("\tcreate_sc_xo ")
324+
target.write(location)
325+
target.write("\n")
326+
else:
327+
target.write("\t$(VPP) ")
328+
target.write("$(VPP_FLAGS) ")
329+
if "clflags" in acc:
330+
target.write("$(VPP_FLAGS_"+acc["name"]+") ")
331+
target.write("-c -k ")
332+
target.write(acc["name"])
333+
target.write(" --temp_dir ")
334+
target.write("$(TEMP_DIR) ")
335+
target.write(" -I'$(<D)'")
336+
target.write(" -o'$@' '$<'\n")
327337
for con in data["containers"]:
328338
target.write("$(BUILD_DIR)/")
329339
target.write(con["name"])
@@ -384,50 +394,6 @@ def building_kernel_rtl(target, data):
384394
target.write("endif\n")
385395
return
386396

387-
def building_kernel_systemc(target, data):
388-
if "containers" in data:
389-
target.write("############################## Setting Rules for Binary Containers (Building Kernels) ##############################\n")
390-
for con in data["containers"]:
391-
if "accelerators" in con:
392-
for acc in con["accelerators"]:
393-
target.write(acc["name"])
394-
target.write(".xo: ")
395-
location = acc["location"]
396-
location = location.replace('PROJECT', '.')
397-
target.write(location)
398-
target.write("\n")
399-
target.write("\tmkdir -p $(TEMP_DIR)\n")
400-
target.write("\tcreate_sc_xo ")
401-
target.write(location)
402-
target.write("\n")
403-
for con in data["containers"]:
404-
target.write("$(BUILD_DIR)/")
405-
target.write(con["name"])
406-
target.write(".xclbin:")
407-
target.write(" $(BINARY_CONTAINER_")
408-
target.write(con["name"])
409-
target.write("_OBJS)\n")
410-
target.write("\tmkdir -p $(BUILD_DIR)\n")
411-
target.write("ifeq ($(HOST_ARCH), x86)\n")
412-
target.write("\t$(VPP) $(VPP_FLAGS) ")
413-
target.write("-l $(VPP_LDFLAGS) --temp_dir ")
414-
target.write("$(TEMP_DIR)")
415-
416-
if "ldclflags" in con:
417-
target.write(" $(VPP_LDFLAGS_"+con["name"]+")")
418-
target.write(" -o'$(BUILD_DIR)/" + con["name"] + ".link.xclbin' $(+)\n")
419-
420-
target.write("\t$(VPP) -p $(BUILD_DIR)/" + con["name"] + ".link.xclbin -t $(TARGET) --platform $(DEVICE) ")
421-
target.write("--package.out_dir $(PACKAGE_OUT) -o $(BUILD_DIR)/" + con["name"] + ".xclbin\n")
422-
target.write("else\n")
423-
target.write("\t$(VPP) $(VPP_FLAGS) -l $(VPP_LDFLAGS) --temp_dir $(TEMP_DIR)")
424-
if "ldclflags" in con:
425-
target.write(" $(VPP_LDFLAGS_"+con["name"]+")")
426-
target.write(" -o'$(BUILD_DIR)/" + con["name"] + ".xclbin' $(+)\n")
427-
target.write("endif\n")
428-
target.write("\n")
429-
return
430-
431397
def building_host(target, data):
432398
target.write("############################## Setting Rules for Host (Building Host Executable) ##############################\n")
433399

@@ -512,21 +478,16 @@ def mk_build_all(target, data):
512478
target.write("\n")
513479

514480
rtl_counter = 0
515-
systemc_counter = 0
516481
if "containers" in data:
517482
for con in data["containers"]:
518483
if "accelerators" in con:
519484
for acc in con["accelerators"]:
520485
if "kernel_type" in acc:
521486
if acc["kernel_type"] == "RTL":
522487
rtl_counter = 1
523-
elif acc["kernel_type"] == "SystemC":
524-
systemc_counter = 1
525488

526489
if rtl_counter == 1:
527490
building_kernel_rtl(target, data)
528-
elif systemc_counter == 1:
529-
building_kernel_systemc(target, data)
530491
else:
531492
building_kernel(target, data)
532493
building_host(target, data)

emulation/external_io/xrt.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[Debug]
2-
profile=true
2+
opencl_summary=true
3+
opencl_device_counter=true

0 commit comments

Comments
 (0)