This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PRU number of cycles per instruction am335x


l1:
// Increment r1
ADD r1, r1, 1

// Store the new r1 value into the address pointed to by r2
ST32 r1, r2

// loop
JMP l1


The above code seems to take 4 cycles per loop, not three.  (The ST32 is really "SBBO    src,dst,#0x00,4").

What takes the extra cycle?  Is it the jump?  The TRM doesn't seem to publish instruction cycle information, probably because all but a few of them are 1... 

--Chris
  • Number of cycles for SBBO is 1+WordCount. So, that is two cycles in loop above. ADD and JMP are single cycle each.

    If the target is a memory location, depending on the memory location on/off the chip, it could also take longer than a cycle because of bus interconnect latencies and arbitration times.

    LBBO,LBCO take 2+WordCount cycles.

    SBBO, SBCO take 1+WordCount cycles.

    All others except SLEEP take single cycle. SLEEP can take from 1 to infinite cycles.

    Thanks.