Skip to main content
Knowledgebase
Home
Renesas Electronics America - Knowledgebase

Why time interval is imprecise when NOP instructions were inserted?

Latest Updated:06/28/2012

Question:

I inserted multiple NOP instructions to set an accurate time interval. But this does not provide an accurate time interval (NOP instruction execution cycles X number of instructions). Why is that?

Answer:

M16C Family has a queue buffer which pre-fetches instruction codes while the bus is not busy. Each instruction execution cycle listed in the software manual is a value based on this condition (the instruction is already in the queue buffer). If the instruction has not been pre-fetched, the actual execution cycle of this instruction becomes longer than the listed value.
The condition of the queue buffer depends on the addition or deletion of even one instruction. Therefore, it is not possible to calculate the total number of execution cycles of the routine by counting its number of instructions.
The easiest way to figure out the exact number of execution cycles for the routine is to use the emulation pod trace function and get the count on the trace window.
Suitable Products
R8C/1x
R8C/2x
R8C/3x
R8C/Lx
R8C/Mx
M32C/8A
M32C/88
M32C/87
M32C/85
M32C/84
M32C/83
M32C/80
M16C/62A
M16C/62A(M16C/62T)
M16C/62M
M16C/62N
M16C/62N(M3062GF8NFP, M3062GF8NGP)
M16C/62P
M16C/63
M16C/64A
M16C/64C
M16C/65
M16C/65C
M16C/6C
M16C/6N4, M16C/6N5
M16C/6NK, M16C/6NL, M16C/6NM, M16C/6NN
M16C/5L, M16C/56
M16C/5LD, M16C/56D
M16C/5M, M16C/57
M16C/30P
M16C/29
M16C/28
M16C/26A
M16C/1N