-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
95 lines (72 loc) · 2.7 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
SOURCES = verilog/fpga.v
.PHONY: all test-all test burn clean emulator kernel sys web
all: doc/table.html emulator kernel sys bootrom.hex ucode.hex testrom.hex web
ttlcpu.bin: ucode.hex testrom.hex
yosys -p "synth_ice40 -top top -json ttlcpu.json" $(SOURCES)
nextpnr-ice40 -r --hx8k --json ttlcpu.json --package cb132 --asc ttlcpu.asc --opt-timing --pcf verilog/iceFUN.pcf
icepack ttlcpu.asc ttlcpu.bin
ucode.hex: ucode/ucode.s
./ucode/uasm < ucode/ucode.s > ucode.hex.tmp
util/pad-lines 2048 0000 < ucode.hex.tmp > ucode.hex
rm ucode.hex.tmp
testrom.hex: testrom.s asm/instructions.json
./asm/asm < testrom.s > testrom.hex.tmp
util/pad-lines 256 0000 < testrom.hex.tmp > testrom.hex
rm testrom.hex.tmp
bootrom.hex: bootrom.s asm/instructions.json
./asm/asm < bootrom.s > bootrom.hex.tmp
util/pad-lines 256 0000 < bootrom.hex.tmp > bootrom.hex
rm bootrom.hex.tmp
test8250.hex: test8250.s
./asm/asm < test8250.s > test8250.hex.tmp
mv test8250.hex.tmp test8250.hex
ucode-low.hex: ucode.hex
sed 's/^..//' ucode.hex > ucode-low.hex
ucode-high.hex: ucode.hex
sed 's/..$$//' ucode.hex > ucode-high.hex
testrom-low.hex: testrom.hex
sed 's/^..//' testrom.hex > testrom-low.hex
testrom-high.hex: testrom.hex
sed 's/..$$//' testrom.hex > testrom-high.hex
bootrom-low.hex: bootrom.hex
sed 's/^..//' bootrom.hex > bootrom-low.hex
bootrom-high.hex: bootrom.hex
sed 's/..$$//' bootrom.hex > bootrom-high.hex
test8250-low.hex: test8250.hex
sed 's/^..//' test8250.hex > test8250-low.hex
test8250-high.hex: test8250.hex
sed 's/..$$//' test8250.hex > test8250-high.hex
test-all: ucode-low.hex ucode-high.hex testrom-low.hex testrom-high.hex emulator
make -C emulator/ test
cd fs/ && ./run-test.sh
cd verilog/ && ./run-tests.sh
cd compiler/test && ./run-test.sh
cd test/ && ./run-test.sh
test:
cd test/ && ./run-test.sh
asm/instructions.json: ucode/ucode.s
./ucode/mk-instructions-json < ucode/ucode.s > asm/instructions.json.tmp
mv ./asm/instructions.json.tmp ./asm/instructions.json
sys/asmparser.sl: asm/instructions.json
./asm/mk-asm-parser > ./sys/asmparser.sl.tmp
mv ./sys/asmparser.sl.tmp ./sys/asmparser.sl
doc/table.html: asm/instructions.json
./asm/mk-table-html > doc/table.html.tmp
mv ./doc/table.html.tmp ./doc/table.html
doc/slang-lib.pdf: sys/lib/*.sl
(cd doc; ./mk-lib-ref)
emulator:
make -C emulator/
kernel:
make -C kernel/
sys: sys/asmparser.sl
make -C sys/
web:
make -C web/
burn: ttlcpu.bin
iceFUNprog ttlcpu.bin
clean:
rm -f *.asc *.bin *blif verilog/a.out verilog/ttl-*_tb.v ucode.hex ucode-low.hex ucode-high.hex bootrom.hex testrom.hex testrom-low.hex testrom-high.hex *.tmp asm/instructions.json sys/asmparser.sl ttlcpu.json
make -C emulator/ clean
make -C kernel/ clean
make -C sys/ clean