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++
12620 Discussions

Simulating Nios II in Active-HDL

Altera_Forum
Honored Contributor II
963 Views

Hi there, 

 

I am following an application note (APNOTE 768) from Aldec to simulate Nios II in Active-HDL using a standard design example from Altera. The apnote was written for the legacy tools Nios II 9.1 IDE, not for the new tools Nios II 9.1 Software Build Tools for Eclipse. So I wasn't surprised the tutorial in the apnote did not work when I switched to the new tool.  

 

But did anyone have any success making it work? I noted all the configurations mentioned in the tutorial regarding the Nios II 9.1 IDE and found the relevant configurations in the Eclipse, but that didn't seem to cut it. 

 

Here is the link to the apnote: 

 

http://support.aldec.com/knowledgebase/article.aspx?aid=000768 

 

Thanks, 

Hua
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
287 Views

For IDE tools, when I set it as "ModelSim only, no hardware support", it will generate lots of DAT and SYM files, which initializes the memory in simulation tools. 

 

But for Eclipse, it generates ELF and MAP files instead. Does ModelSim support to read those files as input for simulation? 

 

Thanks, 

Hua
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

I wonder which script generate the following response: 

 

Post-processing to create RUN_ON_HDL_SIMULATOR_ONLY_ext_flash.flash 

elf2flash --input=RUN_ON_HDL_SIMULATOR_ONLY_s2.elf --flash= --boot="C:/altera/91/ip/altera/nios2_ip/altera_nios2/boot_loader_cfi.srec" --outfile=RUN_ON_HDL_SIMULATOR_ONLY_ext_flash.flash --sim_optimize=1 --base=0x0 --end=0xFFFFFF --reset=0x0 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create ext_flash.dat 

flash2dat --infile=RUN_ON_HDL_SIMULATOR_ONLY_ext_flash.flash --outfile=C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/ext_flash.dat --base=0x00000000 --end=0xFFFFFF --pad=0 --create-lanes=0 --width=8 --relocate-input=0x00000000 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create ext_ram.dat 

elf2dat --infile=RUN_ON_HDL_SIMULATOR_ONLY_s2.elf --outfile=C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/ext_ram.dat --base=0x02000000 --end=0x20FFFFF --pad=0 --create-lanes=1 --width=32 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create onchip_ram.dat 

elf2dat --infile=RUN_ON_HDL_SIMULATOR_ONLY_s2.elf --outfile=C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/onchip_ram.dat --base=0x02100000 --end=0x210FFFF --pad=0 --create-lanes=0 --width=32 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create sdram.dat 

elf2dat --infile=RUN_ON_HDL_SIMULATOR_ONLY_s2.elf --outfile=C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/sdram.dat --base=0x01000000 --end=0x1FFFFFF --pad=0 --create-lanes=0 --width=32 

rm -f C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/contents_file_warning.txt 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create ext_flash.sym 

nios2-elf-nm -n RUN_ON_HDL_SIMULATOR_ONLY_s2.elf > C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/ext_flash.sym 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create ext_ram.sym 

nios2-elf-nm -n RUN_ON_HDL_SIMULATOR_ONLY_s2.elf > C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/ext_ram.sym 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create onchip_ram.sym 

nios2-elf-nm -n RUN_ON_HDL_SIMULATOR_ONLY_s2.elf > C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/onchip_ram.sym 

if [ ! -d C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ]; then mkdir C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim ; fi 

Post-processing to create sdram.sym 

nios2-elf-nm -n RUN_ON_HDL_SIMULATOR_ONLY_s2.elf > C:/G3/test/Nios_Sim/s2/NiosII_stratixII_2s60_standard_sim/sdram.sym 

Post-processing to create onchip_ram.hex 

elf2hex RUN_ON_HDL_SIMULATOR_ONLY_s2.elf 0x02100000 0x210FFFF --width=32 C:/G3/test/Nios_Sim/s2/onchip_ram.hex --create-lanes=0
0 Kudos
Reply