-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
106 lines (80 loc) · 2.57 KB
/
Makefile
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Comment this out if you have the 12bpp HDMI DVI PMOD
USE24BPP=--flag use24bpp
.PHONY: fib
fib: mc
customasm -f logisim16 programs/fib.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: sieve
sieve: mc
customasm -f logisim16 programs/sieve.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: hello
hello: mc
customasm -f logisim16 programs/hello.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: mc
mc: dig/microcode.hex
.PHONY: displaymc
displaymc: dig/displaymc.hex
dig/microcode.hex: microcode/microcode.asm
customasm -f intelhex microcode/microcode.asm -o dig/microcode.hex
dig/displaymc.hex: microcode/display.asm
customasm -f logisim16 microcode/display.asm -o dig/displaymc.hex
.PHONY: addtest
addtest: mc
customasm -f logisim16 programs/tests/add.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: jumptest
jumptest: mc
customasm -f logisim16 programs/tests/jump.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: calltest
calltest: mc
customasm -f logisim16 programs/tests/call.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: loadstoretest
loadstoretest: mc
customasm -f logisim16 programs/tests/loadstore.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: immtest
immtest: mc
customasm -f logisim16 programs/tests/imm.asm -o dig/test.hex
tail -n +2 dig/test.hex > hdl/test.hex
.PHONY: updatesuite
updatesuite:
ruby scripts/updatetestsuite.rb > dig/testsuite2.dig
diff -u dig/testsuite.dig dig/testsuite2.dig || :
mv dig/testsuite2.dig dig/testsuite.dig
.PHONY: testemu
testemu:
cd emurj && go build emurj.go && cd ..
find programs/tests/*.asm | \
xargs -I testname sh -c 'echo testname && \
customasm -f logisim16 testname -qp | \
emurj/emurj -run - -trace -maxcycles 100'
rm emurj/emurj
@echo "All passed!"
###########
# Fusesoc #
###########
.PHONY: sim
sim:
fusesoc run --target sim rj45:rj32:soc
.PHONY: icezero
icezero:
fusesoc run --target icezero $(USE24BPP) rj45:rj32:soc
.PHONY: iceupload
iceupload: icezero
scp build/rj45_rj32_soc_1.0.0/icezero-icestorm/rj45_rj32_soc_1.0.0.bin pi@raspberrypi.local:~/icezero.bin
.PHONY: colorlight
colorlight:
fusesoc run --target colorlight rj45:rj32:soc
.PHONY: colorlightupload
colorlightupload: colorlight
ecpdap flash write -f 10000 build/rj45_rj32_soc_1.0.0/colorlight-trellis/rj45_rj32_soc_1.0.0.bit
.PHONY: colorlightprog
colorlightprog: colorlight
ecpdap program -f 50000 build/rj45_rj32_soc_1.0.0/colorlight-trellis/rj45_rj32_soc_1.0.0.bit
.PHONY: clean
clean:
rm -rf build fusesoc/build