public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* lm32 simulator configuration file question
@ 2015-04-02 22:19 Joel Sherrill
  2015-04-03  1:41 ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Sherrill @ 2015-04-02 22:19 UTC (permalink / raw)
  To: gdb

Hi

RTEMS has a BSP for the lm32 which runs on the simulator in gdb.
Based on our wrapper scripts and READMEs, this is how the simulator
is invoked in gdb:

tar sim --hw-device lm32cpu \
  --hw-device "lm32uart/reg 0x80006000 0x100" \
  --hw-device "/lm32uart > int int0 /lm32cpu" \
  --hw-device "lm32timer/reg 0x80002000 0x80" \
  --hw-device "/lm32timer > int int1 /lm32cpu" \
  --memory-region 0x08000000,0x4000000
load

That works great. When we use lm32-rtems4.11-run, you are supposed
to provide a hw description file matching those arguments.  This is
the file we are using:

======================
lm32cpu
lm32uart/reg 0x80006000 0x100
/lm32uart > int int0 /lm32cpu
lm32timer/reg 0x80002000 0x80
/lm32timer > int int1 /lm32cpu
memory-region  0x08000000,0x4000000
======================

This is the invocation and error message:

$ lm32-rtems4.11-run --hw-file lm32_evr.conf hello/hello.exe
/lm32uart: Missing "reg" property
Quit Simulator

Based on what our notes and scripts which I thought worked at one
point indicate, that should work but I just don't see the error.

Since this is based on code in common/, can someone provide some
insight?

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

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

* Re: lm32 simulator configuration file question
  2015-04-02 22:19 lm32 simulator configuration file question Joel Sherrill
@ 2015-04-03  1:41 ` Mike Frysinger
  2015-04-03 20:21   ` Joel Sherrill
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2015-04-03  1:41 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

On 02 Apr 2015 17:19, Joel Sherrill wrote:
> RTEMS has a BSP for the lm32 which runs on the simulator in gdb.
> Based on our wrapper scripts and READMEs, this is how the simulator
> is invoked in gdb:
> 
> tar sim --hw-device lm32cpu \
>   --hw-device "lm32uart/reg 0x80006000 0x100" \
>   --hw-device "/lm32uart > int int0 /lm32cpu" \
>   --hw-device "lm32timer/reg 0x80002000 0x80" \
>   --hw-device "/lm32timer > int int1 /lm32cpu" \
>   --memory-region 0x08000000,0x4000000

you can pass --hw-file to target sim too

> That works great. When we use lm32-rtems4.11-run, you are supposed
> to provide a hw description file matching those arguments.  This is
> the file we are using:
> 
> ======================
> lm32cpu
> lm32uart/reg 0x80006000 0x100
> /lm32uart > int int0 /lm32cpu
> lm32timer/reg 0x80002000 0x80
> /lm32timer > int int1 /lm32cpu

put a leading / for each one missing it
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: lm32 simulator configuration file question
  2015-04-03  1:41 ` Mike Frysinger
@ 2015-04-03 20:21   ` Joel Sherrill
  2015-04-03 23:21     ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Sherrill @ 2015-04-03 20:21 UTC (permalink / raw)
  To: gdb



On 4/2/2015 8:41 PM, Mike Frysinger wrote:
> On 02 Apr 2015 17:19, Joel Sherrill wrote:
>> RTEMS has a BSP for the lm32 which runs on the simulator in gdb.
>> Based on our wrapper scripts and READMEs, this is how the simulator
>> is invoked in gdb:
>>
>> tar sim --hw-device lm32cpu \
>>   --hw-device "lm32uart/reg 0x80006000 0x100" \
>>   --hw-device "/lm32uart > int int0 /lm32cpu" \
>>   --hw-device "lm32timer/reg 0x80002000 0x80" \
>>   --hw-device "/lm32timer > int int1 /lm32cpu" \
>>   --memory-region 0x08000000,0x4000000
> you can pass --hw-file to target sim too
Thank you. I updated the file to this:

=======================
/lm32cpu
/lm32uart@0x80006000/reg 0x80006000 0x100
/lm32uart > int int0 /lm32cpu
/lm32timer@0x80002000/reg 0x80002000 0x80
/lm32timer > int int1 /lm32cpu
=======================

And that works with gdb using the tar sim command below.

tar sim --hw-file lm32_evr.conf --memory-region  0x08000000,0x4000000

But nothing comes out from the same executable using run

lm32-rtems4.11-run --hw-file lm32_evr.conf --memory-region 
0x08000000,0x4000000 .hello.exe

Does that make any sense to you?

