Altera_Forum
Honored Contributor
14 years agoNIOS simulation in Modelsim
Hi!
My boss asked me to put together a NIOS system and simulate it successfully in Modelsim, and then show him how to do it. I was able to get the "Hello World" example to work (only when the project was built in Qsys, not SOPC builder for some reason), so I thought I would try something more complicated. My system is quite simple, 2 on chip memory, NIOS II, and a JTAG UART. I started a blank project from a template in the Eclipse SBT. The only thing I added to the blank project is a simple main function that loops through a couple memory addresses and does some reads and writes. The read/write to the memory is done with the IOWR/RD_32DIRECT functions supplied in the template. Problem is, the simulation doesn't do anything. I've let it run for really long periods, I've tried changing the code, BSP settings, everything I can think of. The waveforms in the test bench just load some instructions, do some datamem access, and repeat. The process just repeats with the same instructions and same data accesses over and over again every so often. The addresses of the data r/w look like it is probably heap/stack access. It seems to me that this activity is the HAL working and has nothing to do with my code. So why does my code not run? I can't see any difference between my settings and the simple "Hello World" example. I'm not trying to do anything to complicated. I even tried to run the Altera "Mem Test" example which also did not work. There must be something I'm missing but I don't know what it is. Any thoughts would be appreciated. Thank you!