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-01 08:13:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Ada automatic code generation for Simulink models Date: 01 Jun 2002 11:11:32 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3CF539BA.32BE0D15@NOSPAM.visteon.com> <3CF7DADA.77DB9166@NOSPAM.visteon.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1022944738 4131 128.183.220.71 (1 Jun 2002 15:18:57 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 1 Jun 2002 15:18:57 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:25150 Date: 2002-06-01T15:18:57+00:00 List-Id: John Kern writes: > I guess what your are saying is to go ahead and allow code generators to > use the "Universal Assembly" language, and use Ada for only the parts > that cannot be modeled. The auto industry is endeavoring to model the > whole ECU in either Simulink or UML, leaving no room or need for > generated Ada code. What you are saying is that people are using Simulink or UML as the source code, rather than C or Ada. There are real reasons for this; controls engineers like to think in graphical diagrams. I think we need to focus on getting the MathWorks and UML tool vendors to appreciate the features of Ada that we like, and get them integrated into Simulink and UML. > However we still get bogged down with the standardization Standardization of what? The graphical modeling language? yes, that is a problem, and a reason to use Ada instead of a graphical modeling language. UML is a standard, but the standard language is _not_ powerful enough to generate a whole system, so people use non-standard extensions. Improving the UML standard is the best way forward from here; hopefully, it will incorporate some of the software engineering features of Ada. > and modeling of the tasking kernel, If it's not an Ada kernel, you have this problem anyway. > the unsafe C constructs What do you mean, precisely, by "unsafe"? Usually, in the context of "writing C code", this means "constructs that are easily mis-used, leading to maintenance problems". That's irrelevant if Simulink or UML is the source language. Of course, there may be "unsafe Simulink constructs" or "unsafe UML constructs". That would be a reason for using Ada instead, or for fixing the Simulink or UML languages. > and MISRA compliance, Don't know what this is; some industry standard, I guess. > 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). I believe UML has fairly strong typing; on a par with C++ (not quite as good as Ada, but not "weak"). > 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. > 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. 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. -- -- Stephe