comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: Ada automatic code generation for Simulink models
Date: Mon, 03 Jun 2002 11:41:24 +0200
Date: 2002-06-03T11:41:24+02:00	[thread overview]
Message-ID: <6pbmfuolrd53h2b3iv0cnq7gdlb9geecec@4ax.com> (raw)
In-Reply-To: u1ybr3ufv.fsf@gsfc.nasa.gov

On 01 Jun 2002 11:11:32 -0400, Stephen Leake
<stephen.a.leake.1@gsfc.nasa.gov> wrote:

>John Kern <jkern3@NOSPAM.visteon.com> writes:
>
>> weak typing 
>
>C weak typing or Simulink weak typing? C weak typing you don't care
>about. Simulink weak typing is a problem (I haven't used it, so I
>don't really know if it is weak).

Typing is pretty strong when there is only one type... (:-))

>> and the representations of variables, etc. 
>
>I can imagine that defining a "type" in Simulink or UML that matches
>some hardware register would be hard, if not impossible.

In Simulink you should write a so-called S-function which is
responsible to implement a block that does something that Simulink
cannot do [=almost everything (:-))]. This S-function is written in a
"normal" language, like C.

It is no problem to have an Ada interface as long all is running in a
"simulation" mode under some OS. The real problem is the "real" mode
when your code linked with Simulink generated one runs on some
embedded system.

>> which didn't seem to be that big a problem when using Ada.
>
>If the Simulink generated Ada, you still wouldn't be able to define a
>Simulink "type" that matched hardware registers. Simulink is _not_
>going to generate a representation clause for a bit-mapped record type.

You do not need that, because Simulink is not a universal purpose
language. An engineer draws his diagrams and  gets some code
implementing the controlling loop [*]. That's it. The inputs, outputs
and parameters, all that cannot be implemented in Simulink, if they
are not built-in. In a really big concurrent system communicating over
ethernet, field buses, having unconvetional hardware etc., you really
really need Ada. Otherwise you have to implement all that stuff in C
meeting real-time conditions ...

... which brave engineers are doing so far!

>If Simulink did let you define a bit-mapped hardware register, it
>could generate a bit-mapped C struct, and hope the C compiler has a
>"pack structs" flag; most do. So generated Ada would still not be
>necessary. 
>
>Make sure you are fighting the right battle; you need Simulink to be
>more like Ada, not just Simulink to generate Ada.

The best way would be to abadon Simulink, but do not even think to say
that engineers!
---------------------------------

[*]  Once I asked an engineer to write manually a formula implementing
the bunch of blocks he was busily drawing on the blackboard. To that
time moment he had almost consumed all available space. After a
lengthy pause, he produced an expression containing pair +,- and one
*.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



      parent reply	other threads:[~2002-06-03  9:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-29 20:27 Ada automatic code generation for Simulink models John Kern
2002-05-30  6:35 ` Robert C. Leif
2002-05-30  8:59 ` Rod Chapman
2002-05-30 15:20 ` Stephen Leake
2002-05-31 19:21 ` Simon Wright
2002-05-31 20:19   ` John Kern
2002-05-31 20:59     ` Simon Wright
2002-06-01 15:11     ` Stephen Leake
2002-06-01 17:09       ` Simon Wright
2002-06-01 18:23         ` Vinzent Hoefler
2002-06-01 19:38           ` Stephen Leake
2002-06-03  9:41       ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox