Last active
February 8, 2019 21:03
-
-
Save gojimmypi/fc29d4fc575a30567536bece094e5585 to your computer and use it in GitHub Desktop.
TinyFGPA Makefile for picosoc example created on WSL using nextpnr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version = 1.2 | |
riscvbin = /opt/riscv32i/bin/ | |
tinyFPGA_COM ?= /dev/ttyS8 | |
upload: hardware.bin firmware.bin | |
sudo chmod 0666 $(tinyFPGA_COM) | |
tinyprog --com $(tinyFPGA_COM) -p hardware.bin -u firmware.bin | |
hardware.blif: hardware.v spimemio.v simpleuart.v picosoc.v picorv32.v | |
#yosys -ql hardware.log -p 'synth_ice40 -top hardware -blif hardware.blif' $^ | |
yosys -ql hardware.log -p 'synth_ice40 -top hardware -blif hardware.blif -json hardware.json ' $^ | |
hardware.asc: hardware.pcf hardware.blif | |
# arachne-pnr -r -d 8k -P cm81 -o hardware.asc -p hardware.pcf hardware.blif | |
nextpnr-ice40 --lp8k --package cm81 --json hardware.json --pcf hardware.pcf --asc hardware.asc | |
hardware.bin: hardware.asc | |
icetime -d hx8k -c 12 -mtr hardware.rpt hardware.asc | |
icepack hardware.asc hardware.bin | |
firmware.elf: sections.lds start.S firmware.c | |
$(riscvbin)/riscv32-unknown-elf-gcc -march=rv32imc -nostartfiles -Wl,-Bstatic,-T,sections.lds,--strip-debug,-Map=firmware.map,--cref -ffreestanding -nostdlib -o firmware.elf start.S firmware.c | |
firmware.bin: firmware.elf | |
$(riscvbin)/riscv32-unknown-elf-objcopy -O binary firmware.elf /dev/stdout > firmware.bin | |
clean: | |
rm -f firmware.elf firmware.hex firmware.bin firmware.o firmware.map \ | |
hardware.blif hardware.log hardware.asc hardware.rpt hardware.bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment