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

Using the cpu simulator

Altera_Forum
Honored Contributor II
1,569 Views

QII4.1,SOPC4.1 web edition, Nios3.2 

Trying to get the gdb cpu simulator to work. Do I need to build the code in any special way to make this work? I have tried using the same build I use for the gdb hw debugger, but I get erratic results stepping thru the code. The 4.0SP1 and the 4.1 both have this problem.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
898 Views

What kind of erratic results are you getting?  

 

It seems to be working fine for me.
0 Kudos
Altera_Forum
Honored Contributor II
898 Views

The main thing is that when I step thru assembly code, it does not execute the instructions correctly. The register window often does not show the proper result of having executed the instruction shown. The $pc is sometimes incorrect, even though the proper code address is right there in the code window. In certain modules, I can step a few instructions and then it just refuses to proceed. The target settings in the Insight tool do not match the setup file settings that should have been loaded, and I end up reloading everything twice. Whenever I make a mistake in the sequence of what to load when, everything locks and I have to shut it down. 

 

All of this may be the result of not building the code correctly, or not creating a proper setup file for gdb. There must be a better set of docs that describe what goes in the setup file. If you could post the contents of your setup file and command lines for build & debug, I could try it. 

 

My original goal was to step thru the assembly from reset to main(), a useful thing to do. For my system that would include the onchip bootstrap, the flash copy routine, and my app. I have had no luck getting more than one code image loaded at the same time, but there is no point if the tool does not work properly. I have tried building for debug (or not) and building with no optimization.  

 

The GDB HW debugger does work, but I lose connection frequently and I can't step into ROM. 

 

I tried the NiosII IDE, and that simulator appears to work. For the moment I am stuck with NiosI.
0 Kudos
Altera_Forum
Honored Contributor II
898 Views

My suggestion, if you have access to Nios II... 

debug using Nios II IDE then go back to Nios I for the final (If you HAVE to use Nios I).
0 Kudos
Altera_Forum
Honored Contributor II
898 Views

Can I debug NiosI code on the NiosII IDE?  

Does the ISS work with the NiosI instruction set?  

I have no Jtag, so it would also have to support using serial ports for HW debug. 

 

I suspect once my code was working on NiosII, there would be no reason to go back.
0 Kudos
Altera_Forum
Honored Contributor II
898 Views

I suggested using Nios II because you said you had it working there. 

It will probably be faster to figure it out in NiosII.  

Try it and tell us, or email us if you have problems.
0 Kudos
Reply