Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,386 Views

Nios program runs slower when loaded from EPCS flash

Hi, 

 

I have written some Nios software that requires real-time operation. i.e. It must execute fast enough to run indefinitely without bottlenecks. When I run the program from the Nios Eclipse IDE everything works until I power down. To make my firmware and software persistent, I want the SOF firmware and ELF software to load from my EPCS flash and run automatically. 

 

So, I've changed the CPU Reset Vector in Qsys to point to my EPCS flash controller instead of SDRAM. I generated the Qsys files, synthesized the Verilog files in Quartus, generated my Nios BSP, rebuilt the application, and used the Nios II Flash Programmer GUI to program the EPCS. 

 

At power on, everything appears to be working. The FPGA is configured and my software runs as expected. The problem is that my program now reaches a bottleneck after 4 seconds and halts. My computations are lagging behind from the start and eventually fails. 

 

If I haven't changed anything besides the CPU's reset vector, what could have changed my code's operation? I've run the same software with the performance counter and both cases appear identical! 

 

-J
0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
45 Views

Could anyone point me to a document that describes how to profile a Nios CPU that has been booted from EPCS? I recall seeing a document describing how to profile code on the Nios, but I believe this requires programming RAM directly from the Eclipse IDE. I'm looking for ways to debug the processor and Qsys busses after being loaded from flash on boot. Maybe SignalTap can help here?

Altera_Forum
Honored Contributor I
45 Views

Is your application writing anything to the console through the Jtag UART? It could come from the fact that you don't have a terminal on the other hand to read the text.

Altera_Forum
Honored Contributor I
45 Views

This happens if I'm connected over USB or not. I've removed all output to STDOUT, so it shouldn't be blocking.

Altera_Forum
Honored Contributor I
45 Views

I don't know if it's possible to profile from the flash, but I know that you can enable a special option in SignalTap to have it wait for a trigger straight from configuration, so that you can get the data afterwards through Jtag. It may help you find out what's going on. If you have some LEDs on your board, it can also be a good idea to control them from different points in your application to find out where it freezes.

Reply