Open keesj opened 5 years ago
assert cpu_reset_address >= mem_map["rom"] and assert cpu_reset_address < mem_map["rom"] + rom_size
Should be mem_map["rom"] <= cpu_reset_address < mem_map["rom"] + rom size.
why is the memory region set to the start address of the cpu reset
So the linker knows where the startup code begins.
I updated the pull request to fix the above issues and allow booting from spi flash.
Hi,
I am trying to get the papilo pro build working and the first error I got was :
The code in question looks like the following and really looks strange to me
I can understand that the reset address needs to point to a valid part (and preferably the reset vectors of the CPU) but why does the address need to be smaller than the rom_size. should this code not read
assert cpu_reset_address >= mem_map["rom"] and assert cpu_reset_address < mem_map["rom"] + rom_size
the next strange thing is the next line. why is the memory region set to the start address of the cpu reset and not simply the mem_map["rom"] address. I am even more intrigued by the size of the region that is set to rom_size-self.cpu_reset_address.
To me it looks like the code only really will work if the reset_address is 0 (and this is often the case)
I have tried to create a patch that would do something more meaningful but I think I might be lacking some context.
The register_rom function (in my case) is called from https://github.com/m-labs/misoc/blob/master/misoc/targets/papilio_pro.py#L87 (to map the boot code to be flash I guess for being executed xip?).