>> That works great. When we use lm32-rtems4.11-run, you are supposed
>> to provide a hw description file matching those arguments.  This is
>> the file we are using:
>>
>> ======================
>> lm32cpu
>> lm32uart/reg 0x80006000 0x100
>> /lm32uart > int int0 /lm32cpu
>> lm32timer/reg 0x80002000 0x80
>> /lm32timer > int int1 /lm32cpu
> put a leading / for each one missing it
> -mike

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

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

* Re: lm32 simulator configuration file question
  2015-04-03 20:21   ` Joel Sherrill
@ 2015-04-03 23:21     ` Mike Frysinger
  2015-04-04  0:00       ` Joel Sherrill
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2015-04-03 23:21 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 1935 bytes --]

On 03 Apr 2015 15:21, Joel Sherrill wrote:
> On 4/2/2015 8:41 PM, Mike Frysinger wrote:
> > On 02 Apr 2015 17:19, Joel Sherrill wrote:
> >> RTEMS has a BSP for the lm32 which runs on the simulator in gdb.
> >> Based on our wrapper scripts and READMEs, this is how the simulator
> >> is invoked in gdb:
> >>
> >> tar sim --hw-device lm32cpu \
> >>   --hw-device "lm32uart/reg 0x80006000 0x100" \
> >>   --hw-device "/lm32uart > int int0 /lm32cpu" \
> >>   --hw-device "lm32timer/reg 0x80002000 0x80" \
> >>   --hw-device "/lm32timer > int int1 /lm32cpu" \
> >>   --memory-region 0x08000000,0x4000000
> > you can pass --hw-file to target sim too
> Thank you. I updated the file to this:
> 
> =======================
> /lm32cpu
> /lm32uart@0x80006000/reg 0x80006000 0x100
> /lm32uart > int int0 /lm32cpu
> /lm32timer@0x80002000/reg 0x80002000 0x80
> /lm32timer > int int1 /lm32cpu
> =======================
> 
> And that works with gdb using the tar sim command below.
> 
> tar sim --hw-file lm32_evr.conf --memory-region  0x08000000,0x4000000
> 
> But nothing comes out from the same executable using run
> 
> lm32-rtems4.11-run --hw-file lm32_evr.conf --memory-region 
> 0x08000000,0x4000000 .hello.exe
> 
> Does that make any sense to you?

honestly, i know nothing about the lm32 arch.  it has no testsuite, and i have 
no idea how to make example programs.  so i can't really explain why it might 
not be working.  with Blackfin, i use a leading slash on everything and it 
works for me.

could i convince you to write a simple hello world program ?  first one that'd 
run in the virtual environment, and the one that'd setup & write to the serial 
port ?  that way we could check the .s files into the testsuite dir, and i could 
try poking around the models.

if the latest version isn't working, you could try grabbing previous releases of 
gdb and building the sim for that.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: lm32 simulator configuration file question
  2015-04-03 23:21     ` Mike Frysinger
@ 2015-04-04  0:00       ` Joel Sherrill
  2015-04-04  2:57         ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Sherrill @ 2015-04-04  0:00 UTC (permalink / raw)
  To: gdb

On 04/03/2015 06:21 PM, Mike Frysinger wrote:
> On 03 Apr 2015 15:21, Joel Sherrill wrote:
>> On 4/2/2015 8:41 PM, Mike Frysinger wrote:
>>> On 02 Apr 2015 17:19, Joel Sherrill wrote:
>>>> RTEMS has a BSP for the lm32 which runs on the simulator in gdb.
>>>> Based on our wrapper scripts and READMEs, this is how the simulator
>>>> is invoked in gdb:
>>>>
>>>> tar sim --hw-device lm32cpu \
>>>>    --hw-device "lm32uart/reg 0x80006000 0x100" \
>>>>    --hw-device "/lm32uart>  int int0 /lm32cpu" \
>>>>    --hw-device "lm32timer/reg 0x80002000 0x80" \
>>>>    --hw-device "/lm32timer>  int int1 /lm32cpu" \
>>>>    --memory-region 0x08000000,0x4000000
>>> you can pass --hw-file to target sim too
>> Thank you. I updated the file to this:
>>
>> =======================
>> /lm32cpu
>> /lm32uart@0x80006000/reg 0x80006000 0x100
>> /lm32uart>  int int0 /lm32cpu
>> /lm32timer@0x80002000/reg 0x80002000 0x80
>> /lm32timer>  int int1 /lm32cpu
>> =======================
>>
>> And that works with gdb using the tar sim command below.
>>
>> tar sim --hw-file lm32_evr.conf --memory-region  0x08000000,0x4000000
>>
>> But nothing comes out from the same executable using run
>>
>> lm32-rtems4.11-run --hw-file lm32_evr.conf --memory-region
>> 0x08000000,0x4000000 .hello.exe
>>
>> Does that make any sense to you?
> honestly, i know nothing about the lm32 arch.  it has no testsuite, and i have
> no idea how to make example programs.  so i can't really explain why it might
> not be working.  with Blackfin, i use a leading slash on everything and it
> works for me.
>
sigh.. no testsuite. :(

Just to be clear, the simulator works when I invoke it inside
gdb. Just not via run. I am guessing some glue isn't right.
> could i convince you to write a simple hello world program ?  first one that'd
> run in the virtual environment, and the one that'd setup&  write to the serial
> port ?  that way we could check the .s files into the testsuite dir, and i could
> try poking around the models.
>
I will build an lm32-elf toolset and throw that together. I am travelling
next week so it may be slow to happen since I am no expert at lm32
assembly language. But a hello world shouldn't be a problem.
> if the latest version isn't working, you could try grabbing previous releases of
> gdb and building the sim for that.
I tried a couple of older gdb's I had laying around. They behaved the
same. Not sure how far I would have to go back.
> -mike


-- 
-- Joel Sherrill
Ask me about RTEMS: a free RTOS
Support and Training Available

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

* Re: lm32 simulator configuration file question
  2015-04-04  0:00       ` Joel Sherrill
