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

How do I simulate NIOS II designs in modelsim?

Altera_Forum
Honored Contributor II
1,168 Views

Hi, 

 

I followed this document exactly( http://www.altera.com/literature/an/an189.pdf (http://www.altera.com/literature/an/an189.pdf) ), but while their leds start counting, I get no response. I have the feeling the code from the NIOS II IDE is just not being executed. 

 

Do I do something wrong, or is it maybe because I use a different version of the software? I am using Quartus II 4.1 and Modelsim SE PLUS 6.0a. Hope any of you knows what this is. 

 

David
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
495 Views

Yikes! You were following the Nios instructions but sound like you are using Nios II. 

Because Nios II now has the IDE, the procedure for running modelsim is different. 

Maybe this is documented somewhere in the Nios II product (I'll ask our doc manager)? 

 

If not, here's the basic steps: 

1. Open your project in Quartus. 

2. Open SOPC Builder from Quartus. 

3. Open the Nios II IDE from SOPC Builder. 

4. Create a C/C++ project. 

5. Select the build properties of the system library you just created and check the box that says modelsim. 

You must do this to build your elf so that slow startup code that isn't needed to run on modelsim is removed. 

6. Build your project. 

7. Look for "Run As" and select modelsim. 

8. Modelsim should start and your simulated memories should contain your initial program contents. 

 

From here on, it is the same except that your printfs should show up in the IDE.
0 Kudos
Altera_Forum
Honored Contributor II
495 Views

David, 

This is what you want: 

 

an351: simulating nios ii embedded processor designs (http://www.altera.com/literature/an/an351.pdf

 

All documentation for the Nios II processor can be accessed off the Nios II literature page: http://www.altera.com/literature/lit-nio2.jsp (http://www.altera.com/literature/lit-nio2.jsp). 

 

Cheers, 

Matthew
0 Kudos
Altera_Forum
Honored Contributor II
495 Views

Thanks.  

That should teach me not to use google search before checking the website. It works now. 

 

David
0 Kudos
Reply