aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/quartus/Makefile
diff options
context:
space:
mode:
authorTom Verbeure <tom_verbeure@yahoo.com>2016-08-29 21:12:08 -0700
committerTom Verbeure <tom_verbeure@yahoo.com>2016-08-29 21:12:08 -0700
commit7bf87502aa70052042cd2e9d8ff9da593a887aa6 (patch)
treee0a0a88a72cdff7644e5a9cfeb66ee065f6911e7 /scripts/quartus/Makefile
parent9d13c05dd210252e540179c8f1d120c89a26289a (diff)
downloadpicorv32-7bf87502aa70052042cd2e9d8ff9da593a887aa6.tar.gz
picorv32-7bf87502aa70052042cd2e9d8ff9da593a887aa6.zip
Clone vivado dir into quartus dir
Diffstat (limited to 'scripts/quartus/Makefile')
-rw-r--r--scripts/quartus/Makefile65
1 files changed, 65 insertions, 0 deletions
diff --git a/scripts/quartus/Makefile b/scripts/quartus/Makefile
new file mode 100644
index 0000000..4e109d2
--- /dev/null
+++ b/scripts/quartus/Makefile
@@ -0,0 +1,65 @@
+
+VIVADO_BASE = /opt/Xilinx/Vivado/2016.1
+VIVADO = $(VIVADO_BASE)/bin/vivado
+XVLOG = $(VIVADO_BASE)/bin/xvlog
+XELAB = $(VIVADO_BASE)/bin/xelab
+GLBL = $(VIVADO_BASE)/data/verilog/src/glbl.v
+TOOLCHAIN_PREFIX = riscv64-unknown-elf-
+
+export VIVADO
+
+help:
+ @echo ""
+ @echo "Simple synthesis tests:"
+ @echo " make synth_area_{small|regular|large}"
+ @echo " make synth_speed"
+ @echo ""
+ @echo "Example system:"
+ @echo " make synth_system"
+ @echo " make sim_system"
+ @echo ""
+ @echo "Timing and Utilization Evaluation:"
+ @echo " make table.txt"
+ @echo " make area"
+ @echo ""
+
+synth_%:
+ rm -f $@.log
+ $(VIVADO) -nojournal -log $@.log -mode batch -source $@.tcl
+ rm -rf .Xil fsm_encoding.os synth_*.backup.log usage_statistics_webtalk.*
+ -grep -B4 -A10 'Slice LUTs' $@.log
+ -grep -B1 -A9 ^Slack $@.log && echo
+
+synth_system: firmware.hex
+
+sim_system:
+ $(XVLOG) system_tb.v synth_system.v
+ $(XVLOG) $(GLBL)
+ $(XELAB) -L unifast_ver -L unisims_ver -R system_tb glbl
+
+firmware.hex: firmware.S firmware.c firmware.lds
+ $(TOOLCHAIN_PREFIX)gcc -Os -m32 -ffreestanding -nostdlib -o firmware.elf firmware.S firmware.c \
+ --std=gnu99 -Wl,-Bstatic,-T,firmware.lds,-Map,firmware.map,--strip-debug -lgcc
+ $(TOOLCHAIN_PREFIX)objcopy -O binary firmware.elf firmware.bin
+ python3 ../../firmware/makehex.py firmware.bin 4096 > firmware.hex
+
+tab_%/results.txt:
+ bash tabtest.sh $@
+
+area: synth_area_small synth_area_regular synth_area_large
+ -grep -B4 -A10 'Slice LUTs' synth_area_small.log synth_area_regular.log synth_area_large.log
+
+table.txt: tab_small_xc7a_1/results.txt tab_small_xc7a_2/results.txt tab_small_xc7a_3/results.txt
+table.txt: tab_small_xc7k_1/results.txt tab_small_xc7k_2/results.txt tab_small_xc7k_3/results.txt
+table.txt: tab_small_xc7v_1/results.txt tab_small_xc7v_2/results.txt tab_small_xc7v_3/results.txt
+table.txt: tab_small_xcku_1/results.txt tab_small_xcku_2/results.txt tab_small_xcku_3/results.txt
+table.txt: tab_small_xcvu_1/results.txt tab_small_xcvu_2/results.txt tab_small_xcvu_3/results.txt
+
+table.txt:
+ bash table.sh > table.txt
+
+clean:
+ rm -rf .Xil/ firmware.bin firmware.elf firmware.hex firmware.map synth_*.log
+ rm -rf synth_*.mmi synth_*.bit synth_system.v table.txt tab_*/ webtalk.jou
+ rm -rf webtalk.log webtalk_*.jou webtalk_*.log xelab.* xsim[._]* xvlog.*
+