forked from YosysHQ/prjtrellis
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
33 lines (22 loc) · 1.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
TRELLIS?=/usr/share/trellis
firmware.elf: sections.lds firmware.s
riscv32-unknown-elf-gcc -march=rv32i -Wl,-Bstatic,-T,sections.lds,--strip-debug -ffreestanding -nostdlib -o firmware.elf firmware.s
firmware.hex: firmware.elf
riscv32-unknown-elf-objcopy -O verilog firmware.elf /dev/stdout > firmware.hex
attosoc_tb.vvp: attosoc_tb.v attosoc.v picorv32.v
iverilog -s testbench -o $@ $^
attosoc_sim: attosoc_tb.vvp firmware.hex
vvp -N $<
attosoc.json: io_wrapper.v attosoc.v picorv32.v firmware.hex
yosys -p "synth_ecp5 -nomux -json $@ -top top" io_wrapper.v attosoc.v picorv32.v
attosoc_out.config: attosoc.json
nextpnr-ecp5 --json $< --textcfg $@ --um5g-45k --package CABGA381
attosoc.bit: attosoc_out.config
ecppack --svf-rowsize 100000 --svf attosoc.svf $< $@
attosoc.svf: attosoc.bit
prog: attosoc.svf
openocd -f ${TRELLIS}/misc/openocd/ecp5-versa5g.cfg -c "transport select jtag; init; svf $<; exit"
clean:
rm -f *.vvp *.vcd *.elf *.bin *.hex *.bit *.svf *_out.config *.json
.PHONY: attosoc_sim clean prog
.PRECIOUS: attosoc.json attosoc_out.config attosoc.bit