Embedded Systems Design Europe - August/September 2008 - (Page 17) cover feature Hence, any use of the #include directive that doesn’t conform to this pattern should be expanded. Declarations should be moved to a header file that is #include’d in the source files calling the function or accessing the variable. For an example and counterexample, see Listings 1 and 2. being accessed by functions (such as library functions) whose definitions the tools can’t see. A call to such a function makes all global variables “call clobbered.” That means that the function is assumed to read and write all global variables, thereby introducing many unnecessary dependencies. This may unnecessarily block transformations. Instead, in CleanC, the variable should be declared locally and passed as a parameter to other functions using it. A code-cleaning transformation tool can move a global variable to a function scope and add parameters to other functions and their calls as required. Listings 3 and 4 show an example and counterexample relating to a practical implementation of CleanC. CLEANC’S ANALYSIS TOOLS IMEC introduces the CleanC analysis tools to assist designers in analyzing the NEW Standard for stackable PCI Express bus! MSM945P | SMX945 | PCI/104-Express Peripherals • Example 3 – Guideline: keep variables local. Variables in C can be declared local to their surrounding block, or they can be declared global (by using the “extern” keyword or by declaring it outside of a function). In CleanC, global variables should not be used. The problem with using global variables is that accesses to global variables aren’t explicitly visible in function calls. This problem makes understanding of the dependencies between function calls and other expressions very hard. Tools can’t assure us that global variables aren’t MSM945P incl. SMX945 _ PCI/104-Express Baseboard _ Intel® CoreTM 2 Duo L7400 _ DDR2-RAM 256 – 2048MB _ CoreTM Duo 2x 1.6GHz _ 6x USB V2.0, 2x SATA, 1x DIE _ LAN Ethernet 10/100BASE-T _ COM1-2, LPT1 _ Ext. Temp. -40°C to + 70°C Listing 3 Example where the guideline is followed. int f (int x) { } void g (int* x) { *x = f(*x) + 1; } void h () { int x; x = ; g(&x); = x; } // reads x // Reads and writes to x are explicit New PCI/104-Express Peripherals: _ MSMGE104EX: 1x 1GB-LAN _ MSM4E104EX: 4x 1 GB-LAN _ MSMSA104EX: 2x SATA300 _ MSMG104EX: 4x Framegrabber, 16 channel Video input _ MSMEC104EX: ExpressCard 34/54 _ MSMMX104EX: PEG x16 Graphic with ATI E2400 // Reads and writes to x are explicit Listing 4 Counterexample, in other words, where the guideline is not followed. int x; int f () { } void g () { x = f() + 1; } void h () { x = ; g(); = x; } // reads x Booth 2 09 // Indirectly reads x DIGITAL-LOGIC AG offers reliable Embedded Computers in PCI/104e, 3.5”, EPIC, EBX, smartModule, COM Express and other formats. // Indirectly writes x Further information: www.digitallogic.com www.embedded.com/europe | embedded systems design europe | AUGUST – SEPTEMBER 2008 17 012-013-014-016-017-018-019_ESDE.indd 17 28/08/08 13:18:57 http://www.digitallogic.com http://www.embedded.com/europe
Table of Contents Feed for the Digital Edition of Embedded Systems Design Europe - August/September 2008 Embedded Systems Design Europe - August/September 2008 Contents TI Overhauls DSP Lineup, Adds 15 Processors QNX Publishes Source Code for File System Congatec to Take on Proprietary Market Swiss Multicore Project Wins Microsoft Grant OpenCores Bundles Development Tool ARM Compiler Boosts Freescale i.MX31 LabVIEW Updated for Multicore and Wireless Cover Feature: Interactive Tool Supports Multiprocessor SoC Design Wanted: Benchmaking for Embedded VMM Hypervisors Graphical Design Empowers Spider Robots Building a Power Supply for Discontinuous Transmission Wireless Networks RTOS Selection & Best Practices Achieving Cache Coherence in a MIPS32 Multicore Design New Products Advertising Contacts Embedded Systems Design Europe - August/September 2008 Embedded Systems Design Europe - August/September 2008 - Embedded Systems Design Europe - August/September 2008 (Page Cover1) Embedded Systems Design Europe - August/September 2008 - Embedded Systems Design Europe - August/September 2008 (Page Cover2) Embedded Systems Design Europe - August/September 2008 - Contents (Page 3) Embedded Systems Design Europe - August/September 2008 - Contents (Page 4) Embedded Systems Design Europe - August/September 2008 - Contents (Page 5) Embedded Systems Design Europe - August/September 2008 - QNX Publishes Source Code for File System (Page 6) Embedded Systems Design Europe - August/September 2008 - QNX Publishes Source Code for File System (Page 7) Embedded Systems Design Europe - August/September 2008 - OpenCores Bundles Development Tool (Page 8) Embedded Systems Design Europe - August/September 2008 - OpenCores Bundles Development Tool (Page 9) Embedded Systems Design Europe - August/September 2008 - LabVIEW Updated for Multicore and Wireless (Page 10) Embedded Systems Design Europe - August/September 2008 - LabVIEW Updated for Multicore and Wireless (Page 11) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 12) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 13) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 14) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 15) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 16) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 17) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 18) Embedded Systems Design Europe - August/September 2008 - Cover Feature: Interactive Tool Supports Multiprocessor SoC Design (Page 19) Embedded Systems Design Europe - August/September 2008 - Wanted: Benchmaking for Embedded VMM Hypervisors (Page 20) Embedded Systems Design Europe - August/September 2008 - Wanted: Benchmaking for Embedded VMM Hypervisors (Page 21) Embedded Systems Design Europe - August/September 2008 - Graphical Design Empowers Spider Robots (Page 22) Embedded Systems Design Europe - August/September 2008 - Graphical Design Empowers Spider Robots (Page 23) Embedded Systems Design Europe - August/September 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 24) Embedded Systems Design Europe - August/September 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 25) Embedded Systems Design Europe - August/September 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 26) Embedded Systems Design Europe - August/September 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 27) Embedded Systems Design Europe - August/September 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 28) Embedded Systems Design Europe - August/September 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 29) Embedded Systems Design Europe - August/September 2008 - RTOS Selection & Best Practices (Page 30) Embedded Systems Design Europe - August/September 2008 - RTOS Selection & Best Practices (Page 31) Embedded Systems Design Europe - August/September 2008 - RTOS Selection & Best Practices (Page 32) Embedded Systems Design Europe - August/September 2008 - RTOS Selection & Best Practices (Page 33) Embedded Systems Design Europe - August/September 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 34) Embedded Systems Design Europe - August/September 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 35) Embedded Systems Design Europe - August/September 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 36) Embedded Systems Design Europe - August/September 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 37) Embedded Systems Design Europe - August/September 2008 - New Products (Page 38) Embedded Systems Design Europe - August/September 2008 - New Products (Page 39) Embedded Systems Design Europe - August/September 2008 - New Products (Page 40) Embedded Systems Design Europe - August/September 2008 - New Products (Page 41) Embedded Systems Design Europe - August/September 2008 - New Products (Page 42) Embedded Systems Design Europe - August/September 2008 - Advertising Contacts (Page 43) Embedded Systems Design Europe - August/September 2008 - Advertising Contacts (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.