comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <mcondic.auntie.spam@acm.org>
Subject: Re: Duration vs. Ada.Real_Time
Date: Mon, 29 Jan 2001 13:40:29 -0500
Date: 2001-01-29T18:40:05+00:00	[thread overview]
Message-ID: <3A75B91C.654A86EE@acm.org> (raw)
In-Reply-To: 954074$qpq$1@nnrp1.deja.com

Ted Dennison wrote:

> Hmmm. Now it sounds like you are talking about frequency vs.
> "resolution". :-)  When you say "accuracy", I think of things like clock
> drift. I'm currently dealing with networked realtime systems. Thus I've
> had problems associated with both the clock frequenceies and with the
> clock accuracy (clock drift between two machines that are trying to
> operate in lock-step).
>

Yes, drift and all that. I think we're really splitting hairs on this when I
think basically, we're talking the same thing. There are lots of ways a
clock can be inaccurate, right?

BTW: I've asked before when I was dealing with that same situation - two
machines that want to operate in lockstep. Do you know of any sort of
formal, published writings on algorithms to do this? We had a 1.024mSec
interrupt on both sides - no clock so no "delay until" - and some hardware
signalling between the two. We came up with ways of doing the sync, but I
kept thinking in the back of my mind that better/faster/easier ways of doing
it. Not horribly important now since I'm not dealing with that same problem,
but it has always bothered me enough to still want to read some books/papers
on the subject.

> GreenHills on vxWorks (x86 at least) uses a record type. The units of
> the smallest field are in microseconds. Thus if the frequency divides
> evenly into micros, you're OK.
>

That may be the internal representation they keep of the current time.
Somewhere there is some underlying hardware register or port or memory
address or something that when interrogated, gives you a collection of bits
that represents time from some epoc that is either a) scaled integer or b)
floating point (never seen a floating point - maybe you have?) If it is a
scaled integer (LSB represents One Fortnight?) If that's the case, there is
an exact representation as a fixed point type.

>
> However, I don't see how an Ada vendor could arrive at a good number
> ahead of time. Your best bet is probably to just use some ridiculously
> high resolution like Green Hills did. The frequency on vxWorks is
> something that can be changed by programs on the fly. Our (Ada) system

Why does the Ada vendor have to determine this "ahead of time"? What do you
mean? Lets say you are targeting board X which is either going to have some
standard clock fixture that always goes with boards of type X, or you are
going to have some custom one-off board where maybe the processor is common,
but everything else is rather unusual. If it is case one, the Ada
implementation uses that standard issue clock that is always on boards of
type X. (Seen that before with 1750a - it had two standard clocks - take
your pick.) If it is case two, you're going to have to provide some low
level packages that can be tailored to identify the time source, etc. and be
recompiled for that target. (Couldn't you have type Duration end-user
configurable? How else would you retarget?)

Sure the type two situation almost certainly blows your validation, but so
what? The vendor validates the compiler on some specific board with some
specific clock that supports the 0.020Sec requirement and that's that. The
end user has a similar board but a different clock? Hey! Once you break the
sticker on the case that says "Caution: No user servicable parts inside" -
the validation is null and void. Does anybody care? (Maybe the Military did
at one point in time - but if they don't require Ada, I can't see how they
could require *validated* Ada. Just rename the language and scratch out the
requirements you don't support, right? :-) Call it Bda?



>
> reads the requested frequency from a configuration file and sets it at
> startup. The default frequency is 60Hz. We have one system that uses the
> default, one that sets it at 240Hz, and one that sets it at 1,000Hz.
> With PC's getting faster all the time, I wouldn't be shocked to see
> folks wanting to use multiple KHz. Microseconds might even be too coarse
> by the end of the decade!

Well, O.K. here you are describing a situation where you are getting time
from a particular OS and you can't do much to change that. This is the same
as if you were getting it from Unix and you can't do anything about the
accuracy. I'd put this in the category of "impractical to have Duration
reflect the clock" category.

Its a little different if you are trying to implement your own vxWorks in
Ada and have direct contact with the hardware.

MDC
--
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================





  reply	other threads:[~2001-01-29 18:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <980495512.529981@edh3>
     [not found] ` <8mac6.9236$R5.473526@news1.frmt1.sfba.home.com>
2001-01-26 15:30   ` Duration vs. Ada.Real_Time Robert Dewar
     [not found] ` <3A71814B.7E8CCF60@acm.org>
2001-01-26 15:33   ` Robert Dewar
2001-01-26 20:58     ` Marin David Condic
2001-01-26 21:32       ` Ted Dennison
2001-01-27  5:01         ` Keith Thompson
2001-01-27 14:40           ` Marin David Condic
2001-01-27 14:34         ` Marin David Condic
2001-01-28  0:18           ` Robert Dewar
2001-01-29 14:54           ` Ted Dennison
2001-01-29 18:40             ` Marin David Condic [this message]
2001-02-08  3:32               ` Buz Cory
2001-02-08 15:34                 ` Marin David Condic
2001-02-10  3:08                   ` Steve Whalen
2001-01-28  0:13       ` Robert Dewar
2001-01-29 14:02         ` Marin David Condic
2001-01-30 14:33         ` Stephen Leake
2001-01-31 14:55           ` Marin David Condic
2001-01-31 16:03           ` Ted Dennison
2001-01-31 19:16             ` Marin David Condic
2001-01-31 20:53               ` Ted Dennison
2001-01-31 21:30                 ` tmoran
2001-01-31 21:47                 ` Marin David Condic
2001-02-01 14:18                   ` Ted Dennison
2001-01-28 19:32 ` Simon Wright
2001-01-31  6:13   ` Robert Dewar
2001-01-31 15:07     ` Marin David Condic
2001-02-01  5:43       ` Robert Dewar
2001-01-31  5:51 Christoph Grein
2001-02-01  6:27 ` Simon Wright
replies disabled

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