From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fba8595cda50c2ec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-03 02:37:47 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!isdnet!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Ada automatic code generation for Simulink models Date: Mon, 03 Jun 2002 11:41:24 +0200 Message-ID: <6pbmfuolrd53h2b3iv0cnq7gdlb9geecec@4ax.com> References: <3CF539BA.32BE0D15@NOSPAM.visteon.com> <3CF7DADA.77DB9166@NOSPAM.visteon.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1023097065 34335924 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:25246 Date: 2002-06-03T11:41:24+02:00 List-Id: On 01 Jun 2002 11:11:32 -0400, Stephen Leake wrote: >John Kern 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