m-labs / misoc

The original high performance and small footprint system-on-chip based on Migen™
https://m-labs.hk
Other
306 stars 86 forks source link

vexriscv: make bios big-endian #111

Closed occheung closed 3 years ago

occheung commented 3 years ago

This PR is to convert the generated bios.bin to big-endian.

Behavior before patch

A functioning gateware bitstream top.bit can be generated using --integrated-rom-size option (See #78). However, booting at 0x400000 using bios.bin is not successful using openocd set in artiq_flash. Binary in big-endian is expected.

The little-endian binary of bios.bin is already converted into big-endian in ROM boot_data when building with --integrated-rom-size during memory initialization, in the following snippet: https://github.com/m-labs/misoc/blob/dad351a66fbc8087a37bed0ce4b7bcf153e9795a/misoc/integration/builder.py#L171-L176

Patch summary

software/bios/Makefile

The bios.bin is flipped to big-endian when using a little-endian CPU (e.g. vexriscv).

integration/builder.py

The endian swapping logic introduced in #78 (code snippet above) is reverted, as it is now being performed in software/bios/Makefile directly.