Working Successfully Behind the Scenes
Total Page:16
File Type:pdf, Size:1020Kb
What’s new at Embedded Systems Conference 2008 Working successfully behind the scenes Embedded systems have shown rapid development embedded systems industry cannot imagine work in the last 15 years. There was a time when they without TRACE32. Whether in Europe, the USA, were only to be found in complex technical products or Asia, TRACE32 is recognized as the premier that were never used in the average household, but product and the world’s leading brand in micropro- now they are everywhere. The general public may cessor development tools, which is borne out by be unaware of them since they are embedded and some very impressive fi gures: In 2007 alone, over 7000 new workplaces worldwide were equipped with TRACE32! WinCE TRACE32 stands for continuity, but mainly for progress and inventive- UML CFI RTOS SMP ness. One or the other is always in the foreground, depending on the branch of industry. In this coming year, we Auto- Nexus DigRF intend to push ahead strongly in the TRACE32 Focus development of our products and in- vest in solid growth so that you can TI DSP continue to rely on Lauterbach as an Power Saving Combi Probe innovative partner. The past year, 2007, was of course not STM ITM a year of standing still. In this news- letter for 2008, we wish to show you the technological progress we have made during the last year. We would like to work behind the scenes, but we in the “embedded encourage you to try some of these new features community” know that every ordinary member of for your development to improve your effi ciency. society comes into contact with them every day. We will be presenting many of these innovations at Whether in the car, cell phone, MP3 player, home the ESC Silicon Valley, to which, as every year, we cinema, washing machine, or cooker – embedded cordially invite you. systems are in daily use in almost all technical de- vices, using one or more microcontrollers, digital signal processors, and of course their respective Contents software. And we, the “embedded community”, have to make sure that everything works perfectly Hardware debugging in UML 3 and without any fuss. New supported processors 8 TRACE32 – a premium product Debugging with power-saving modes 9 Lauterbach was founded 29 years ago in the pio- neering age of embedded systems. It has managed New debugging concept for SMP 13 to turn the challenges of this market into techno- systems logical and economic success by a mixture of the New preprocessors / NEXUS adapters 17 right know-how and enormous commitment. Just as we can no longer imagine items of daily use CombiProbe 18 without embedded systems, a developer in the www.lauterbach.com NEWS 2008 DEBUGGER, REAL-TIME TRACE, LOGIC ANALYZER TRACE32 for Virtual Prototypes Virtual Prototypes PowerView Today, fast and effi cient software development is CoWare® CoWare ARM often the decisive factor in the launching of new Virtual Platform products. To avoid having to wait for the fi rst hard- ware prototypes at the start of the development PowerDebug Synopsys® Virtual Platform ARM phase, Virtual Prototypes (software models of the (formerly Virtio) XScale hardware) are becoming increasingly common. Virtual Prototype VaST ™ VaST ARM As soon as a is available for the PowerTrace target hardware, work can start on debugging the Virtual System OAK drivers, the operating system, and the application. Prototype PowerPC/eTPU So that we can offer our customers the profes- SH2A PowerProbe sional development environment TRACE32 in this StarCore early phase of their project, Lauterbach has been TeakLite supporting the debugging of software models TriCore/PCP since 2007. The debugging interface used here is Power- V850 the debugging API of the Virtual Prototype. Integrator TRACE32 as GDB front end GDB front end Other innovations ARM Available In the 2007 Newsletter, Lauterbach announced I386 Available “Integrated run- & stop-mode debugging for em- MIPS32 Available bedded Linux applications”. This year this is fol- lowed by a new concept for debugging SMP Linux PowerPC Available (see page 13). SH4 Planned XScale Available TRACE32 GUI Since early 2007, the TRACE32 GUI can also be used for process debugging with GDB. The sup- Ethernet / RS-232 ported communication interfaces to the target Embedded LINUX hardware are Ethernet or RS-232. t32server Debugging application processes GDB GDB GDB To debug two or more application processes simul- server 1 server 2 server 3 taneously, Lauterbach provides its own debugging agent – t32server, which is started fi rst in the Linux terminal window. Subsequently via the TRACE32 Task Task Task GUI several GDB servers for testing application 1 2 3 processes can be started. The t32server service is then responsible for data exchange between the Fig. 1: The t32server service, enabling simultaneous debugging of TRACE32 GUI and the GDB servers (see Fig. 1). two or more application processes 2 www.lauterbach.com NEWS 2007 NEWS 2008 DEBUGGER, REAL-TIME TRACE, LOGIC ANALYZER Integration, testing, and debugging of C code together with UML-generated sources PowerView Old C code At the outset, we have a fi nished project in C code. The following example uses a traffi c light system PowerDebug (which is a favorite of software designers due to its simplicity). There is a standard intersection with four sets of traffi c lights. The traffi c lights located opposite each other are controlled in parallel. The PowerTrace traffi c lights at the right angle to them are, of course, controlled complementary. The different traffi c light phases are: red – red and yellow – green – yellow – red. During the red phase of one set of traffi c lights, PowerProbe right of way switches to the opposite direction. As a result, there is a short period when the lights Fig. 2: Adding tram traffi c lights to a traffi c intersection facing in all directions are on red (this is important, Power- as we shall see later). Integrator Introduction This circuit is coded in C as a simple control (switch- It will soon no longer be possible to master the case) in a continuous loop (while (1)). This continu- growing complexity of software without the use of ous loop is found directly in the “main()” routine of CASE tools. UML, especially, has enabled the uni- the application, and is called immediately after ini- form design of modular software components, in- tialization (see Fig. 3). cluding automatic code generation, which prevents common coding errors right from the start. ... However many companies shy away from the per- int main (void) { ceived effort required for the changeover to these horizontal = vertical = red; new techniques. They have a code base that has state = closed_to_h; been built up over decades and although the soft- while (1) ware has been constantly extended and improved. { This has also led to the creation of more and more switch (state) “spaghetti code”. Millions of functioning lines of { case closed_to_h: code would need to be analyzed, re-programmed, wait (1); and fi nally re-tested. horizontal = yellowred; state = yellowred_h; In most cases these fears are unfounded. Existing break; C code can be transferred to a UML model element with almost no changes necessary. Future exten- case yellowred_h: wait (3); sions can then be written as UML models, gener- horizontal = green ated, and integrated with the “old” C code. As a state = green_h; result, an easy and progressive transition from C to break; UML is possible. The following example explains ... these procedures: Fig. 3: Existing C code for traffi c-light control; the “main()” routine 1. Transfer from “old” C code to UML. includes a continuous loop that contains the logic as a switch- case construct. 2. Integration of a new functionality coded in UML. 3. Uniform testing and debugging in UML, C++ New requirements and C. The street planners have decided that a tramline should cross the intersection in both directions 〉〉 www.lauterbach.com 3 NEWS 2008 DEBUGGER, REAL-TIME TRACE, LOGIC ANALYZER (vertically as well as horizontally, refer to Fig. 2 on main() is already part of the framework and there- page 3). Therefore, the trams must be stopped at fore has to be omitted. Instead, “main()” is renamed PowerView the intersection by their own set of traffi c lights. At “processJunction()”, and this becomes our new the request of the tram driver, the intersection is starting point. The end point of the function will be blocked for cars at the next red light phase, and the the phase when all traffi c lights are on red. Now, if PowerDebug tram is given right of way. required, we can execute additional actions during this red phase (see Fig. 5). – And that’s it. UML wrapper for C code We could, of course, just “patch” these require- UML design for new requirements PowerTrace ments into our C code. But doing so would only Now we can take care of the design for the new make the function larger and more complicated, requirements. We build a class called “Junction”, which is exactly what we want to avoid. So instead which contains the old traffi c light controls, called PowerProbe of this, we will take a modular approach to the “CarJunction”, as well as two new tram traffi c lights problem and solve it with the help of UML. (Fig. 6). The design is now fi nished, and we can Firstly, we need to “trans- focus on the behavior of the extended intersection, Power- fer” the existing appli- using a state transition diagram. Integrator cation over to our UML model, which is easier than it sounds: We create one class, called “Car- Fig. 4: The “CarJunction” Junction”, which contains class, containing the com- the complete “old” appli- plete “old” application cation (see Fig.