@@ -306,24 +306,34 @@ def building_kernel(target, data):
306
306
for con in data ["containers" ]:
307
307
if "accelerators" in con :
308
308
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)/" )
310
315
target .write (acc ["name" ])
311
316
target .write (".xo: " )
312
317
location = acc ["location" ]
313
318
location = location .replace ('PROJECT' , '.' )
314
319
target .write (location )
315
320
target .write ("\n " )
316
321
target .write ("\t mkdir -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 ("\t create_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 " )
327
337
for con in data ["containers" ]:
328
338
target .write ("$(BUILD_DIR)/" )
329
339
target .write (con ["name" ])
@@ -384,50 +394,6 @@ def building_kernel_rtl(target, data):
384
394
target .write ("endif\n " )
385
395
return
386
396
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 ("\t mkdir -p $(TEMP_DIR)\n " )
400
- target .write ("\t create_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 ("\t mkdir -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
-
431
397
def building_host (target , data ):
432
398
target .write ("############################## Setting Rules for Host (Building Host Executable) ##############################\n " )
433
399
@@ -512,21 +478,16 @@ def mk_build_all(target, data):
512
478
target .write ("\n " )
513
479
514
480
rtl_counter = 0
515
- systemc_counter = 0
516
481
if "containers" in data :
517
482
for con in data ["containers" ]:
518
483
if "accelerators" in con :
519
484
for acc in con ["accelerators" ]:
520
485
if "kernel_type" in acc :
521
486
if acc ["kernel_type" ] == "RTL" :
522
487
rtl_counter = 1
523
- elif acc ["kernel_type" ] == "SystemC" :
524
- systemc_counter = 1
525
488
526
489
if rtl_counter == 1 :
527
490
building_kernel_rtl (target , data )
528
- elif systemc_counter == 1 :
529
- building_kernel_systemc (target , data )
530
491
else :
531
492
building_kernel (target , data )
532
493
building_host (target , data )
0 commit comments