-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (50 loc) · 1.38 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
PROJ = miniatom
DEVICE = hx8k
BOARD = icoboard
PIN_DEF = $(PROJ)_$(BOARD).pcf
END_SPEED = 33
FOOTPRINT = ct256
SEED=2458678799
# 2458678799 // Timing estimate: 26.54 ns (37.68 MHz)
# -retime -abc2 1031308875 1086239526
all: $(PROJ).rpt $(PROJ).bin
%.blif: %.v vga/vga.v
yosys -p 'synth_ice40 -top top -blif $@' $< > YOSYS.LOG
grep arning YOSYS.LOG
%.asc: $(PIN_DEF) %.blif
arachne-pnr -s $(SEED) -d $(subst hx,,$(subst lp,,$(DEVICE))) -P $(FOOTPRINT) -o $@ -p $^ > ARACHNE.LOG
cat ARACHNE.LOG
%.bin: %.asc
icepack $< $@
%.rpt: %.asc
icetime -d $(DEVICE) -tr $@ $<
rewire:
rm -f $(PROJ).asc $(PROJ).rpt $(PROJ).bin
make
appimage.bin:
echo "@8000" > appimage.hex
cat splashscreen.hex >> appimage.hex
echo "@a000" >> appimage.hex
cat roms/pcharme.hex >> appimage.hex
echo "@c000" >> appimage.hex
cat roms/basic.hex >> appimage.hex
echo "@d000" >> appimage.hex
cat roms/floatingpoint.hex >> appimage.hex
echo "@e000" >> appimage.hex
cat roms/sddos.hex >> appimage.hex
echo "@f000" >> appimage.hex
cat roms/akernel_patched.hex >> appimage.hex
./flashbin.py
prog: $(PROJ).bin
iceprog $<
icoboard: $(PROJ).bin appimage.bin
icoprog -f < $(PROJ).bin
icoprog -O 4 -f < appimage.bin
icoprog -b
sudo-prog: $(PROJ).bin
@echo 'Executing prog as root!!!'
sudo iceprog $<
clean:
rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin appimage.bin
.SECONDARY:
.PHONY: all prog clean