About ASM ("RPT #7 | | NOP ") A little explanation __timer

Source: Internet
Author: User

In fact, this statement in the development of DSP and other systems are often used, such as the change of some configurations need to delay a few clock cycles before it can take effect, when the ASM ("RPT #7 | | NOP ") can be a shining debut. Although this function we all know and often use, but the specific details many people do not know, including me. Today, in an exchange group, someone suddenly asked the instructions to go down after the execution, how many clock cycles will be occupied. The result is conceivable to ask the monk.


The Simple writing section code compiles the download to the movie inside (I am uses 28335 to carry on the test. ) to observe the TIMER0TIM bit of the CPU TIMER0 registers. Discovery execution asm ("RPT #7 | | NOP "), the Timer0tim bit increment is 8. That is to say 8 cycles per execution. 8 instruction cycles, to be exact. This is only the case of CPU idle, because in idle time, a instruction cycle is about a clock cycle. If 28335 has a task, it may take up 9 or more clock cycles, which is to analyze the pipeline and other factors. In practical applications, it is not necessary to be so precise. Other films may also have more than 8 clocks, mainly to see how many cycles each instruction needs to perform. But one thing is for sure is ASM ("RPT #7 | | NOP ") This instruction is bound to encroach on 8 instruction cycles. Because this instruction means repeating 7+1=8 NOP instructions.

A simple summary:

For tms320f28335 ASM ("RPT #N | | NOP ") executes the n+1 secondary NOP instruction, consuming n+1 instruction cycles. Normally takes up a n+1 clock cycle. Other films occupy a clock cycle of their own calculations. O (∩_∩) o ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.