Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

how to add NOP in nios?

Honored Contributor II

I'm trying to migrate a program in dsp to nios, and I wonder how can I implement the NOP instruction by HAL or ucosii?

0 Kudos
1 Reply
Honored Contributor II

One might ask why you need a 'nop' - the problems are usually making the nios run fast, not slow! 

The assembler will convert 'nop' to 'add r0,r0,r0' - which isn't a very good 'nop' since it changes the flags! 

A better option might be one of the branch instructions. 

'br . + 4' (0x6) is always two clocks. 

'bne r0,r0,anywhere (0xxxxx << 6 | 0x1e) is 1 clock if correctly predicted (likely if backwards).