Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12747 Discussions

How to create memory initialization file from ELF for NIOS simulation

Altera_Forum
Contributeur émérite II
1 701 Visites

Hi there, 

 

In my SOPC system, the NIOS accesses an external SRAM through a customized SRAM controller. Before this point I was using the onchip ram to run C code in both hardware and functional simulation (which is supported by default by the simulation flow). I would like to run the C code from the external SRAM, and would like to be able to simulate that. 

 

To simulate running C code from SRAM, I will need to initializa the SRAM with a HEX file converted from ELF file. Before this point the NIOS EDS generates the HEX file automatically based on the ELF, the data width and address width of the onchip RAM. Is it possible to generate the HEX file for the external SRAM if we supply the data and address width of it? 

 

Thanks, 

Hua
0 Compliments
3 Réponses
Altera_Forum
Contributeur émérite II
703 Visites

Hi HUA, you using SBT GUI or using the nios2-* command line.

0 Compliments
Altera_Forum
Contributeur émérite II
703 Visites

Hi kee020041, I am using SBT GUI.

0 Compliments
Altera_Forum
Contributeur émérite II
703 Visites

I had the same problem, and don't understand why Altera do not provide a SRAM model whith a relevant .hex initialization file, as it does when the SOPC includes the external IDT SRAM. 

The only "simple" way I found was to use in the SOPC two SRAM, internal and external and switch the settings of the BSP to the internal for the simulation ...
0 Compliments
Répondre