@ 2015-04-04  2:57         ` Mike Frysinger
  2015-04-04 13:49           ` Joel Sherrill
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2015-04-04  2:57 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

On 03 Apr 2015 19:00, Joel Sherrill wrote:
> Just to be clear, the simulator works when I invoke it inside
> gdb. Just not via run. I am guessing some glue isn't right.

OK, that should be sufficient.  i just don't have any lm32 programs ;).
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: lm32 simulator configuration file question
  2015-04-04  2:57         ` Mike Frysinger
@ 2015-04-04 13:49           ` Joel Sherrill
  2015-04-04 21:08             ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Sherrill @ 2015-04-04 13:49 UTC (permalink / raw)
  To: gdb

On 04/03/2015 09:57 PM, Mike Frysinger wrote:
> On 03 Apr 2015 19:00, Joel Sherrill wrote:
>> Just to be clear, the simulator works when I invoke it inside
>> gdb. Just not via run. I am guessing some glue isn't right.
> OK, that should be sufficient.  i just don't have any lm32 programs ;).
How about I just privately email you our RTEMS hello world
along with the instructions to run it in gdb, with run, and
the conf file?
> -mike


-- 
-- Joel Sherrill
Ask me about RTEMS: a free RTOS
Support and Training Available

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

* Re: lm32 simulator configuration file question
  2015-04-04 13:49           ` Joel Sherrill
@ 2015-04-04 21:08             ` Mike Frysinger
  2015-04-05  0:27               ` Joel Sherrill
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2015-04-04 21:08 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

On 04 Apr 2015 08:49, Joel Sherrill wrote:
> On 04/03/2015 09:57 PM, Mike Frysinger wrote:
> > On 03 Apr 2015 19:00, Joel Sherrill wrote:
> >> Just to be clear, the simulator works when I invoke it inside
> >> gdb. Just not via run. I am guessing some glue isn't right.
> >
> > OK, that should be sufficient.  i just don't have any lm32 programs ;).
>
> How about I just privately email you our RTEMS hello world
> along with the instructions to run it in gdb, with run, and
> the conf file?

that's fine
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: lm32 simulator configuration file question
  2015-04-04 21:08             ` Mike Frysinger
@ 2015-04-05  0:27               ` Joel Sherrill
  2015-04-05  1:20                 ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Sherrill @ 2015-04-05  0:27 UTC (permalink / raw)
  To: gdb

On 04/04/2015 04:08 PM, Mike Frysinger wrote:
> On 04 Apr 2015 08:49, Joel Sherrill wrote:
>> On 04/03/2015 09:57 PM, Mike Frysinger wrote:
>>> On 03 Apr 2015 19:00, Joel Sherrill wrote:
>>>> Just to be clear, the simulator works when I invoke it inside
>>>> gdb. Just not via run. I am guessing some glue isn't right.
>>> OK, that should be sufficient.  i just don't have any lm32 programs ;).
>> How about I just privately email you our RTEMS hello world
>> along with the instructions to run it in gdb, with run, and
>> the conf file?
> that's fine
OK. I ran it with --hw-trace and learned that the UART is not
behaving the same when started via gdb vs the run command.

Unfortunately, I also learned that our BSP was configured to
dirty memory. That is REALLY slow on the simulator. So rebuilding
now and should be able to send tomorrow I think.

Once we get by this one, I noticed that the lm32timer only
lets you instance it once. The real board has two timers.
Is there an example of a device which can be instanced
multiple times?
> -mike


-- 
-- Joel Sherrill
Ask me about RTEMS: a free RTOS
Support and Training Available

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

* Re: lm32 simulator configuration file question
  2015-04-05  0:27               ` Joel Sherrill
