Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Sep 2000 17:04:56 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Darrell Anderson <anderson@cs.duke.edu>
Cc:        freebsd-alpha@freebsd.org
Subject:   Re: FreeBSD alpha cycle counter wackiness
Message-ID:  <14795.51314.262384.708418@grasshopper.cs.duke.edu>
In-Reply-To: <200009222028.QAA16630@cold.cs.duke.edu>
References:  <200009222028.QAA16630@cold.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

Darrell Anderson writes:
 > Can someone explain this cycle counter behavior to me?  The attached
 > program reads the cycle counter from userspace, spitting out cycle counter
 > values and deltas.
 > 
 > On x86, I see consistent deltas (~8000 cycles).  On alpha, I usually see a
 > reasonable delta (~6000 cycles), with occassional jumps (~2^64).  The jumps
 > appear at consistent intervals.  Sometimes there are long sequences where
 > every delta is a jump.  Before you tell me it's just wrapping, the delta is
 > ~2^56.  Deltas before and after the jumps seem quite reasonable.
 > 
 > Here is some sample output from a 500MHz XP1000.  I get similar results for
 > 4.0-RELEASE and 5.0-CURRENT.
 > 
 > 0xc5657103cc1d06a3 delta 0x1602
 > 0xc5657103cc1d1ae5 delta 0x1442
 > 0xc5657103cc1d2f41 delta 0x145c
 > 0xc5652696cc1d9bc3 delta 0xffffb59300006c82

According to the green book, section (I:3.1.5), the PCC (Processor
Cycle Counter) register consists of 2 32-bit fields.  The lower
32-bits is a wrapping, unsigned 32-bit counter.  The high-order bits
are OS dependent.

I don't think FreeBSD does anything to set up the high-order 32-bits,
so it is likely that they're just garbage.

So just use the lower 32-bits & watch for wraps.

Drew



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14795.51314.262384.708418>