Improve picosoc firmware build process
This commit is contained in:
parent
d087b01bb5
commit
66638dcee0
|
@ -3,7 +3,6 @@
|
||||||
/spiflash_tb.vcd
|
/spiflash_tb.vcd
|
||||||
/spiflash_tb.vvp
|
/spiflash_tb.vvp
|
||||||
/firmware.elf
|
/firmware.elf
|
||||||
/firmware_up.elf
|
|
||||||
/firmware.hex
|
/firmware.hex
|
||||||
/firmware.bin
|
/firmware.bin
|
||||||
/hx8kdemo.asc
|
/hx8kdemo.asc
|
||||||
|
|
|
@ -19,6 +19,9 @@ hx8kprog: hx8kdemo.bin firmware.bin
|
||||||
iceprog hx8kdemo.bin
|
iceprog hx8kdemo.bin
|
||||||
iceprog -o 1M firmware.bin
|
iceprog -o 1M firmware.bin
|
||||||
|
|
||||||
|
hx8kprog_fw: firmware.bin
|
||||||
|
iceprog -o 1M firmware.bin
|
||||||
|
|
||||||
hx8ksim: hx8kdemo_tb.vvp firmware.hex
|
hx8ksim: hx8kdemo_tb.vvp firmware.hex
|
||||||
vvp -N $<
|
vvp -N $<
|
||||||
|
|
||||||
|
@ -49,22 +52,19 @@ hx8kdemo.bin: hx8kdemo.asc
|
||||||
firmware.elf: sections.lds firmware.S
|
firmware.elf: sections.lds firmware.S
|
||||||
riscv32-unknown-elf-gcc -Wl,-Bstatic,-T,sections.lds,--strip-debug -ffreestanding -nostdlib -o firmware.elf 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
|
firmware.hex: firmware.elf
|
||||||
riscv32-unknown-elf-objcopy --change-addresses 0x100000 firmware.elf firmware_up.elf
|
riscv32-unknown-elf-objcopy -O verilog firmware.elf /dev/stdout | sed -e '2,65537 d;' > firmware.hex
|
||||||
|
|
||||||
firmware.hex: firmware_up.elf
|
|
||||||
riscv32-unknown-elf-objcopy -O verilog firmware_up.elf firmware.hex
|
|
||||||
|
|
||||||
firmware.bin: firmware.elf
|
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 ----
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f testbench.vvp testbench.vcd spiflash_tb.vvp spiflash_tb.vcd
|
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.blif hx8kdemo.log hx8kdemo.asc hx8kdemo.rpt hx8kdemo.bin
|
||||||
rm -f hx8kdemo_syn.v hx8kdemo_syn_tb.vvp hx8kdemo_tb.vvp
|
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
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
.memory : {
|
.memory : {
|
||||||
. = 0x000000;
|
. = 0x100000;
|
||||||
start*(.text);
|
start*(.text);
|
||||||
*(.text);
|
*(.text);
|
||||||
*(*);
|
*(*);
|
||||||
|
|
Loading…
Reference in New Issue