-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory initialization files #2136
Comments
Hi @merveyubogluu, When you use litex/litex/soc/integration/soc_core.py Line 163 in a32096e
# ROM.
# Initialize ROM from binary file when provided.
if isinstance(integrated_rom_init, str):
integrated_rom_init = get_mem_data(integrated_rom_init,
endianness = "little", # FIXME: Depends on CPU.
data_width = bus_data_width
)
integrated_rom_size = 4*len(integrated_rom_init) Otherwise, more generally: LiteX uses get_mem_data() to convert a given binary or JSON memory image into Python arrays that initialize its internal memories at build time. These arrays are then passed as the init parameter to Migen’s Memory modules, ensuring that when the design is synthesized and loaded onto the FPGA, the memory blocks already contain the specified instructions or data. |
Hi thanks for the quick response. I understood the part what get_mem_data function does however it actually generates the instructions from the binary only. I was wondering how other memories are generated? Cause when I create an SoC without using the --integrated-rom-init, it generates a memory file. When I include a binary, it still generates the other memory but with a ROM (instruction memory) also. My question was how Litex build that memory (in this case i think its data memory) not the instruction memory. |
Hi, only the ROM is initialized with contents, other memory are not initialized. The CPU will however copy some data to RAM when booting, but it's the CPU/firmware that does it not the SoC. So LiteX only knows how to initialize the ROM and the CPU does the rest. |
Hi, I wanted to understand how Litex actually creates the memory files using Migen. I wanted to compile my own C codes and be able to use the created binary. I actually used the --integrated_rom_init method for instructions but i couldnt find a way for extracting the data memory information from the binary and did not understand how Litex does it.
Does anyone know something about this?
The text was updated successfully, but these errors were encountered: