diff --git a/programming_examples/basic/passthrough_pykernel/Makefile b/programming_examples/basic/passthrough_pykernel/Makefile index 11f2824a4..ad8b457b8 100644 --- a/programming_examples/basic/passthrough_pykernel/Makefile +++ b/programming_examples/basic/passthrough_pykernel/Makefile @@ -15,31 +15,17 @@ include ${srcdir}/../../makefile-common targetname = passThroughKernel VPATH := ${srcdir}/../../../aie_kernels/generic data_size = 4096 -trace_size = 8192 PASSTHROUGH_SIZE = ${data_size} .PHONY: all template clean all: build/final_${data_size}.xclbin -build/aie2_lineBased_8b_${data_size}.mlir: ${srcdir}/aie2.py +build/aie.mlir: ${srcdir}/aie2.py mkdir -p ${@D} - python3 $< ${data_size} 0 > $@ + python3 $< ${PASSTHROUGH_SIZE} > $@ -build/aie_trace__lineBased_8b_${data_size}.mlir: ${srcdir}/aie2.py - mkdir -p ${@D} - python3 $< ${data_size} ${trace_size} > $@ - -build/passThrough.cc.o: passThrough.cc - mkdir -p ${@D} - cd ${@D} && xchesscc_wrapper ${CHESSCCWRAP2_FLAGS} -DBIT_WIDTH=8 -c $< -o ${@F} - -build/final_${data_size}.xclbin: build/aie2_lineBased_8b_${data_size}.mlir build/passThrough.cc.o - mkdir -p ${@D} - cd ${@D} && aiecc.py --aie-generate-cdo --aie-generate-npu --no-compile-host \ - --xclbin-name=${@F} --npu-insts-name=insts_${data_size}.txt $(<:%=../%) - -build/final_trace_${data_size}.xclbin: build/aie2_lineBased_8b_${data_size}.mlir build/passThrough.cc.o +build/final_${data_size}.xclbin: build/aie.mlir mkdir -p ${@D} cd ${@D} && aiecc.py --aie-generate-cdo --aie-generate-npu --no-compile-host \ --xclbin-name=${@F} --npu-insts-name=insts_${data_size}.txt $(<:%=../%) @@ -58,22 +44,8 @@ endif run: ${targetname}_${data_size}.exe build/final_${data_size}.xclbin build/insts_${data_size}.txt ${powershell} ./$< -x build/final_${data_size}.xclbin -i build/insts_${data_size}.txt -k MLIR_AIE -#run-g: ${targetname}.exe build/final_${data_size}.xclbin build/insts.txt -# ${powershell} ./$< -x build/final_${data_size}.xclbin -i build/insts.txt -k MLIR_AIE -t ${trace_size} - run_py: build/final_${data_size}.xclbin build/insts_${data_size}.txt ${powershell} python3 ${srcdir}/test.py -s ${data_size} -x build/final_${data_size}.xclbin -i build/insts_${data_size}.txt -k MLIR_AIE -trace: ${targetname}_${data_size}.exe build/final_trace_${data_size}.xclbin build/insts_${data_size}.txt - ${powershell} ./$< -x build/final_trace_${data_size}.xclbin -i build/insts_${data_size}.txt -k MLIR_AIE -t ${trace_size} - ../../utils/parse_trace.py --filename trace.txt --mlir build/aie_trace_${data_size}.mlir --colshift 1 > trace_vs.json - -trace_py: build/final_trace_${data_size}.xclbin build/insts_${data_size}.txt - ${powershell} python3 ${srcdir}/test.py -x build/final_trace_${data_size}.xclbin -i build/insts_${data_size}.txt -k MLIR_AIE -t ${trace_size} -s ${data_size} - ../../utils/parse_trace.py --filename trace.txt --mlir build/aie_trace_${data_size}.mlir --colshift 1 > trace_vs.json - -clean_trace: - rm -rf tmpTrace trace.txt parse*json trace*json - clean: rm -rf build _build ${targetname}*.exe diff --git a/programming_examples/basic/passthrough_pykernel/aie2.py b/programming_examples/basic/passthrough_pykernel/aie2.py index c635f38ae..a40f12a70 100644 --- a/programming_examples/basic/passthrough_pykernel/aie2.py +++ b/programming_examples/basic/passthrough_pykernel/aie2.py @@ -14,10 +14,8 @@ from aie.extras.dialects.ext.func import func from aie.extras.dialects.ext.scf import _for as range_ -import aie.utils.trace as trace_utils - -def passthroughKernel(vector_size, trace_size): +def passthroughKernel(vector_size): N = vector_size lineWidthInBytes = N // 4 # chop input in 4 sub-tensors @@ -36,10 +34,6 @@ def passThroughLine(input: memRef_ty, output: memRef_ty, lineWidth: np.int32): ShimTile = tile(0, 0) ComputeTile2 = tile(0, 2) - # Set up a circuit-switched flow from core to shim for tracing information - if trace_size > 0: - flow(ComputeTile2, WireBundle.Trace, 0, ShimTile, WireBundle.DMA, 1) - # AIE-array data movement with object fifos of_in = object_fifo("in", ShimTile, ComputeTile2, 2, memRef_ty) of_out = object_fifo("out", ComputeTile2, ShimTile, 2, memRef_ty) @@ -62,15 +56,6 @@ def core_body(): @runtime_sequence(tensor_ty, tensor_ty, tensor_ty) def sequence(inTensor, outTensor, notUsed): - if trace_size > 0: - trace_utils.configure_simple_tracing_aie2( - ComputeTile2, - ShimTile, - ddr_id=1, - size=trace_size, - offset=N, - ) - npu_dma_memcpy_nd( metadata=of_in, bd_id=0, @@ -92,9 +77,8 @@ def sequence(inTensor, outTensor, notUsed): if vector_size % 64 != 0 or vector_size < 512: print("Vector size must be a multiple of 64 and greater than or equal to 512") raise ValueError - trace_size = 0 if (len(sys.argv) != 3) else int(sys.argv[2]) except ValueError: print("Argument has inappropriate value") with mlir_mod_ctx() as ctx: - passthroughKernel(vector_size, trace_size) + passthroughKernel(vector_size) print(ctx.module)