home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!spool.mu.edu!umn.edu!The-Star.honeywell.com!saifr00.cfsat.honeywell.com!hawkinsg
- From: hawkinsg@saifr00.cfsat.honeywell.com (Glenn Hawkins)
- Subject: Basic embedded concepts and Ada
- Message-ID: <1993Jan6.022544.15622@saifr00.cfsat.honeywell.com>
- Organization: Honeywell Air Transport Systems Division
- Distribution: comp.lang.ada
- Date: Wed, 6 Jan 93 02:25:44 GMT
- Lines: 48
-
- Howdy!
-
- I have some REALLY basic embedded software design questions pertaining to Ada.
- Although I've got embedded programming experience (mainly in JOVIAL), I've never
- written anything so down-in-the-guts-of-the-hardware before. All of my Ada
- experience is in non-embedded applications, so if some of these questions seem
- really stupid, I apologize in advance...
-
- I'm in the middle of writing a device driver in Ada targeted to the AMD 29050.
- The interface hardware is somewhat complicated, with all sorts of odd-sized
- status registers, control registers, etc. to assist the software in BIT
- and other hardware manipulations. They are all laid out in a memory map, so I've
- already figured out that I need to "tie" the addresses of the objects representing
- these registers to the addresses specified in the memory map using rep specs.
- As a novice at this sort of thing, that wasn't immediately obvious to me :(.
-
- I think that to set bits in these registers it would be easiest for
- me to define the objects representing the registers as 32-bit integers, allowing
- me to simply add constants (1, 2, 4, 8, etc.) representing the different bits
- I want to set. Just like I would in JOVIAL, C, etc. Although our compiler is
- pretty efficient with word and byte level accesses, it pretty much chokes on bit
- level accesses, so representing the different registers as records of bits
- (appropriately rep spec'ed, of course) doesn't seem practical. I'm sure many
- of you have successfully solved this problem. Does my approach make sense?
- Are there any Ada-unique gotchas here?
-
- Seeing if a bit has been set seems more difficult. All the approaches I've looked
- at so far (multiplying by constants to simulate shifts, etc.) seem to be REALLY
- messy, since I'm used to using shifts, ANDs, etc. to isolate "bits of
- interest". I would like to avoid machine code insertions if possible. Any ideas?
-
- Question: Will shifts, ANDs, ORs, etc be available in Ada 9x?
-
- For my own edification, why aren't these types of things available now, since Ada
- was in part designed for embedded systems programming? I really like Ada, but at
- first glance it seems as if the old girl is a bit deficient in this area...
-
- Please respond via e-mail, unless you think it's of general interest to the net.
- Any help will be greatly appreciated...
-
- My opinions are my own.
-
- Glenn Hawkins -- "hawkinsg@saifr00.cfsat.honeywell.com"
- Senior Project Engineer
- Boeing 777 ACMF
- Honeywell ATSD
- Phoenix, Az
-
-