[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: Mon, 11 Feb 2008 15:29:15 -0600
User-agent: Thunderbird (X11/20071115)

Dave Korn wrote:
On 11 February 2008 17:27, Joel Sherrill wrote:

Starting with what I know.  This is for the SPARC/SIS

To compile:
sparc-rtems4.9-gcc -B${RTEMSBSP_prefix} \
   -specs bsp_specs -qrtems -g -O2 -mcpu=cypress \
   -c FILE.c

To Link:
sparc-rtems4.9-gcc -B${RTEMSBSP_prefix} \
   -specs bsp_specs -qrtems -g  -mcpu=cypress \

To Run:


RTEMS programs start with a "Init" thread.  So
we will have build "HARNESS.c" and link with it
in each test executable.

RTEMS applications do not return the exit status
to the environment. So it will have to print
pass/fail based on the exit value.  I vaguely
remember this not being a big deal for DejaGNU.

If I can get one worked out, I can make it happen
for the others but I can't unravel the magic yet. :(

Thanks for the help.  Bear with me.  Once I get one, I can do others. :)
  Basically, you add a new baseboard file in $prefix/share/dejagnu/baseboards,
the example in the docs is a reasonable starting point.  The new baseboard
file includes a line somewhere like 'load_generic_config "sim"', which pulls
in all the support routines from $prefix/share/dejagnu/config/sim.exp.  These
handle the basic interfacing of the test framework to a locally-run simulator,
and hopefully you shouldn't need to do too much more than tinker with config
variables in the board.exp file.

I'm in that area I copied powerpc-sim.exp to rtems-powerpc-sim.exp
as a starting point.  This is the powerpc simulator psim in gdb so
shouldn't be THAT difficult. :-D

After writing this with a bunch of questions, I decided to throw
together a simple script that builds and runs an RTEMS hello
world on psim.  Maybe this will give us something concrete to
reference.  It has all the pieces that need to be addressed.
RTEMS is very symmetrical -- Board Support Packages are
installed at ${prefix}/${target}/BSP and the ${prefix} does
not have to be the same as the toolset.

The entire example is attached and the following are the
questions I had.

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}

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
+ 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.

I assume I have to manually compile an rtems specific support
file before the tests are run right?
+ 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?
+ command to run simulator

set_board_info sim

  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. :)

Thanks in advance.

Can't think of a witty .sigline today....

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

Attachment: dejagnu-rtems.tar.bz2
Description: application/bzip

reply via email to

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