sifive / elf2hex

Converts ELF files to HEX files that are suitable for Verilog's readmemh.
81 stars 21 forks source link

Add offset option to freedom-bin2hex script for supporting SPI flash #11

Open kenzhang82 opened 4 years ago

kenzhang82 commented 4 years ago

In freedom e310 arty kit, the bootROM doesn't jump to the base address of the SPI flash address, but with an offset, add the offset option such that 0's are prepend.

kenzhang82 commented 4 years ago

@palmer-dabbelt can you please review this?

bsousi5 commented 4 years ago

An issue with this approach, is you will overwrite the existing contents prior to you program offset. Consider the following;

[---------------- FLASH MEMORY ------------------------]
| [ FPGA bits ] -- [ BootROM ] --- [ User Program ] ---|
[------------------------------------------------------]

Prepend with leading 0s will overwrite the FPGA bits region

nategraff-sifive commented 4 years ago

@palmer-dabbelt can you please review this?

Palmer doesn't work at SiFive anymore (😢) so you'd be hard pressed to get his review on this. (Palmer, if you do see the notification, hello! Hope you're well!) Bunnaroath and I are the maintainers of Freedom E SDK.

kenzhang82 commented 4 years ago

Hi @nategraff-sifive, thanks for letting me know that Palmer doesn't work at SiFive anymore.

Hi @bsousi5, thanks for the review and feedback, I wonder how we should go handle the case of RTL simulation where the FPGA bitstream and bootROM doesn't really matter. Maybe add a simulation mode option to the script?