From 3f204431718f2d2d56a922d8a31c8f4c459c34ba Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Tue, 3 Mar 2020 14:52:12 -0800 Subject: [PATCH 1/8] Print out elapsed time of make targets --- scripts/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/Makefile b/scripts/Makefile index feb55c0..52ed5d8 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -14,7 +14,9 @@ export USE_CXX11_ABI := 0 .PHONY: $(BITSTREAM) garnet_verilog garnet/garnet.v: + @echo "$@" >> /tmp/time cd garnet && python garnet.py -v --width $(WIDTH) --height $(HEIGHT) --interconnect-only 1> /dev/null + /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time garnet_verilog: garnet/garnet.v @@ -24,24 +26,31 @@ define make-test $1: $(addprefix /tmp/, $1.bs.out) /tmp/$1.bs.out: garnet_verilog /tmp/$1.bs + @echo "$@" >> /tmp/time echo "--- Running test $1..." cd garnet && python tbg.py garnet.v garnet_stub.v $(addprefix /tmp/, $1.bs.json) + /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time /tmp/$1.bs: $(addprefix /tmp/, $1.json) echo "--- Creating bitstream $1..." + @echo "$@" >> /tmp/time cd garnet && python garnet.py --width $(WIDTH) --height $(HEIGHT) --no-pd --input-app /tmp/$1.json \ --interconnect-only --input-file /tmp/$1_input.raw --output-file /tmp/$1.bs --gold-file /tmp/$1_gold.raw && cd .. + /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time /tmp/$1.json: @echo $(COREIR_DIR) @echo ${OUTPUT_REDIRECTION} @echo $(USR_CXX11_ABI) + @echo "$@" >> /tmp/time make -C $(HALIDE_DIR)/$2/$1 bin/design_top.json 1> /dev/null make -C $(HALIDE_DIR)/$2/$1 bin/input.raw && cp $(HALIDE_DIR)/$2/$1/bin/input.raw /tmp/$1_input.raw make -C $(HALIDE_DIR)/$2/$1 bin/output_cpu.raw && cp $(HALIDE_DIR)/$2/$1/bin/output_cpu.raw /tmp/$1_gold.raw cp $(HALIDE_DIR)/$2/$1/bin/design_top.json /tmp/$1_lakelib.json ./build_coreir_cleaner.sh /tmp/$1_lakelib.json cd BufferMapping/script; python coreir_gen.py /tmp/$1_lakelib.json; cp ./output/$1_lakelib_rewrite.json /tmp/$1.json + /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + endef $(foreach app, $(APPS), $(eval $(call make-test,$(app),apps))) From dc5a2413633e486f463d0e905eecf89202b584a0 Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Tue, 3 Mar 2020 15:00:41 -0800 Subject: [PATCH 2/8] Update run.sh --- scripts/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/run.sh b/scripts/run.sh index 9bbfd70..366ca46 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -39,3 +39,6 @@ then make conv_3_3 fi +cat "--- Summary" +cat /tmp/time + From 65d96515524b20a1099b8d0b221707ce562484a9 Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 4 Mar 2020 00:32:35 -0800 Subject: [PATCH 3/8] Update run.sh --- scripts/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 366ca46..fa58e8e 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -39,6 +39,6 @@ then make conv_3_3 fi -cat "--- Summary" +echo "--- Summary" cat /tmp/time From 3807d6cea4763dff29c2dd031cc052856bc6eab1 Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 4 Mar 2020 00:37:04 -0800 Subject: [PATCH 4/8] Update Makefile --- scripts/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Makefile b/scripts/Makefile index 52ed5d8..ac66a30 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -43,6 +43,7 @@ $1: $(addprefix /tmp/, $1.bs.out) @echo ${OUTPUT_REDIRECTION} @echo $(USR_CXX11_ABI) @echo "$@" >> /tmp/time + echo "--- Compiling Halide $1..." make -C $(HALIDE_DIR)/$2/$1 bin/design_top.json 1> /dev/null make -C $(HALIDE_DIR)/$2/$1 bin/input.raw && cp $(HALIDE_DIR)/$2/$1/bin/input.raw /tmp/$1_input.raw make -C $(HALIDE_DIR)/$2/$1 bin/output_cpu.raw && cp $(HALIDE_DIR)/$2/$1/bin/output_cpu.raw /tmp/$1_gold.raw From 3aba32aaba4b3c125883a6bbbdb685618b809e10 Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 4 Mar 2020 10:32:46 -0800 Subject: [PATCH 5/8] Update Makefile --- scripts/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index ac66a30..ea06157 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -26,23 +26,23 @@ define make-test $1: $(addprefix /tmp/, $1.bs.out) /tmp/$1.bs.out: garnet_verilog /tmp/$1.bs - @echo "$@" >> /tmp/time + @echo "$1.bs.out" >> /tmp/time echo "--- Running test $1..." cd garnet && python tbg.py garnet.v garnet_stub.v $(addprefix /tmp/, $1.bs.json) - /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time /tmp/$1.bs: $(addprefix /tmp/, $1.json) echo "--- Creating bitstream $1..." - @echo "$@" >> /tmp/time + @echo "$1.bs" >> /tmp/time cd garnet && python garnet.py --width $(WIDTH) --height $(HEIGHT) --no-pd --input-app /tmp/$1.json \ --interconnect-only --input-file /tmp/$1_input.raw --output-file /tmp/$1.bs --gold-file /tmp/$1_gold.raw && cd .. - /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time /tmp/$1.json: @echo $(COREIR_DIR) @echo ${OUTPUT_REDIRECTION} @echo $(USR_CXX11_ABI) - @echo "$@" >> /tmp/time + @echo "$1.json" >> /tmp/time echo "--- Compiling Halide $1..." make -C $(HALIDE_DIR)/$2/$1 bin/design_top.json 1> /dev/null make -C $(HALIDE_DIR)/$2/$1 bin/input.raw && cp $(HALIDE_DIR)/$2/$1/bin/input.raw /tmp/$1_input.raw @@ -50,7 +50,7 @@ $1: $(addprefix /tmp/, $1.bs.out) cp $(HALIDE_DIR)/$2/$1/bin/design_top.json /tmp/$1_lakelib.json ./build_coreir_cleaner.sh /tmp/$1_lakelib.json cd BufferMapping/script; python coreir_gen.py /tmp/$1_lakelib.json; cp ./output/$1_lakelib_rewrite.json /tmp/$1.json - /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time endef From c04fd55cc920a8e56b1d00769b428a43bdfb96c0 Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 4 Mar 2020 10:38:39 -0800 Subject: [PATCH 6/8] Update install_garnet.sh --- scripts/install_garnet.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install_garnet.sh b/scripts/install_garnet.sh index edee677..a6d84d4 100644 --- a/scripts/install_garnet.sh +++ b/scripts/install_garnet.sh @@ -1,6 +1,4 @@ - -# pin pycoreir version since the latest one doesn't work -pip3 install --ignore-installed coreir==2.0.19 +pip3 install --ignore-installed coreir # install this last since we already have a coreir built python3 python_repo.py From af5faac691d15e554ceb8b61e44bbd3721ab322d Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 4 Mar 2020 20:48:51 -0800 Subject: [PATCH 7/8] Update Makefile --- scripts/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index ea06157..0e17fe9 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -16,7 +16,8 @@ export USE_CXX11_ABI := 0 garnet/garnet.v: @echo "$@" >> /tmp/time cd garnet && python garnet.py -v --width $(WIDTH) --height $(HEIGHT) --interconnect-only 1> /dev/null - /bin/sh -c "echo $(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$$(date -u -d @$$(($$(date +%s) - $$(date -r /tmp/time +%s))) +%T)" >> /tmp/time + cat /tmp/time garnet_verilog: garnet/garnet.v @@ -29,14 +30,14 @@ $1: $(addprefix /tmp/, $1.bs.out) @echo "$1.bs.out" >> /tmp/time echo "--- Running test $1..." cd garnet && python tbg.py garnet.v garnet_stub.v $(addprefix /tmp/, $1.bs.json) - echo "$(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$$(date -u -d @$$(($$(date +%s) - $$(date -r /tmp/time +%s))) +%T)" >> /tmp/time /tmp/$1.bs: $(addprefix /tmp/, $1.json) echo "--- Creating bitstream $1..." @echo "$1.bs" >> /tmp/time cd garnet && python garnet.py --width $(WIDTH) --height $(HEIGHT) --no-pd --input-app /tmp/$1.json \ --interconnect-only --input-file /tmp/$1_input.raw --output-file /tmp/$1.bs --gold-file /tmp/$1_gold.raw && cd .. - echo "$(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$$(date -u -d @$$(($$(date +%s) - $$(date -r /tmp/time +%s))) +%T)" >> /tmp/time /tmp/$1.json: @echo $(COREIR_DIR) @@ -50,7 +51,7 @@ $1: $(addprefix /tmp/, $1.bs.out) cp $(HALIDE_DIR)/$2/$1/bin/design_top.json /tmp/$1_lakelib.json ./build_coreir_cleaner.sh /tmp/$1_lakelib.json cd BufferMapping/script; python coreir_gen.py /tmp/$1_lakelib.json; cp ./output/$1_lakelib_rewrite.json /tmp/$1.json - echo "$(date -u -d @$(($(date +%s) - $(date -r /tmp/time +%s))) +%T)" >> /tmp/time + echo "$$(date -u -d @$$(($$(date +%s) - $$(date -r /tmp/time +%s))) +%T)" >> /tmp/time endef From 85b9132bd4c98a7c9ad2da62d3c20dd566058c5b Mon Sep 17 00:00:00 2001 From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 4 Mar 2020 20:49:37 -0800 Subject: [PATCH 8/8] Update Makefile --- scripts/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 0e17fe9..cb77480 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -27,8 +27,8 @@ define make-test $1: $(addprefix /tmp/, $1.bs.out) /tmp/$1.bs.out: garnet_verilog /tmp/$1.bs - @echo "$1.bs.out" >> /tmp/time echo "--- Running test $1..." + @echo "$1.bs.out" >> /tmp/time cd garnet && python tbg.py garnet.v garnet_stub.v $(addprefix /tmp/, $1.bs.json) echo "$$(date -u -d @$$(($$(date +%s) - $$(date -r /tmp/time +%s))) +%T)" >> /tmp/time @@ -43,8 +43,8 @@ $1: $(addprefix /tmp/, $1.bs.out) @echo $(COREIR_DIR) @echo ${OUTPUT_REDIRECTION} @echo $(USR_CXX11_ABI) - @echo "$1.json" >> /tmp/time echo "--- Compiling Halide $1..." + @echo "$1.json" >> /tmp/time make -C $(HALIDE_DIR)/$2/$1 bin/design_top.json 1> /dev/null make -C $(HALIDE_DIR)/$2/$1 bin/input.raw && cp $(HALIDE_DIR)/$2/$1/bin/input.raw /tmp/$1_input.raw make -C $(HALIDE_DIR)/$2/$1 bin/output_cpu.raw && cp $(HALIDE_DIR)/$2/$1/bin/output_cpu.raw /tmp/$1_gold.raw