* powerpc simulator questions
@ 2001-11-01 15:25 Vermeulen Jan
2001-11-01 16:30 ` Andrew Cagney
2001-11-01 16:43 ` Frank Ch. Eigler
0 siblings, 2 replies; 6+ messages in thread
From: Vermeulen Jan @ 2001-11-01 15:25 UTC (permalink / raw)
To: 'gdb@sources.redhat.com'
Hello everybody,
I'm already subscribed to the crossgcc list for some time now, so i thought
"why not venture into the gdb-world as well?" :)
I noticed that you have the option of stepping through your code by means of
a simulator. Whoever invented that: hats off :) It's really usefull. (if i
ever get it working... hehe)
However, being a complete n00b on the gdb-topic, I compiled/installed
Insight-5.0 with the "--target=powerpc-eabi" option.
I made a little test program, called 'destest' which simply encrypts and
decrypts an 8 byte value. No include files are used, there is only destest.c
I compiled it with "powerpc-eabi-gcc -g -Wl,-Tmylink.ld -o destest
destest.c".
mylink.ld:
OUTPUT_ARCH(powerpc) /* Specify the output machine architecture */
ENTRY(main);
/*
MEMORY
{
vects (rx): ORIGIN = 0x0, LENGTH = 1023
rom1 (rx): ORIGIN = 0x400, LENGTH= 511K
ramcode (rwx): ORIGIN = 0x800000, LENGTH = 2048K
ramdata (rw): ORIGIN = 0x0A00000, LENGTH = 2048K
}
*/
SECTIONS {
. = 0x0;
.vector0 :
{
LONG(ABSOLUTE( main ))
}
. = 0x400;
.text :
{
*(.text)
}
. = 0xA00000;
.data :
{
*(.data)
}
.bss :
{
*(.bss)
end = ALIGN(0x8);
}
}
Then i ran insight, did "target sim", "load" and it spit out something like
/openprom/init/load-binary: broken transfer.
I have no clue as to what's going on.
I first made the directory 'openprom' under root, but i have a hunch that's
not really what i should be doing. My guess is that /openprom is something
in memory being used by powerpc-eabi-gdb.
Can anybody help me? Or point me to a HOWTO/FAQ/manual?
I read the gdb manual and the psim manual, but no real step-by-step
(holding-the-newbie's-hand) procedure is explained there. :-)
Thank you in advance,
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc simulator questions
2001-11-01 15:25 powerpc simulator questions Vermeulen Jan
@ 2001-11-01 16:30 ` Andrew Cagney
2001-11-01 16:43 ` Frank Ch. Eigler
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2001-11-01 16:30 UTC (permalink / raw)
To: Vermeulen Jan; +Cc: 'gdb@sources.redhat.com'
> OUTPUT_ARCH(powerpc) /* Specify the output machine architecture */
>
> ENTRY(main);
>
> /*
> MEMORY
> {
> vects (rx): ORIGIN = 0x0, LENGTH = 1023
> rom1 (rx): ORIGIN = 0x400, LENGTH= 511K
> ramcode (rwx): ORIGIN = 0x800000, LENGTH = 2048K
> ramdata (rw): ORIGIN = 0x0A00000, LENGTH = 2048K
> }
> */
>
> SECTIONS {
> . = 0x0;
> .vector0 :
> {
> LONG(ABSOLUTE( main ))
> }
> . = 0x400;
> .text :
> {
> *(.text)
> }
> . = 0xA00000;
> .data :
> {
> *(.data)
> }
> .bss :
> {
> *(.bss)
> end = ALIGN(0x8);
> }
> }
>
> Then i ran insight, did "target sim", "load" and it spit out something like
> /openprom/init/load-binary: broken transfer.
That sounds like a lack of memory.
Try ``target sim -t print-device-tree''. It will dump out a heap of
info. At the bottom should be something like:
/memory@0/reg 0 0x100000
which indicates 1mb of ram at address zero. Your program looks to be
loading at 0x800000.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc simulator questions
2001-11-01 15:25 powerpc simulator questions Vermeulen Jan
2001-11-01 16:30 ` Andrew Cagney
@ 2001-11-01 16:43 ` Frank Ch. Eigler
1 sibling, 0 replies; 6+ messages in thread
From: Frank Ch. Eigler @ 2001-11-01 16:43 UTC (permalink / raw)
To: Vermeulen Jan; +Cc: 'gdb@sources.redhat.com'
Vermeulen Jan <Jan.Vermeulen@siemens.atea.be> writes:
: [...]
: However, being a complete n00b on the gdb-topic, I compiled/installed
: Insight-5.0 with the "--target=powerpc-eabi" option.
:
: I made a little test program, called 'destest' which simply encrypts and
: decrypts an 8 byte value. No include files are used, there is only destest.c
:
: I compiled it with "powerpc-eabi-gcc -g -Wl,-Tmylink.ld -o destest
: destest.c".
:
: mylink.ld:
: [...]
: MEMORY
: {
: vects (rx): ORIGIN = 0x0, LENGTH = 1023
: rom1 (rx): ORIGIN = 0x400, LENGTH= 511K
: ramcode (rwx): ORIGIN = 0x800000, LENGTH = 2048K
: ramdata (rw): ORIGIN = 0x0A00000, LENGTH = 2048K
: }
: [...]
There are probably several problems in the details, but the main one
is that the target memory layout used by your linked powerpc program
does not match that simulated by psim ("target sim" in powerpc gdb).
Why did you use a custom linker script? Try building your program with
powerpc-eabi-gcc -msim FOO.c -o FOO.x
and running it with
powerpc-eabi-run FOO.x # to run under the stand-alone simulator
#or powerpc-eabi-gdb FOO.x # then "target sim", etc.
- FChE
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc simulator questions
2001-11-02 18:33 Vermeulen Jan
@ 2001-11-27 20:39 ` Andrew Cagney
2001-11-18 11:45 ` Andrew Cagney
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2001-11-27 20:39 UTC (permalink / raw)
To: Vermeulen Jan; +Cc: 'gdb@sources.redhat.com'
> Hey,
>
> Thanks for the suggestions.
> It was indeed the memorymap that went haywire. (or the author :)
>
> I managed to debug/simulate my code. Very nice.
>
> Just one more question:
> with powerpc-eabi-run, i can see how many cycles have passed for the
> program.
>
> 1) if I want to know how long it would take on a 200MHz powerpc (and the
> routine takes about 35e6 cycles), then am i correct to use this formula :
> 35e6 cycles / 200e6 Mhz = 175 milliseconds ?
>
> 2) is the same type of performance measuring in the simulator under gdb?
> for example: breakpoint before a routine, breakpoint after one, and then a
> command "give me number of cycles passed between those 2 breakpoints
> (please)."
I wouldn't take the profile statistics too seriously. No one ever sat
down and analized them (Er, there might have been one report to only
indicate that they were way out :-/). I should probably delete that
code (so no one is mis-lead). It is also known to go into infinite
loops :-(
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: powerpc simulator questions
2001-11-27 20:39 ` Andrew Cagney
@ 2001-11-18 11:45 ` Andrew Cagney
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2001-11-18 11:45 UTC (permalink / raw)
To: Vermeulen Jan; +Cc: 'gdb@sources.redhat.com'
> Hey,
>
> Thanks for the suggestions.
> It was indeed the memorymap that went haywire. (or the author :)
>
> I managed to debug/simulate my code. Very nice.
>
> Just one more question:
> with powerpc-eabi-run, i can see how many cycles have passed for the
> program.
>
> 1) if I want to know how long it would take on a 200MHz powerpc (and the
> routine takes about 35e6 cycles), then am i correct to use this formula :
> 35e6 cycles / 200e6 Mhz = 175 milliseconds ?
>
> 2) is the same type of performance measuring in the simulator under gdb?
> for example: breakpoint before a routine, breakpoint after one, and then a
> command "give me number of cycles passed between those 2 breakpoints
> (please)."
I wouldn't take the profile statistics too seriously. No one ever sat
down and analized them (Er, there might have been one report to only
indicate that they were way out :-/). I should probably delete that
code (so no one is mis-lead). It is also known to go into infinite
loops :-(
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: powerpc simulator questions
@ 2001-11-02 18:33 Vermeulen Jan
2001-11-27 20:39 ` Andrew Cagney
0 siblings, 1 reply; 6+ messages in thread
From: Vermeulen Jan @ 2001-11-02 18:33 UTC (permalink / raw)
To: 'gdb@sources.redhat.com'
Hey,
Thanks for the suggestions.
It was indeed the memorymap that went haywire. (or the author :)
I managed to debug/simulate my code. Very nice.
Just one more question:
with powerpc-eabi-run, i can see how many cycles have passed for the
program.
1) if I want to know how long it would take on a 200MHz powerpc (and the
routine takes about 35e6 cycles), then am i correct to use this formula :
35e6 cycles / 200e6 Mhz = 175 milliseconds ?
2) is the same type of performance measuring in the simulator under gdb?
for example: breakpoint before a routine, breakpoint after one, and then a
command "give me number of cycles passed between those 2 breakpoints
(please)."
Thanks once again,
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-11-28 4:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-01 15:25 powerpc simulator questions Vermeulen Jan
2001-11-01 16:30 ` Andrew Cagney
2001-11-01 16:43 ` Frank Ch. Eigler
2001-11-02 18:33 Vermeulen Jan
2001-11-27 20:39 ` Andrew Cagney
2001-11-18 11:45 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox