Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

NIOS usleep simulation

Altera_Forum
Honored Contributor II
1,254 Views

Hello! 

 

I am new to NIOS, and I'm trying to simulate a NIOS2 based design using ModelSim. 

 

Everything runs as expected (accesses to Avalon slaves, printf thru Jtag-Uart, ...), except for "usleep" instructions. 

 

"usleep" calls compile with no warnings (IDE), execute with no errors (Modelsim), but the simulator shows the same duration regardless of the argument given (1us, 100us, 100000us). 

 

Any hints? 

 

Jean-Christophe
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
458 Views

Ahaha! 

I found the answer myself, after investigating for half a day... 

 

The function that implements the actual sleep is "alt_busy_sleep()". 

This function checks wether "ALT_SIM_OPTIMIZE" is defined to decide if it skips wait cycles (simulation) or pauses for a while (real target). 

 

Sorry for bothering you all :-)
0 Kudos
Reply