@ 2015-04-05  1:20                 ` Mike Frysinger
  2015-04-05  1:32                   ` Joel Sherrill
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2015-04-05  1:20 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

On 04 Apr 2015 19:27, Joel Sherrill wrote:
> Once we get by this one, I noticed that the lm32timer only
> lets you instance it once. The real board has two timers.
> Is there an example of a device which can be instanced
> multiple times?

i glanced at the lm32timer device code and it looks correct to me -- there is no 
global state (it's all attached to the instance via HW_ZALLOC (me, ...), and all 
accesses go through the passed in "me" hw).

why do you think it only lets you instantiate it once ?
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: lm32 simulator configuration file question
  2015-04-05  1:20                 ` Mike Frysinger
@ 2015-04-05  1:32                   ` Joel Sherrill
  2015-04-05  2:05                     ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Sherrill @ 2015-04-05  1:32 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb



On April 4, 2015 8:20:24 PM CDT, Mike Frysinger <vapier@gentoo.org> wrote:
>On 04 Apr 2015 19:27, Joel Sherrill wrote:
>> Once we get by this one, I noticed that the lm32timer only
>> lets you instance it once. The real board has two timers.
>> Is there an example of a device which can be instanced
>> multiple times?
>
>i glanced at the lm32timer device code and it looks correct to me --
>there is no 
>global state (it's all attached to the instance via HW_ZALLOC (me,
>...), and all 
>accesses go through the passed in "me" hw).
>
>why do you think it only lets you instantiate it once ?

When I configure two timers, it looks like the second address registration attempt is ignored based on the trace and faulting code. I can have timer 0 or 1 but not both. Two interrupt attaches seem to be honored.

I will finish putting together a kit for you tomorrow. The RTEMS tester framework uses the gdb/mi so I can automate runs of the rtems test suite. It was looking pretty good using gdb but something is wrong with run.

Enjoy your Saturday night and Easter Sunday. I will get the kit to you before I fly out Monday.


>-mike

--joel

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

* Re: lm32 simulator configuration file question
  2015-04-05  1:32                   ` Joel Sherrill
@ 2015-04-05  2:05                     ` Mike Frysinger
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2015-04-05  2:05 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

On 04 Apr 2015 20:32, Joel Sherrill wrote:
> On April 4, 2015 8:20:24 PM CDT, Mike Frysinger wrote:
> >On 04 Apr 2015 19:27, Joel Sherrill wrote:
> >> Once we get by this one, I noticed that the lm32timer only
> >> lets you instance it once. The real board has two timers.
> >> Is there an example of a device which can be instanced
> >> multiple times?
> >
> >i glanced at the lm32timer device code and it looks correct to me --
> >there is no 
> >global state (it's all attached to the instance via HW_ZALLOC (me,
> >...), and all 
> >accesses go through the passed in "me" hw).
> >
> >why do you think it only lets you instantiate it once ?
> 
> When I configure two timers, it looks like the second address registration 
> attempt is ignored based on the trace and faulting code. I can have timer 0 or 
> 1 but not both. Two interrupt attaches seem to be honored.

without seeing the hw file, i can only guess.  make sure you:
 - use unique addresses (the @xxx part)
 - are routing the output lines to different input lines
 - interrupt driver actually handles more than one input :)

i've def connected multiple Blackfin UARTs using the same model and had their 
interrupts routed independently ...
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-04-05  2:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 22:19 lm32 simulator configuration file question Joel Sherrill
2015-04-03  1:41 ` Mike Frysinger
2015-04-03 20:21   ` Joel Sherrill
2015-04-03 23:21     ` Mike Frysinger
2015-04-04  0:00       ` Joel Sherrill
2015-04-04  2:57         ` Mike Frysinger
2015-04-04 13:49           ` Joel Sherrill
2015-04-04 21:08             ` Mike Frysinger
2015-04-05  0:27               ` Joel Sherrill
2015-04-05  1:20                 ` Mike Frysinger
2015-04-05  1:32                   ` Joel Sherrill
2015-04-05  2:05                     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).