Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Architectures and PSIM
@ 2002-08-12 10:17 Ron McCall
  2002-08-12 10:38 ` Elena Zannoni
  0 siblings, 1 reply; 4+ messages in thread
From: Ron McCall @ 2002-08-12 10:17 UTC (permalink / raw)
  To: GDB Mailing List

Hi,

I am having trouble getting PSIM to simulate a 603e processor (operating
environment).  With the device tree shown below, I can execute
privileged instructions so I am in the operating environment but I
cannot access any of the OEA registers (and it is trying to read AltiVec
registers which comes up with an error).  Here is what I have done:

First, I built and installed gdb 5.2.1 as follows:

bash$ ../gdb-5.2.1/configure --prefix=/opt/gcc-ppc-3.1.1
--build=sparc-sun-solaris2.8 --host=sparc-sun-solaris2.8
--target=powerpc-eabi --enable-sim-powerpc
bash$ make
bash# make install

Next, I created a device tree in a file named psim.tree as follows (note
the specification of the 603e processor and operating mode):

/openprom/init/register/msr 0x40
/openprom/init/register/sp 0x100000
/openprom/trace/dump-device-tree 0x0
/openprom/options/env "operating"
/openprom/options/model "603e"
/openprom/options/oea-interrupt-prefix 0x1
/openprom/vm/stack-base 0xf0000
/openprom/vm/nr-bytes 0x10000

Next, I load my bare board executable as follows:

$ powerpc-eabi-gdb main.elf
(gdb) target sim -f psim.tree
(gdb) load main.elf
(gdb) break main
(gdb) run
(gdb) info all-registers
r0             0xfff03324   -1035484
r1             0xfffa4  1048484
r2             0x8da8   36264
r3             0xda4    3492
r4             0xe9c    3740
r5             0x8894   34964
r6             0xea0    3744
r7             0xea4    3748
r8             0x8  8
r9             0xd90    3472
r10            0x144    324
r11            0x8cc    2252
r12            0x0  0
r13            0x8868   34920
r14            0x0  0
r15            0x0  0
r16            0x0  0
r17            0x0  0
r18            0x0  0
r19            0x0  0
r20            0x0  0
r21            0x0  0
r22            0x0  0
r23            0x0  0
r24            0x0  0
r25            0x0  0
r26            0x0  0
r27            0x0  0
r28            0x0  0
r29            0x0  0
r30            0x0  0
r31            0xfffa4  1048484
f0             0    (raw 0x0000000000000000)
f1             0    (raw 0x0000000000000000)
f2             0    (raw 0x0000000000000000)
f3             0    (raw 0x0000000000000000)
f4             0    (raw 0x0000000000000000)
f5             0    (raw 0x0000000000000000)
f6             0    (raw 0x0000000000000000)
f7             0    (raw 0x0000000000000000)
f8             0    (raw 0x0000000000000000)
f9             0    (raw 0x0000000000000000)
f10            0    (raw 0x0000000000000000)
f11            0    (raw 0x0000000000000000)
f12            0    (raw 0x0000000000000000)
f13            0    (raw 0x0000000000000000)
f14            0    (raw 0x0000000000000000)
f15            0    (raw 0x0000000000000000)
f16            0    (raw 0x0000000000000000)
f17            0    (raw 0x0000000000000000)
f18            0    (raw 0x0000000000000000)
f19            0    (raw 0x0000000000000000)
f20            0    (raw 0x0000000000000000)
f21            0    (raw 0x0000000000000000)
f22            0    (raw 0x0000000000000000)
f23            0    (raw 0x0000000000000000)
f24            0    (raw 0x0000000000000000)
f25            0    (raw 0x0000000000000000)
f26            0    (raw 0x0000000000000000)
f27            0    (raw 0x0000000000000000)
f28            0    (raw 0x0000000000000000)
f29            0    (raw 0x0000000000000000)
f30            0    (raw 0x0000000000000000)
f31            0    (raw 0x0000000000000000)
pc             0xfff03324   -1035484
ps             0x40 64
cr             0x28200000   673185792
lr             0xfff03324   -1035484
ctr            0x0  0
xer            0x0  0
---Type <return> to continue, or q <return> to quit---
vr0            psim_read_register() invalid register name `vr0'

