Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15548 Discussions

Error in "Run as -> Nios II Modelsim" using Eclipse SBT

Honored Contributor II



I'm using Quartus 11.1 under Ubuntu 11.10. 


I've been following this( tutorial, trying to simulate a system created with Qsys. 


Everything goes fine, until I finally try to simulate the system in modelsim. When I execute "Run as -> Nios II Modelsim" I get the following error: 


Failed Executing: make sim SPD=/home/daniel/Documentos/universidad/Proyecto/tutorial_diseno/an351_design/niosii_system_tb.spd ELF=/home/daniel/Documentos/universidad/Proyecto/tutorial_diseno/an351_design/software/hello_world_an351/hello_world_an351.elf ENABLE_VSIM_GUI=1 VSIM_DIR=/home/daniel/altera/11.1/modelsim_ase/linuxaloem return code: 2Checking the Nios II console, the error seems to come from the file 


Post-processing to create mem_init/niosii_system_ram.hex... elf2hex /home/daniel/Documentos/universidad/Proyecto/tutorial_diseno/an351_design/software/hello_world_an351/hello_world_an351.elf 0x00010000 0x0001ffff --width=32 --little-endian-mem --create-lanes=0 mem_init/niosii_system_ram.hex /home/daniel/altera/11.1/nios2eds/bin/ 2: Bad substitution make: *** Error 2And the content of that file is: 


# !/bin/sh FILEPATH=${0//\\/\/} _this_script=$(cd ${FILEPATH%*} && echo $(pwd 2>/dev/null)/${FILEPATH##*/}) _this_script_dir=$(dirname ${_this_script}) CMD="$0" perl -I ${_this_script_dir} ${_this_script_dir}/ "$CMD" "$@" ~ As suggested in some forums, I tried to change the first line with "#!/bin/bash", but it didn't work. 


It seems that the problem is located in the second line: "FILEPATH=${0//\\/\/}" 


Has anybody else encountered with this problem? I'd really appreciate any help on this issue 


0 Kudos
3 Replies
Honored Contributor II

Finally, I found an answer in this post: 


One point that we have found with Ubuntu. Most things do work well, however the issue that you mention in your note is very similar to some other .sh issues that we have seen. On Ubuntu, this is commonly resolved by changing the symbolic link for /bin/sh from /bin/dash to /bin/bash: sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh Dash and Bash have a slightly different syntax, and that gets us around most issues.  


This solution worked for me :)
Honored Contributor II

Did both of answers you provided, none worked. 

Any other solutions?

I faced the same issue, I solve it by modifying the path shown to run modelsim , so instead of calling modelsim ae , I make it call modelsim ase