Loading image-file in SID.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Loading image-file in SID.

Deaf Beed
Hi,

I have been playing around with SID for a while and have created a
component of mine. I am using the arm7pid pre-configured settings
along with my new component. I have used eCos as the OS and have
written a small program which runs as expected (programs my component)
when loaded through GDB. Now, I have this requirement.

I would like to run the image without having to load it through GDB. I
used the redboot image & its conf file as an example, but have not
been successful in loading and running my image. The details are:

1. The eCos built elf (little) has been converted to a binary
(arm-eabi-objdump). The elf has an entry point address of 0x8040.

2. Have loaded it in place of the reboot image:
   >> set mem2 image-file "my-eCos.img"
   >> connect-pin init-sequence output-1 -> mem2 image-load

3. No other changes at all to the arm-pid-redboot-tksm.conf file.

I realize that the PC also needs to be set and tried to do that using
"set cpu pc (int of)0x8040" but without any success. Could you please
suggest the required changes, etc. required to load and run and
arbitrary image using SID alone?


Any help/direction would be appreciated,
regards,
Shamik
Reply | Threaded
Open this post in threaded view
|

Re: Loading image-file in SID.

Frank Ch. Eigler
Hi -

On Mon, Jul 19, 2010 at 04:34:44PM +0530, Deaf Beed wrote:
> I have been playing around with SID for a while and have created a
> component of mine.  [...]

Great.  Please feel free to contribute any pieces you are able.

> [...]  I realize that the PC also needs to be set and tried to do
> that using "set cpu pc (int of)0x8040" but without any
> success. Could you please suggest the required changes,
> etc. required to load and run and arbitrary image using SID alone?

Certainly.  See the sw-load-elf component, for example as configured
by the bsp/configrun-sid perl script.  It connects to a memory mapper
bus (to write into memory), and a CPU (the start-pc-set! pins)

- FChE
Reply | Threaded
Open this post in threaded view
|

Re: Loading image-file in SID.

Deaf Beed
Hi

Thanks. That worked out well for me. Really appreciated the response.

I now generate a  sid configuration and edit it to add my component.
>$ arm-elf-sid --board=pid7t-normalmap --load cpu=program.x --no-run

The 'program.x' is a bunch of prints, linked with the eCos OS built
for pid7t. The program executes and I can trace the prints at the
UART.

However, once the prints have executed, the control passes to, I
think, the OS idle loop and the simulation does not exit on its own. I
have to stop it. Is there a way to make the simulation exit/finish on
its own? maybe by programming some sid simulation component.


-Shamik

On Mon, Jul 19, 2010 at 4:39 PM, Frank Ch. Eigler <[hidden email]> wrote:

> Hi -
>
> On Mon, Jul 19, 2010 at 04:34:44PM +0530, Deaf Beed wrote:
>> I have been playing around with SID for a while and have created a
>> component of mine.  [...]
>
> Great.  Please feel free to contribute any pieces you are able.
>
>> [...]  I realize that the PC also needs to be set and tried to do
>> that using "set cpu pc (int of)0x8040" but without any
>> success. Could you please suggest the required changes,
>> etc. required to load and run and arbitrary image using SID alone?
>
> Certainly.  See the sw-load-elf component, for example as configured
> by the bsp/configrun-sid perl script.  It connects to a memory mapper
> bus (to write into memory), and a CPU (the start-pc-set! pins)
>
> - FChE
>
Reply | Threaded
Open this post in threaded view
|

Re: Loading image-file in SID.

Frank Ch. Eigler
Hi -

On Wed, Aug 18, 2010 at 11:13:29PM +0530, Deaf Beed wrote:
> [...]
> However, once the prints have executed, the control passes to, I
> think, the OS idle loop and the simulation does not exit on its own. I
> have to stop it. Is there a way to make the simulation exit/finish on
> its own? maybe by programming some sid simulation component.

The software needs to decide how it wishes to signal its own
termination, then some piece of sid configuration needs to map that to
a signal to the cfgroot stop! pin.  

If the sw-gloss* is not used, nor is gdb, then you could jury-rig what
is in effect a breakpoint using triggerpoints (connect the
watch:pc:value:0xsomething pseudo-pin on the cpu to the cfgroot
stop!).

Or you could wire up a virtual device such as hw-glue-probe-bus into
the bus mapper tree at some particular address, then poke at that
address from the arm software code.

- FChE