summaryrefslogtreecommitdiffstats
path: root/de1/fpga-bbc-pq/master/build-system.patch
blob: 7b9f40f39a0d40b5558f2b1af9e974157c2fb4d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..dc728fe
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+PROJ=bbc_micro_de1
+
+SRCS=$(wildcard *.vhd *.v *.qsf *.qpf T65/*.vhd sn76489-1.0/*.vhd roms roms/saa5050/saa5050.hex)
+SOF=${PROJ}.sof
+
+default: load_sof.stamp
+
+sta.stamp:asm.stamp
+	./quartus_wrap quartus_sta ${PROJ} -c ${PROJ}
+	touch $@
+
+asm.stamp:fit.stamp
+	./quartus_wrap quartus_asm --read_settings_files=off --write_settings_files=off ${PROJ} -c ${PROJ}
+	touch $@
+
+${SOF}:asm.stamp
+
+fit.stamp: ans.stamp
+	./quartus_wrap quartus_fit --read_settings_files=off --write_settings_files=off ${PROJ} -c ${PROJ}
+	touch $@
+
+ans.stamp: source.stamp 
+	./quartus_wrap quartus_map --read_settings_files=on --write_settings_files=off ${PROJ} -c ${PROJ}
+	touch $@
+
+source.stamp:${SRCS}
+	touch source.stamp
+
+load_sof.stamp: ${SOF}
+	./quartus_wrap quartus_pgm -m JTAG -o "p;${SOF}" -c 1
+	#touch $@
+
+clean:
+	/bin/rm -rf db incremental_db 
+	/bin/rm -f *.stamp ${SOF} *.rpt *.html *.summary *.pin *.jdi *.qws *.pof *.done *.rom
+	
+	
+	
+
diff --git a/quartus_wrap b/quartus_wrap
new file mode 100755
index 0000000..e818413
--- /dev/null
+++ b/quartus_wrap
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+AD=/software/apps/altera/quartus_ii_13.0sp1
+if [ $(uname -m ) == "x86_64" ]; then
+	LL=linux64
+else
+	LL=linux
+fi
+QUARTUS_ROOTDIR="${AD}/quartus"
+PATH="${AD}/quartus/bin:${AD}/quartus/sopc_builder/bin:${AD}/nios2eds/sdk2/bin:${AD}/nios2eds/bin:${AD}/nios2eds/bin/gnu/H-i686-pc-linux-gnu/bin:${PATH}"
+LD_LIBRARY_PATH="${AD}/quartus/${LL}:/software/apps/altera/libcompat/32:/software/apps/altera/libcompat/64:${LD_LIBRARY_PATH}"
+
+export LD_LIBRARY_PATH PATH QUARTUS_ROOTDIR
+
+"$@"