-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (73 loc) · 2.06 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
PROGRAM=micro86
SOURCE= \
src/$(PROGRAM).v \
src/eeprom.v \
src/memory_bus.v \
src/peripherals.v \
src/ram.v \
src/rom.v \
src/spi.v
default:
yosys -q -p "synth_ice40 -top $(PROGRAM) -json $(PROGRAM).json" $(SOURCE)
nextpnr-ice40 -r --hx8k --json $(PROGRAM).json --package cb132 --asc $(PROGRAM).asc --opt-timing --pcf icefun.pcf
icepack $(PROGRAM).asc $(PROGRAM).bin
program:
iceFUNprog $(PROGRAM).bin
blink:
nasm -o rom.bin test/blink.asm
python3 tools/bin2txt.py rom.bin > rom.txt
lcd:
nasm -o rom.bin test/lcd.asm
python3 tools/bin2txt.py rom.bin > rom.txt
music:
nasm -o rom.bin test/music.asm
python3 tools/bin2txt.py rom.bin > rom.txt
memory:
nasm -o rom.bin test/memory_access.asm
python3 tools/bin2txt.py rom.bin > rom.txt
immediate:
nasm -o rom.bin test/immediate.asm
python3 tools/bin2txt.py rom.bin > rom.txt
scaled:
nasm -o rom.bin test/scaled.asm
python3 tools/bin2txt.py rom.bin > rom.txt
write_mem:
nasm -o rom.bin test/write_mem.asm
python3 tools/bin2txt.py rom.bin > rom.txt
memory_access:
nasm -o rom.bin test/memory_access.asm
python3 tools/bin2txt.py rom.bin > rom.txt
stack:
nasm -o rom.bin test/stack.asm
python3 tools/bin2txt.py rom.bin > rom.txt
call:
nasm -o rom.bin test/call.asm
python3 tools/bin2txt.py rom.bin > rom.txt
neg:
nasm -o rom.bin test/neg.asm
python3 tools/bin2txt.py rom.bin > rom.txt
shift:
nasm -o rom.bin test/shift.asm
python3 tools/bin2txt.py rom.bin > rom.txt
jump:
nasm -o rom.bin test/jump.asm
python3 tools/bin2txt.py rom.bin > rom.txt
sign_ext:
nasm -o rom.bin test/sign_ext.asm
python3 tools/bin2txt.py rom.bin > rom.txt
lea:
nasm -o rom.bin test/lea.asm
python3 tools/bin2txt.py rom.bin > rom.txt
mem_test:
nasm -o rom.bin test/mem_test.asm
python3 tools/bin2txt.py rom.bin > rom.txt
mem_test_ebp:
nasm -o rom.bin test/mem_test_ebp.asm
python3 tools/bin2txt.py rom.bin > rom.txt
disasm:
ndisasm -b 32 rom.bin
clean:
@rm -f $(PROGRAM).bin $(PROGRAM).json $(PROGRAM).asc *.lst
@rm -f blink.bin test_alu.bin test_shift.bin test_subroutine.bin
@rm -f button.bin
@echo "Clean!"