PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Does the XScale have performance counters we can access?

On other machines I've worked on, I can clear/read performance counters (basically data inside the cpu that counts the num of instructions executed, or cache misses, or cache reloads, etc).

Does the XScale have something like this we can use to profile a bit easier? I'd love to make a highfrequency interupt based profiler to test some of my code....I wrote one for PS2 a few years ago and it saved me loads of profiling time.
I think your best bet for things like that would be intel's white papers. Theres a detailed CPU manual somewhere on the site...
The chip does have the counters you're referring to. The XScale version of VTune can access them.
There are a lot of perfomance counters. If you have experiences with the pentium (and higher) processors you'll find a lot of familiar registers and counters. The XScale / StrongArm documents list them all, and they give all the information how to access them (it's just a coprocessor register).

However, all my tries to access them failed. I never got it working. My personal goal is still to use the mini-cache and speed up my palette lookups. Learning how to access the counters was my try to get started. It ought to be easy, but it's not.

Honestly, it's a shame that we have such a great feature in the cpu, but we can't use it. How dumb is that.

Anyway, for some reason it just does not work. I don't get access violations, I just get values that don't make *any* sense to me. Most probably I don't have the correct privilegies to access those registers as I execute vanilla user-mode programs, but I would expect at least an exception if I try to access them.

If anyone knows how to access those, please post and help us out.
Two minutes with Google found this:

http://www.intel.com/design/iio/applnots/27366103.pdf
Yes.. That's old news.

There are a lot of pdfs that show the register layout, but:


This paper assumes a development environment has already been setup consisting of an IntelĀ® IQ80310 Evaluation Platform Board (IQ80310) or IntelĀ® IQ80321
Evaluation Platform Board (IQ80321) and a development system with GNUPro* installed, as well
as downloading, running and debugging the hello world sample program with GDB*.


I doubt that a real OS is running on the evaluation boards, and I'm pretty sure that WinCE somehow intercepts all our attempts to acceess those registers.
Some registers can only be read/written from within a privileged CPU mode (ie. Interrupt mode). An example of this are the registers controlling the cache (flush/invalidate/clean). You do not get an exception when accesing these registers from user mode, it just does not work.

Tala