United Business Media EE Times


Search

HOMEMARKET INTELLIGENCE UNITFORUMSDESIGNNEW PRODUCTSCAREERSBLOGSCONTACTEVENTSSIGN UP!RSSMost Popular contentTrusted Sources

 

Protecting critical code on 'C6000 DSPs
Print this article Email this article Reprints RSS Digital Edition

EE Times


Problem: How do you protect critical code from interrupts on TMS320C6000 digital signal processors?

Solution: Critical code sections are usually those that update shared data accessible by multiple threads in an application. Normally, protecting a code segment involves disabling global interrupts by clearing the global interrupt enable (GIE) bit in the control status register before entering the segment, then restoring the previous value of the GIE bit afterward. The typical code method is shown in the figure above.

These operations require four instructions, three extra cycles and one register (B12). A more efficient way to protect a segment, however, is to use the branch instruction. This method can be especially useful when the critical code segment is short. The branch instruction on C64x DSPs has five delay slots, and instructions that execute in those slots are not interruptible. Using the branch instruction, the above example can be rewritten as shown in the figure below.

More branch instructions can be added (see below), but usually one or two suffice, since up to eight can be executed in each execution packet. Compared with the CPIE bit method of protecting code, branching is faster, safer and doesn't require additional register resources.

Xiangdong Fu (xdfu@ti.com), system applications engineer at Texas Instruments Inc. (Dallas)






  Free Subscription to EE Times
First Name Last Name
Company Name Title
Email address
  Click here for your Free Subscription to EETimes Europe
 
CAREER CENTER
Looking for a new job?
SEARCH JOBS
SPONSOR

RECENT JOB POSTINGS
CAREER NEWS
DoD Recognizes University Scientists For Basic Research
Annual awards to university faculty to conduct next-generation research projects were announced this week by the Defense Department.

For more great jobs, career related news, features and services, please visit EETimes' Career Center.



All White Papers »   

 
Education and
Learning


Learn Now:












Home | About | Editorial Calendar | Feedback | Subscriptions | Newsletter | Media Kit | Contact | Reprints|  RSS|   Digital|  Mobile
Network Websites
International
Network Features




All materials on this site Copyright © 2010 TechInsights, a Division of United Business Media LLC All rights reserved.
Privacy Statement | Terms of Service | About