Re: [Gems-users] Using Magic Instruction on sparc64-linux


Date: Sun, 19 Mar 2006 21:18:03 -0800
From: Gene Kishinevsky <genek@xxxxxxxxxxxx>
Subject: Re: [Gems-users] Using Magic Instruction on sparc64-linux
Thanks a lot to everyone for the responses. Replacing __sparc with __sparc__ in magic-instruction.h file and inserting MAGIC(4 << 16) into the benchmark code did the trick!

-Gene

Kevin Moore wrote:
Just a quick followup to Dan's comment. Simics will only break execution on one specific value: (4 << 16). Other arguments can be detected by simics callbacks (see ruby/commands.C), but will not stop the simulation.

--Kevin


On Mar 19, 2006, at 9:54 AM, Dan Gibson wrote:

Gene,

Your problem seems to be related to Simics. To my knowledge, we have
only used Simics with the sarek (sparc/solaris) target, and you
mentioned you are using bagel. Since bagel is a sparc machine, I'm
surprised that the __sparc symbol was undefined. You might try passing
-D__sparc to your compiler to force the symbol to be defined, but I am
not clear as to whether the magic breakpoint interface is the same for
bagel as for sarek.

As I look the the magic-instruction.h file provided with Simics 2.2.19,
I notice that they intend to use "sethi 'n' %g0" as a magic breakpoint,
where n is an integer greater than zero. You might try using '1' rather
than '0' in your example program below and see if that works.

In the past, I know there have been some reordering concerns with magic
breakpoints as well. Optimizing compilers may reorder or remove
instructions--try compiling without optimiziations if you have them enabled.

I also would suggest you have a look at the Simics documentation, and/or
the Simics website (www.simics.net).

Regards,
Dan

Gene Michael Kishinevsky wrote:

Hi all,

We've tried using the magic instruction today on our simulated system with no success. We're using the bagle system provided by Simics, which is a sun sparc64 machine with linux on it. I used the magic-breakpoint-enable command in Simics and then ran my simple program on the simulated machine. However, we never got the simulation to stop. We tried changing the instructions around and even using the magic-instruction.h library definition instead of our own. When using the library we got an "unsupported architecture" error
from the following section of code in the magic library.

#else  /* !__sparc && !__i386 && !__powerpc__ */
#error "Unsupported architecture"
#endif /* !__sparc && !__i386 && !__powerpc__ */

I've included our test program below. If anyone has any suggestions we'd be
very grateful.

Thanks a lot.

-Gene


#include <stdio.h>
//#include "magic-instruction.h"

#define MAGIC_INSTRUCTION do {    \
  __asm__ __volatile__ ("sethi 0, %g0");  \
} while (0)

main() {
 printf("Hello world.");
 MAGIC_INSTRUCTION;
 printf("After magic I should have stoppped!");
}

_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users



_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users

_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
[← Prev in Thread] Current Thread [Next in Thread→]