Is UML appropriate for embedded systems ?

Nope, an ANSI C compiler cannot eliminate this, unless it can do a cross-module optimization over all modules.

The problem is that you define your subroutines as "int", instead of "static int". I did a similar exercise with the IAR AVR compiler and that changed my three subroutine + main program to a single line.

return 0;

or

LDI R16,0 RET

--
Best Regard
Ulf Samuelsson
Reply to
Ulf Samuelsson
Loading thread data ...

I think that's why Grant Edwards referred to gcc/binutils. For this to be removed we'd require something which knew at least as much as the linker does.

Good point. In my case, (gcc 3.2.2 generating x86 code under Linux) it resolved to no code at all when I declared them both static. If we can reliably give such hints to the compiler, it can do all sorts of magic.

Ed

Reply to
Ed Beroset

Hi Wim Ton,

Reading your reaction below you obviously did NOT use Rose Realtime 2003. Another observation is that hierarchical packages ARE allowed. We always use hierarchical packages in our design. CM integration must be prepared by an expert. Once this has been done Rose-RT integrates seamlesly with your Cm tool. Check in, check out, refresh, all no problem. Refreshing a large model takes about a minute (at least on my PC, a Pentium 4 1.6GHz) and is done in the background. Rose-RT 2003 gives you the possibility to refresh from CM in the background afer opening the model. We use CMSynergy. I agree only on the crappy editor used to fill in your transition code etc. Each freeware product has a better source code editor with syntax highlighting. Your collegae in France probably means Telelogic Tau-G2, which is also a UML 2.0 tool with code generation. I like ROOM state diagram more (above UML 2.0) because they correspond better to the program flow.

Cheers, -- ############################################################ # Oce Technologies B.V. name: Ton Janssen (3A05) # # P.O. Box 101 email: snipped-for-privacy@oce.nl # # 5900 MA Venlo Private: snipped-for-privacy@home.nl # # Tel: +31 (0)77-359 40 97 # # The Netherlands Fax: +31 (0)77-359 54 50 # ############################################################ This note does not necessarily represent the position of Oce Technoligies B.V. Therefore no liability or responsibility for whatever will be accepted.

specification,

specifying

C++

control

generate

maintaining

as

and

Reply to
Ton Janssen

A couple notes from another Realtime user. First, you can have Rose automatically use any favorite editor you choose (Xemacs, etc.) to fill in the code and documentation windows when you're filling in a use case specification or transition snippet. Regarding the CM refresh time, we've hooked it up to RCS, ClearCase, and Razor and the only slow experience is on our older Solaris machines. On a newer Linux based machine it's pretty fast, especially if you replace the rtperl program supplied by Rational with your own scripting front end. There's not a whole lot of speed optimization behind the Perl scripts supplied out-of-the-box by Rational.

Reply to
Doug Haseltine

If bar() in your example was declared static, and if you didn't say i==0 in the for() loop initialisation (which makes the whole program undefined), then gcc optimises it to a single call to printf. If you meant to say "i < limit" as the for() termination condition as I suspect, gcc turns foo() into a return statement. This is with -O6. Try it yourself using -S and look at the asm.

This level of global-optimization was becoming standard about 8 years ago. There are much better optimisers now, including link-time ones that do this over the whole program. There are even optimisers that generate instrumented code, link it, get you to run it over some typical input, then re-optimise using the information gained. To my knowledge this was implemented first in a production compiler also about 6-8 years ago, but definitely wasn't standard then.

Clifford Heath.

Reply to
Clifford Heath

In an article by telelogic,

formatting link
one can read: "Structured Analysis and Structured Design (SASD) techniques have been around for over twenty years, and usage in certain areas of systems and software development, particularly system engineering in large aerospace and defense projects, is still found today.

The first generation of UML has had uptake for analysis and high-level design and some degree of use for partial software generation, but has not been seen as sufficiently complete to replace SASD in all circumstances.

For current practioners of Structured Analysis and Structured Design, who have not been satisfied with the first generation of UML (1.x) due to its lack of support for hierarchical architecture modeling, but who want to be able to adopt the latest visual systems and software development tool support, UML 2.0 provides the answer."

Did you find that UML 1.x had shortcomings and do you consider that UML 2.0 is satisfactory ?

Reply to
Alain

specification,

specifying

development

2.0

In UML 2.0 'Ports' are introduced with required and provided interfaces. IMHO this is the biggest advantage of UML 2.0 compared to 1.x. Ports are a very strong concept when specifying composite objects, i.e. one that contains other objects in a containment relationship. In particular the structured class concept can be specialized to model active objects which have their own thread of control that communicate with other active objects, asynchronously, using message queues. These active objects address a key need of the embedded and real-time developer: the ability to model complex and concurrent objects in the problem domain such as interfaces and devices.

Ports were introduced based on the ROOM concept of ports. The only reason I prefer ROOM above UML is the statediagram implementation. We compared UML state diagrams (Rhapsody) with ROOM state diagrams (Rose RealTime) and found that ROOM state diagrams correspend better to the actual program flow of the generated code. Compare the result of a piece of generated code when drawing a diagram with 3 states (A,B,C) and a choicepoint between A,B(true) and A,C(false). In the UML version there is code duplication, in the ROOM version, reading the diagram is reading the code. It is probably also a matter of taste; we used to ObjecTime in the late nineties.

Cheers, Ton Janssen

Reply to
Ton Janssen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.