[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assistance Request

From: Joel Sherrill
Subject: Re: Assistance Request
Date: Tue, 12 Feb 2008 09:47:39 -0600
User-agent: Thunderbird (X11/20071115)

Joel Sherrill wrote:
Dave Korn wrote:
On 11 February 2008 21:29, Joel Sherrill wrote:

We use versioned target names.  Do I have to list them all in
the following section?

# This is a list of toolchains that are supported on this board.
set_board_info target_install {powerpc-rtems4.9}

  I don't know for a fact, I've never tried it, but I'd guess...

runtest.exp:        if { [lsearch -exact $target_install $target_alias] >= 0 }

.. you need to explicitly enumerate them.  (There might be a good argument for
making that --glob or even --regex).

What about arguments to the simulator?  As you can see in
the example, we use this to invoke powerpc-rtems-run:


where DEVICE_TREE_FILE has the device configuration.  How does
that get passed through?  Where should the DEVICE_TREE_FILE

  I handle that - and this works for me because, like your case, the
EXECUTABLE is last on the commandline - by doing the equivalent of

set_board_info sim "RUN -f DEVICE_TREE_FILE"

and the EXECUTABLE gets appended by proc sim_spawn.  (Looking at that, it
seems there is some way of specifying the sim and the flags separately by

set_board_info sim "RUN"
set_board_info sim,flags "-f DEVICE_TREE_FILE"

but I have never tried it myself.)

+ an extra object file to link with.

set_board_info ldflags

Do I custom compile testrun.c myself? Or is that automatic?
For sure we need the main() wrapper for no return code.  I
can have the application start at main() so that isn't an issue.

  There's a thing called

set_board_info needs_status_wrapper 1

which I forget how it works, but that's one way to make it work.  In my case,
I've added a flag to my simulator so that the sim itself returns the exit
status of the executable (and detects if the simulated app hits abort() or
exit() at the same time, I have no runtime library to speak of).

I assume I have to manually compile an rtems specific support
file before the tests are run right?

  If the needs_status_wrapper stuff doesn't do what you want, I think - again,
untested - you could probably invoke the compiler from your baseboard script.
Don't really know about this one though.

+ target CFLAGS and LDFLAGS

set_board_info cflags
set_board_info ldflags

As you can hopefully see now, we need to generically do this:

-B ${prefix}/${target}/BSP/ -specs bsp_specs -qrtems CPU_CFLAGS

where each board has its own CPU_CFLAGS. For psim, it would be
something like this when fully expanded:

-B/home/joel/rtems-4.9-work/bsp-install//powerpc-rtems4.9/psim/lib/ \
    -specs bsp_specs -qrtems -mcpu=603e  -Dppc603e

I hate to hard-code a path or target since it is versioned.  Are there
DejaGNU variables I can use?

  I pass external environment vars into the script by using


then I can use the value of MY_SCRIPT_VAR in the various set_board_info flags;
that should do for getting things like prefix and target into your flags.

  So, how far are you at?  Have you got a baseboard script written yet?
Have you read the "Extending DejaGnu" chapter of the manual, specifically
the "Adding a new board" section?

I'm hacking on that.  But am not comfortable with this and
still don't know how to invoke runtest properly. :)

  I always use

make -k check RUNTESTFLAGS="... whatever ..."

and don't bother trying to invoke it directly.  (Can replace "check" by
"check-gcc" if you want to skip the mangler tests etc.)

I have this now to run it:

make check-gcc RUNTESTFLAGS="\

  --target=rtems-powerpc-sim --all \

I got executables but they are not linking in with the RTEMS BSP
from what I see of the symbol table and no surprise do not run. :)

 From the log I see this which would seem to indicate that I am
not getting any compiler flags passed in.

I am getting arguments through now.  I am on Fedora 8
and the DejaGNU RPM doesn't seem to support ~/.dejagnurc.
I moved my .exp file to the /usr/share/dejagnu/baseboard and
am using this to drive things:

make check-gcc RUNTESTFLAGS="\
RTEMS_MAKEFILE_PATH=/home/joel/work-gnat/423/bsp-install/powerpc-rtems4.9/psim \
--target=powerpc-rtems4.9 \
--target_board=rtems-powerpc-sim --all \

I am sure I won't be able to execute anything correctly yet
because I haven't linked with an RTEMS startup file in
the process.  But things are looking better now that I can
see my settings having an impact.  I hope to post in a little
while that I am running real executable running.

RTEMS has fixed size task stacks.  Any idea on how much
stack space the test main's will take?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]