comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic, 561.796.8997, M/S 731-96" <condicma@PWFL.COM>
Subject: Re: Should Representation Clauses be complete for each bit?
Date: 1998/04/17
Date: 1998-04-17T00:00:00+00:00	[thread overview]
Message-ID: <98041711295948@psavax.pwfl.com> (raw)


Stephen Leake <Stephen.Leake@GSFC.NASA.GOV> writes:
>Lowe Anthony A wrote:
>>
<snip>
>>     If my description is not too biased I think you can see that I am
>> leaning towards requiring each rep clause to be complete.   I am
>> interested on other takes on this issue for screaming benifits/costs
>> of either approach.
>
<snip>
>
>So I've adopted the general policy that all bits must be defined.
>
    I used to be of the mind that all bits should be defined as
    "Spare_xx" or something similar to make it clear which bits were
    undefined by hardware, etc. It had the advantage of making a
    change rather direct & simple if one of the spare bits suddenly
    comes into use.

    However, I've shifted my thinking on this. It is certainly less
    "cluttered" to avoid declaring unused bits. Also, it is less
    misleading. I have encountered code where the programmer declared
    all unused bits as "Spare" (or similar) only to discover later
    that there really were definitions for the bits in question - just
    that they were unused by this particular piece of code. One might
    have been tempted to appropriate the bits for something else. So
    if they are left completely undefined, someone else comming along
    later is not likely to make assumptions about the bits other than
    that they are not used by this application.

    One thing I do favor is this: Where you are using the rep clause
    to model something coming out of hardware or some external source,
    I find it a good idea to define all of the fields that are
    documented and do so with names as close to what appears in the
    document as is possible. This way it is explicit what bits the
    hardware is supposed to be setting/using, what bits the hardware
    does not care about (if its labeled "reserved" you probably want
    to declare it to make clear that the hardware *might* use those
    bits) and there is a clear mapping between what someone reads in
    the document and what they read in the code. The code may not use
    all the bits that are defined - and that's O.K. - but it is clear
    when reading the definition, why those bits exist.

    It would be nice to have a convention on this one way or the
    other.

    MDC

Marin David Condic, Senior Computer Engineer     Voice:     561.796.8997
Pratt & Whitney GESP, M/S 731-95, P.O.B. 109600  Fax:       561.796.4669
West Palm Beach, FL, 33410-9600                  Internet:  CONDICMA@PWFL.COM
=============================================================================
    "Because that's where they keep the money."
        --  Willie Sutton when asked why he robbed banks.
=============================================================================




             reply	other threads:[~1998-04-17  0:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-17  0:00 Marin David Condic, 561.796.8997, M/S 731-96 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-20 10:34 Should representation clauses be complete for each bit? okellogg
2011-07-20 14:51 ` Robert A Duff
2011-07-20 15:24   ` Georg Bauhaus
2011-07-20 17:28     ` Robert A Duff
2011-07-21  7:37       ` Martin
2011-07-21  8:22         ` Simon Wright
2011-07-21 14:58           ` Robert A Duff
2011-07-23  0:13             ` Randy Brukardt
2011-07-27 14:12               ` okellogg
2011-07-28  0:03                 ` Randy Brukardt
2011-07-21  9:43         ` Georg Bauhaus
2011-07-21 15:06           ` Robert A Duff
2011-07-31 15:02             ` BrianG
2011-07-21 21:11           ` Brian Drummond
2011-07-21  7:59     ` Stephen Leake
2011-07-20 15:29   ` okellogg
2011-07-20 16:24     ` Dmitry A. Kazakov
2011-07-20 16:58       ` okellogg
2011-07-20 19:38         ` Dmitry A. Kazakov
2011-07-20 17:27     ` Robert A Duff
2011-07-20 19:14       ` okellogg
2011-07-20 20:13         ` J-P. Rosen
2011-07-20 21:23           ` Robert A Duff
2011-07-20 21:21         ` Robert A Duff
2011-07-21  8:02         ` Stephen Leake
2011-07-21  8:00     ` Stephen Leake
2011-07-21  7:36   ` Martin
2011-07-22 23:50   ` Randy Brukardt
2011-07-23  2:16     ` tmoran
2011-07-23 15:12     ` Robert A Duff
2011-07-26 21:10       ` Randy Brukardt
2011-07-23  0:01   ` Randy Brukardt
     [not found] <3533C3C5.3F25CB91@cacd.rockwell.com>
1998-04-16  0:00 ` Should Representation Clauses " Stephen Leake
replies disabled

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