aboutsummaryrefslogtreecommitdiff
path: root/doc/html/x1214.html
blob: 5d1ec0883d096d37b986c7b50eaac1f51748a571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<!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
>