From b3b1ab2168189d82148b3718cec3e690cbfab4cb Mon Sep 17 00:00:00 2001 From: Emily Furst Date: Tue, 23 Apr 2024 17:57:56 -0700 Subject: [PATCH 1/2] vision examples: small edits for consistency to readmes, makefiles --- programming_examples/vision/color_detect/Makefile | 4 ++-- programming_examples/vision/vision_passthrough/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programming_examples/vision/color_detect/Makefile b/programming_examples/vision/color_detect/Makefile index c8feea4cb6..9376fcd770 100755 --- a/programming_examples/vision/color_detect/Makefile +++ b/programming_examples/vision/color_detect/Makefile @@ -42,7 +42,7 @@ build/final_${COLORDETECT_WIDTH}.xclbin: build/aie2_lineBased_8b_${COLORDETECT_W cd ${@D} && aiecc.py --aie-generate-cdo --aie-generate-ipu --no-compile-host \ --xclbin-name=${@F} --ipu-insts-name=insts.txt $(<:%=../%) -build/${targetname}.exe: test.cpp +${targetname}.exe: test.cpp mkdir -p ${@D} rm -rf _build mkdir -p _build @@ -55,7 +55,7 @@ else cp _build/${targetname} $@ endif -run: build/${targetname}.exe build/final_${COLORDETECT_WIDTH}.xclbin build/insts.txt +run: ${targetname}.exe build/final_${COLORDETECT_WIDTH}.xclbin build/insts.txt ${powershell} ./$< -x build/final_${COLORDETECT_WIDTH}.xclbin -i build/insts.txt -k MLIR_AIE clean: diff --git a/programming_examples/vision/vision_passthrough/README.md b/programming_examples/vision/vision_passthrough/README.md index 31d4add65f..ebb86bc0f2 100644 --- a/programming_examples/vision/vision_passthrough/README.md +++ b/programming_examples/vision/vision_passthrough/README.md @@ -15,7 +15,7 @@ Single tile applies a pass through kernel on data from local memory. There are t To compile desing in Windows: ``` make -make build/passThrough.exe +make passThrough.exe ``` To run the design: From aed1953e2d6570ee9c65a53fe13f6e4cff90693c Mon Sep 17 00:00:00 2001 From: Emily Furst Date: Wed, 24 Apr 2024 20:10:07 -0700 Subject: [PATCH 2/2] [asplos] fix capitalization issues in codegen script --- .../mlir/prime_sieve_large/code_gen.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/programming_examples/mlir/prime_sieve_large/code_gen.py b/programming_examples/mlir/prime_sieve_large/code_gen.py index 77107e4de3..4aa8310324 100644 --- a/programming_examples/mlir/prime_sieve_large/code_gen.py +++ b/programming_examples/mlir/prime_sieve_large/code_gen.py @@ -78,14 +78,14 @@ def main(): for col in range(startcol, startcol + arraycols): # col 0 is reserved in aie for row in range(1, rows): # row 1 -> 8 - f.write(" %%tile%d_%d = AIE.tile(%d, %d)\n" % (col, row, col, row)) + f.write(" %%tile%d_%d = aie.tile(%d, %d)\n" % (col, row, col, row)) - # %objFifo = AIE.objectfifo.createObjectFifo(%tile12, {%tile33}, 2) : !AIE.objectfifo> + # %objFifo = aie.objectfifo.createObjectFifo(%tile12, {%tile33}, 2) : !aie.objectfifo> - # %subview = AIE.objectfifo.acquire(%objFifo : !AIE.objectfifo>, 1) : !AIE.objectfifosubview> - # %elem0 = AIE.objectfifo.subview.access %subview[0] : !AIE.objectfifosubview> -> memref<16xi32> + # %subview = aie.objectfifo.acquire(%objFifo : !aie.objectfifo>, 1) : !aie.objectfifosubview> + # %elem0 = aie.objectfifo.subview.access %subview[0] : !aie.objectfifosubview> -> memref<16xi32> - # AIE.objectfifo.release(%objFifo : !AIE.objectfifo>, 1) + # aie.objectfifo.release(%objFifo : !aie.objectfifo>, 1) f.write("\n") col = startcol @@ -98,7 +98,7 @@ def main(): lockrow = row lockcol = col f.write( - " %%lock%d_%d = AIE.lock(%%tile%d_%d)\n" % (col, row, lockcol, lockrow) + " %%lock%d_%d = aie.lock(%%tile%d_%d)\n" % (col, row, lockcol, lockrow) ) col = col + 1 @@ -115,7 +115,7 @@ def main(): lockrow = row lockcol = col f.write( - " %%lock%d_%d = AIE.lock(%%tile%d_%d)%s\n" + " %%lock%d_%d = aie.lock(%%tile%d_%d)%s\n" % (col, row, lockcol, lockrow, symbol) ) col = col + 1 @@ -147,7 +147,7 @@ def gen_buffer(row, col, lastrow): lockrow = row lockcol = col f.write( - ' %%buf%d_%d = AIE.buffer(%%tile%d_%d) { sym_name = "%s" } : memref<%dxi32>\n' + ' %%buf%d_%d = aie.buffer(%%tile%d_%d) { sym_name = "%s" } : memref<%dxi32>\n' % (col, row, lockcol, lockrow, symbol, bufsize) ) @@ -170,7 +170,7 @@ def gen_buffer(row, col, lastrow): """ %core""" + str(startcol) - + """_1 = AIE.core(%tile""" + + """_1 = aie.core(%tile""" + str(startcol) + """_1) { %c0 = arith.constant 0 : index @@ -199,10 +199,10 @@ def gen_buffer(row, col, lastrow): + """xi32> scf.yield %sum_next : i32 } - AIE.useLock(%lock""" + aie.use_lock(%lock""" + str(startcol) + """_1, "Release", 1) - AIE.end + aie.end } func.func @do_sieve(%bufin: memref<""" + str(bufsize) @@ -292,16 +292,16 @@ def gen_core(col, row, col_p, row_p): if col == startcol and row == 1: None else: - f.write(" %%core%d_%d = AIE.core(%%tile%d_%d) {\n" % (col, row, col, row)) - f.write(' AIE.useLock(%%lock%d_%d, "Acquire", 1)\n' % (col_p, row_p)) - f.write(' AIE.useLock(%%lock%d_%d, "Acquire", 0)\n' % (col, row)) + f.write(" %%core%d_%d = aie.core(%%tile%d_%d) {\n" % (col, row, col, row)) + f.write(' aie.use_lock(%%lock%d_%d, "Acquire", 1)\n' % (col_p, row_p)) + f.write(' aie.use_lock(%%lock%d_%d, "Acquire", 0)\n' % (col, row)) f.write( " func.call @do_sieve(%%buf%d_%d, %%buf%d_%d) : (memref<%dxi32>, memref<%dxi32>) -> ()\n" % (col_p, row_p, col, row, bufsize, bufsize) ) - f.write(' AIE.useLock(%%lock%d_%d, "Release", 0)\n' % (col_p, row_p)) - f.write(' AIE.useLock(%%lock%d_%d, "Release", 1)\n' % (col, row)) - f.write(" AIE.end\n") + f.write(' aie.use_lock(%%lock%d_%d, "Release", 0)\n' % (col_p, row_p)) + f.write(' aie.use_lock(%%lock%d_%d, "Release", 1)\n' % (col, row)) + f.write(" aie.end\n") f.write(" }\n\n") col = startcol