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,5a51ee2b8ee36d5f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-18 03:05:14 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!howland.erols.net!dispose.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!zap!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Code Generation Question Date: 17 Mar 2001 07:39:17 +0000 Organization: CodeFella Message-ID: References: <98ug7e$9oj$1@newpoisson.nosc.mil> NNTP-Posting-Host: localhost X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 X-Trace: news.demon.co.uk 984913489 nnrp-07:7992 NO-IDENT pogner.demon.co.uk:158.152.70.98 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: 17 Mar 2001 07:39:17 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: supernews.google.com comp.lang.ada:5823 Date: 2001-03-17T07:39:17+00:00 List-Id: claveman@cod.nosc.mil (Charles H. Sampson) writes: > Our project uses a heavily populated VME rack with a PowerPC as the > CPU. I certainly don't understand all of the VME arcania but it seems > obvious to me that VME is at its root byte oriented. One of the cards > in the rack requires 16-bit reads and writes to its memory. If you at- > tempt an 8-bit read or write there is no indication of error; instead > the board silently zeros the other byte of the 16-bit word. > > This causes quite a bit of problem, as you might guess when you re- > flect on it for a minute. Whenever the module is modified (fortunately, > it's now pretty stable), we have to investigate the code generated by > the compiler to verify that there are no byte reads or writes to the > board's memory. If there are, we have to figure out a way to trick the > compiler into not doing it. > > I consider this wildly unreasonable. My question is this: Are > there compilers, for any language, that give the user the ability to > subset the hardware instruction set used for a compilation? I don't > know of any and I've had experience with 20-30 compilers in my career. > Other people, particularly those in academic settings, might have seen > many more. It seems to me that if this board were a network device (for instance), no one would expect a compiler to handle the limitations it imposes. There are all sorts of hardware-related things you need to do at a hardware interface, and this is just one of them. The fact that it's memory-mapped is (IMHO) misleading you. You could write specific word-oriented access subprograms in assembler, perhaps. But what would you do if just _reading_ a word had an external effect? (not sure if this is possible in a VME world). OTOH. it would be most surprising if the compiler didn't handle writing Interfaces.C.short as a single operation, perhaps a mapping between your outer operations to a low-level interface in terms of shorts would do. keep a main-store copy of what is (should be) in card memory, in a fully-represented Ada structure overlaid on an array of shorts the green lamp is lit by clearing bit 6 of word 12 so type lamp_state is (on, off); light-the-green-lamp: set the green-lamp-state field in main memory to lamp_state'(on) ie 0 write the whole of word 12 to the card I think what you need to do in this sort of situation is to address the actual problem not what you would like it to be. (Sorry if that sounds po-faced, not trying to get at you) -- Simon Wright Work Email: simon.j.wright@amsjv.com Alenia Marconi Systems Voice: +44(0)23-9270-1778 Integrated Systems Division FAX: +44(0)23-9270-1800