(gdb) info reg hid0
hid0: invalid register
(gdb) show architecture
The target architecture is set automatically (currently powerpc:common)
(gdb) set architecture
Requires an argument. Valid arguments are rs6000:6000, rs6000:rs1,
rs6000:rsc, rs6000:rs2, powerpc:common, auto.

Note that I don't get any choices of PowerPC besides common although I
see support for the 403, 403GC, 505, 860/850, 601, 602, 603/603e,
604/604e, 750/740 and 7400 in gdb/rs6000-tdep.c.

I have also tried adding the --with-cpu=603e option to configure but
that didn't seem to change anything.  Can anyone tell me what I am doing
wrong?

Thanks!

Ron McCall


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Architectures and PSIM
  2002-08-12 10:17 Architectures and PSIM Ron McCall
@ 2002-08-12 10:38 ` Elena Zannoni
  2002-08-12 10:43   ` Ron McCall
  0 siblings, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2002-08-12 10:38 UTC (permalink / raw)
  To: Ron McCall; +Cc: GDB Mailing List

Ron McCall writes:
 > Hi,
 > 
 > I am having trouble getting PSIM to simulate a 603e processor (operating
 > environment).  With the device tree shown below, I can execute
 > privileged instructions so I am in the operating environment but I
 > cannot access any of the OEA registers (and it is trying to read AltiVec
 > registers which comes up with an error).  Here is what I have done:
 > 
 > First, I built and installed gdb 5.2.1 as follows:
 > 
 > bash$ ../gdb-5.2.1/configure --prefix=/opt/gcc-ppc-3.1.1
 > --build=sparc-sun-solaris2.8 --host=sparc-sun-solaris2.8
 > --target=powerpc-eabi --enable-sim-powerpc
 > bash$ make
 > bash# make install
 > 
 > Next, I created a device tree in a file named psim.tree as follows (note
 > the specification of the 603e processor and operating mode):
 > 
 > /openprom/init/register/msr 0x40
 > /openprom/init/register/sp 0x100000
 > /openprom/trace/dump-device-tree 0x0
 > /openprom/options/env "operating"
 > /openprom/options/model "603e"
 > /openprom/options/oea-interrupt-prefix 0x1
 > /openprom/vm/stack-base 0xf0000
 > /openprom/vm/nr-bytes 0x10000
 > 
 > Next, I load my bare board executable as follows:
 > 
 > $ powerpc-eabi-gdb main.elf
 > vr0            psim_read_register() invalid register name `vr0'
 > 
 > (gdb) info reg hid0
 > hid0: invalid register
 > (gdb) show architecture
 > The target architecture is set automatically (currently powerpc:common)
 > (gdb) set architecture
 > Requires an argument. Valid arguments are rs6000:6000, rs6000:rs1,
 > rs6000:rsc, rs6000:rs2, powerpc:common, auto.
 > 
 > Note that I don't get any choices of PowerPC besides common although I
 > see support for the 403, 403GC, 505, 860/850, 601, 602, 603/603e,
 > 604/604e, 750/740 and 7400 in gdb/rs6000-tdep.c.
 > 

I am no expert on the uses of psim, so I cannot really help with the
device tree, etc. But....

I have seen the behavior above, (gdb not listing the correct set of
available architectures), could you try the current cvs main line
instead?

Note that psim will not digest a connection from gdb *after* the
architecture has been explicitly set by the set architecture
command. You should first connect, then change the architecture.

There are 2 patches that I committed to main trunk gdb and I don't think
were included in 5.2.1:

this one stops psim from complaining about lack of altivec registers:
http://sources.redhat.com/ml/gdb-patches/2002-04/msg00535.html

this one makes psim understand the architecture parameter set by gdb
before connection:
http://sources.redhat.com/ml/gdb-patches/2002-06/msg00305.html

Elena

 > I have also tried adding the --with-cpu=603e option to configure but
 > that didn't seem to change anything.  Can anyone tell me what I am doing
 > wrong?
 > 
 > Thanks!
 > 
 > Ron McCall


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Architectures and PSIM
  2002-08-12 10:38 ` Elena Zannoni
