Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!vangogh.Berkeley.EDU!melvin
From: melvin@vangogh.Berkeley.EDU (Steve Melvin)
Newsgroups: comp.arch
Subject: Re: Cycle Counter
Summary: High resolution timers in Suns
Message-ID: <30642@ucbvax.BERKELEY.EDU>
Date: 15 Aug 89 08:52:35 GMT
References: 
Sender: usenet@ucbvax.BERKELEY.EDU
Reply-To: melvin@vangogh.Berkeley.EDU.UUCP (Steve Melvin)
Distribution: comp
Organization: University of California, Berkeley
Lines: 47

In article  grunwald@flute.cs.uiuc.edu writes:
>
>Hi,
>
>Another ``how much does this cost'' question.
>
>When doing performance monitoring, benchmarking or profiling, you want
>a high-resolution timer. Some systems have microsecond timers, and
>those are considered pretty snazzy; I know I was overjoyed when I
>found one on the Encore. Normal machines, e.g., a Sun, have about 5
>millisecond resolution. That's pathetic.

First, some clarification.  All Sun 3's and Sun 4's lack a high
resolution timer.  Sun 2's had them and SPARCstations have them.  In the
Sun 3's and Sun 4's there is a 10ms hardware interrupt which in SunOS
is ignored every other time to generate a 20ms interrupt for use by the
operating system.

Fortunately, however, Sun put sockets in these machines for data encryption
chips (the whole encryption chip story is interesting in itself).  Another
grad student here at Berkeley (Peter Danzig) and I have designed a small board
which plugs into these machines and allows a timer chip (being clocked at
4Mhz) to look like the encryption chip.  Then, with an appropriate device
driver installed, the software has access to high resolution time measurements
just as though the feature was built in.

Apparently, Sun at one time had intended to sell a data encryption option for
these machines.  The encryption chip provided for was the AMD Am9518 (which
implements the official data encryption standard (DES)).  In the 3/50 and 3/60,
all that was needed was to plug the chip in (and move a jumper in the case of
the 3/50) but in later models chips needed to drive the 9518 (one or two
PALs and a buffer) were not supplied on the motherboard.  The idea was
apparently dropped and as far as we know the DES option has never been made
available.  It probably had a lot to do with the Feds (the DES chip is
supposedly not allowed to be exported from the US).  Having the socket enabled
by a PAL may have had something to do with controlling the use of the DES
chip.

Anyway, I think the answer to your question is that these kinds of things
cost very little in hardware and don't slow anything down, but since they
don't tangibly affect the bottom line performance, they are often ignored by
hardware designers.

-------
Steve Melvin
...!ucbvax!melvin				melvin@polaris.Berkeley.EDU
-------