Is there a NOP opcode for the PRU?

230 views
Skip to first unread message

ky...@cranehome.info

unread,
Aug 12, 2015, 12:45:09 PM8/12/15
to BeagleBoard
This seems like a question that ought to be easy to answer but so far my searching has not turned up a clear one.  I need a NOP on occasion to balance out timing on things and thus far every iteration I have tried of NOPx results in 'instruction illegal for core version'.   I'm having to do dummy register loads now which looks kind of goofy.   Is there a NOP instruction that works in PRU assembly?

Charles Steinkuehler

unread,
Aug 12, 2015, 2:07:50 PM8/12/15
to beagl...@googlegroups.com
I don't think there's a specific NOP, but since the PRU doesn't have
flag bits (except for carry) to worry about, you can alias any of a
number of instructions to be a NOP:

AND r1, r1, r1
OR r1, r1, r1
XOR r1, r1, 0
MOV r1, r1

...and so on.

--
Charles Steinkuehler
cha...@steinkuehler.net

TJF

unread,
Aug 13, 2015, 3:01:48 PM8/13/15
to BeagleBoard
Hi!

The assembler also supports a NOPn operation (NOP0 - NOPf). See SRM chapter 5.3.4.1.18 for details.

BR

ky...@cranehome.info

unread,
Aug 13, 2015, 4:05:35 PM8/13/15
to BeagleBoard
I read that (SRM page 61) and mentioned in my post that I had tried them.  "thus far every iteration I have tried of NOPx results in 'instruction illegal for core version'".   NOP0, NOP1, NOP2, NOP3, ect all give the same result.  The SRM says they are undefined and doesn't provide much insight beyond that.   I can go the .macro route but it seems awkward, and I've never worked on a platform that didn't have a NOP instruction.  If the .macro works then so be it, I just need the instruction to take 5ns.  I don't much care how it does it really.  I just don't want to add confusion by it being duplicate instructions.


Carlos Novaes

unread,
Aug 14, 2015, 7:53:35 PM8/14/15
to BeagleBoard
I was unable to use the NOPx instructions, same error. But you can define a macro, ex:
.macro NOP
MOV r1, r1
.endm

.macro NOP2
MOV r1, r1
MOV r1, r1
;endm

and so on. Your code will look more readable.

ky...@cranehome.info

unread,
Aug 21, 2015, 5:02:51 PM8/21/15
to BeagleBoard


Yep, that approach works well.   Thanks!
Reply all
Reply to author
Forward
0 new messages