Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Print out elapsed time of make targets #25

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ 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
echo "$$(date -u -d @$$(($$(date +%s) - $$(date -r /tmp/time +%s))) +%T)" >> /tmp/time
cat /tmp/time

garnet_verilog: garnet/garnet.v

Expand All @@ -25,23 +28,31 @@ $1: $(addprefix /tmp/, $1.bs.out)

/tmp/$1.bs.out: garnet_verilog /tmp/$1.bs
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

/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

/tmp/$1.json:
@echo $(COREIR_DIR)
@echo ${OUTPUT_REDIRECTION}
@echo $(USR_CXX11_ABI)
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
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

endef

$(foreach app, $(APPS), $(eval $(call make-test,$(app),apps)))
Expand Down
4 changes: 1 addition & 3 deletions scripts/install_garnet.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ then
make conv_3_3
fi

echo "--- Summary"
cat /tmp/time