@ 2002-08-12 10:43   ` Ron McCall
  2002-08-12 11:51     ` Ron McCall
  0 siblings, 1 reply; 4+ messages in thread
From: Ron McCall @ 2002-08-12 10:43 UTC (permalink / raw)
  To: GDB Mailing List

Sure, I will give the latest cvs version a try and will report back the
results.  Thanks!

Ron McCall

On Mon, Aug 12, 2002 at 01:36:14PM -0400, Elena Zannoni wrote:
> I am no expert on the uses of psim, so I cannot really help with the
> device tree, etc. But....
> 
> I have seen the behavior above, (gdb not listing the correct set of
> available architectures), could you try the current cvs main line
> instead?
> 
> Note that psim will not digest a connection from gdb *after* the
> architecture has been explicitly set by the set architecture command.
> You should first connect, then change the architecture.
> 
> There are 2 patches that I committed to main trunk gdb and I don't
> think were included in 5.2.1:
> 
> this one stops psim from complaining about lack of altivec registers:
> http://sources.redhat.com/ml/gdb-patches/2002-04/msg00535.html
> 
> this one makes psim understand the architecture parameter set by gdb
> before connection:
> http://sources.redhat.com/ml/gdb-patches/2002-06/msg00305.html
> 
> Elena


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Architectures and PSIM
  2002-08-12 10:43   ` Ron McCall
@ 2002-08-12 11:51     ` Ron McCall
  0 siblings, 0 replies; 4+ messages in thread
From: Ron McCall @ 2002-08-12 11:51 UTC (permalink / raw)
  To: GDB Mailing List

Elena,

Looks like the latest CVS version works!  I did the following:

bash$ powerpc-eabi-gdb main.elf
(gdb) target sim -f psim.tree
(gdb) set architecture powerpc:603
(gdb) load main.elf
(gdb) break main
(gdb) run
(gdb) info all-registers

At this point, I see r0-r31, f0-f31, pc, ps, cr, lr, ctr, xer, fpscr,
sr0-sr15, pvr, ibat0u-ibat3u, ibat0l-ibat3l, dbat0u-dbat3u,
ibat0l-ibat3l, sdr1, dar, dsisr, sprg0-sprg3, srr0, srr1, tbl, tbu, dec,
dadr, ear, hid0, hid1, iabr, dmiss, dcmp, hash1, hash2, imiss, icmp and
rpa.  This is exactly what I needed.  Thank you so much for the tip!

Ron McCall

On Mon, Aug 12, 2002 at 01:43:41PM -0400, Ron McCall wrote:
> Sure, I will give the latest cvs version a try and will report back the
> results.  Thanks!
> 
> Ron McCall
> 
> On Mon, Aug 12, 2002 at 01:36:14PM -0400, Elena Zannoni wrote:
> > I am no expert on the uses of psim, so I cannot really help with the
> > device tree, etc. But....
> > 
> > I have seen the behavior above, (gdb not listing the correct set of
> > available architectures), could you try the current cvs main line
> > instead?
> > 
> > Note that psim will not digest a connection from gdb *after* the
> > architecture has been explicitly set by the set architecture command.
> > You should first connect, then change the architecture.
> > 
> > There are 2 patches that I committed to main trunk gdb and I don't
> > think were included in 5.2.1:
> > 
> > this one stops psim from complaining about lack of altivec registers:
> > http://sources.redhat.com/ml/gdb-patches/2002-04/msg00535.html
> > 
> > this one makes psim understand the architecture parameter set by gdb
> > before connection:
> > http://sources.redhat.com/ml/gdb-patches/2002-06/msg00305.html
> > 
> > Elena

-- 
Ron McCall
Sikorsky Aircraft
203-386-4695
rmccall@sikorsky.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-08-12 18:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-12 10:17 Architectures and PSIM Ron McCall
2002-08-12 10:38 ` Elena Zannoni
2002-08-12 10:43   ` Ron McCall
2002-08-12 11:51     ` Ron McCall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox