Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

NIOS usleep simulation

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

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 :-)