blob: 5d1ec0883d096d37b986c7b50eaac1f51748a571 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><TITLE
>Adding A New Board</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="DejaGnu"
HREF="book1.html"><LINK
REL="UP"
TITLE="Extending DejaGnu"
HREF="c1099.html"><LINK
REL="PREVIOUS"
TITLE="Adding A New Target"
HREF="x1195.html"><LINK
REL="NEXT"
TITLE="Board Config File Values"
HREF="x1234.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>DejaGnu: The GNU Testing Framework</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x1195.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Extending DejaGnu</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x1234.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="ADDBOARD"
></A
>Adding A New Board</H1
><P
>Adding a new board consists of creating a new board config
file. Examples are in
<TT
CLASS="FILENAME"
>dejagnu/baseboards</TT
>. Usually to make a new
board file, it's easiest to copy an existing one. It is also
possible to have your file be based on a
<I
CLASS="EMPHASIS"
>baseboard</I
> file with only one or two
changes needed. Typically, this can be as simple as just
changing the linker script. Once the new baseboard file is done,
add it to the <SPAN
CLASS="SYMBOL"
>boards_DATA</SPAN
> list in the
<TT
CLASS="FILENAME"
>dejagnu/baseboards/Makefile.am</TT
>, and regenerate the
Makefile.in using automake. Then just rebuild and install DejaGnu. You
can test it by:</P
><P
>There is a crude inheritance scheme going on with board files, so
you can include one board file into another, The two main procedures used
to do this are <TT
CLASS="FUNCTION"
>load_generic_config</TT
> and
<TT
CLASS="FUNCTION"
>load_base_board_description</TT
>. The generic config file
contains other procedures used for a certain class of target. The
board description file is where the board specfic settings go. Commonly
there are similar target environments with just different
processors.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN1224"
></A
><P
><B
>Example 6. Testing a New Board Config File</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
> make check RUNTESTFLAGS="--target_board=<I
CLASS="EMPHASIS"
>newboardfile</I
>".
</PRE
></TD
></TR
></TABLE
></DIV
><P
>Here's an example of a board config file. There are
several <I
CLASS="EMPHASIS"
>helper procedures</I
> used in this
example. A helper procedure is one that look for a tool of files
in commonly installed locations. These are mostly used when
testing in the build tree, because the executables to be tested
are in the same tree as the new dejagnu files. The helper
procedures are the ones in square braces
<I
CLASS="EMPHASIS"
>[]</I
>, which is the Tcl execution characters.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN1231"
></A
><P
><B
>Example 7. Example Board Config File</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>&#13; # Load the generic configuration for this board. This will define a basic
# set of routines needed by the tool to communicate with the board.
load_generic_config "sim"
# basic-sim.exp is a basic description for the standard Cygnus simulator.
load_base_board_description "basic-sim"
# The compiler used to build for this board. This has *nothing* to do
# with what compiler is tested if we're testing gcc.
set_board_info compiler "[find_gcc]"
# We only support newlib on this target.
# However, we include libgloss so we can find the linker scripts.
set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"
set_board_info ldflags "[newlib_link_flags]"
# No linker script for this board.
set_board_info ldscript "-Tsim.ld";
# The simulator doesn't return exit statuses and we need to indicate this.
set_board_info needs_status_wrapper 1
# Can't pass arguments to this target.
set_board_info noargs 1
# No signals.
set_board_info gdb,nosignals 1
# And it can't call functions.
set_board_info gdb,cannot_call_functions 1
</PRE
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x1195.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x1234.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Adding A New Target</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c1099.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Board Config File Values</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>