Improve picosoc firmware build process

This commit is contained in:
Clifford Wolf 2017-09-15 15:19:48 +02:00
parent d087b01bb5
commit 66638dcee0
3 changed files with 9 additions and 10 deletions

1
picosoc/.gitignore vendored
View File

@ -3,7 +3,6 @@
/spiflash_tb.vcd
/spiflash_tb.vvp
/firmware.elf
/firmware_up.elf
/firmware.hex
/firmware.bin
/hx8kdemo.asc

View File

@ -19,6 +19,9 @@ hx8kprog: hx8kdemo.bin firmware.bin
iceprog hx8kdemo.bin
iceprog -o 1M firmware.bin
hx8kprog_fw: firmware.bin
iceprog -o 1M firmware.bin
hx8ksim: hx8kdemo_tb.vvp firmware.hex
vvp -N $<
@ -49,22 +52,19 @@ hx8kdemo.bin: hx8kdemo.asc
firmware.elf: sections.lds firmware.S
riscv32-unknown-elf-gcc -Wl,-Bstatic,-T,sections.lds,--strip-debug -ffreestanding -nostdlib -o firmware.elf firmware.S
firmware_up.elf: firmware.elf
riscv32-unknown-elf-objcopy --change-addresses 0x100000 firmware.elf firmware_up.elf
firmware.hex: firmware_up.elf
riscv32-unknown-elf-objcopy -O verilog firmware_up.elf firmware.hex
firmware.hex: firmware.elf
riscv32-unknown-elf-objcopy -O verilog firmware.elf /dev/stdout | sed -e '2,65537 d;' > firmware.hex
firmware.bin: firmware.elf
riscv32-unknown-elf-objcopy -O binary firmware.elf firmware.bin
riscv32-unknown-elf-objcopy -O binary firmware.elf /dev/stdout | tail -c +1048577 > firmware.bin
# ---- Clean ----
clean:
rm -f testbench.vvp testbench.vcd spiflash_tb.vvp spiflash_tb.vcd
rm -f firmware.elf firmware_up.elf firmware.hex firmware.bin
rm -f firmware.elf firmware.hex firmware.bin
rm -f hx8kdemo.blif hx8kdemo.log hx8kdemo.asc hx8kdemo.rpt hx8kdemo.bin
rm -f hx8kdemo_syn.v hx8kdemo_syn_tb.vvp hx8kdemo_tb.vvp
.PHONY: testbench spiflash_tb hx8kprog hx8ksim hx8ksynsim clean
.PHONY: testbench spiflash_tb hx8kprog hx8kprog_fw hx8ksim hx8ksynsim clean

View File

@ -1,6 +1,6 @@
SECTIONS {
.memory : {
. = 0x000000;
. = 0x100000;
start*(.text);
*(.text);
*(*);