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
|
.TH nescc 1 "May 22, 2013"
.SH NAME
nescc - nesC compiler
.SH SYNOPSIS
\fBnescc\fR [\fB-gcc=\fIgcc-name\fR] [\fB-fnesc-gcc=\fIgcc-name\fR] [\fB-fnesc-mingw-gcc\fR]
[\fB-fnesc-target=\fIarchitecture\fR] [\fB-fnesc-docdir=\fIdir\fR]
[\fB-fnesc-topdir=\fIdir\fR] [\fB-fnesc-docs-use-graphviz\fR] [\fB-fnesc-is-app\fR]
[\fB-fnesc-simulate\fR]
[\fB-fnesc-nido-tosnodes=\fIn\fR] [\fB-fnesc-nido-motenumber=\fIexpression\fR]
[\fB-conly\fR] [\fB-fnesc-cfile=\fIfile\fR] [\fB-fnesc-gccize\fR]
[\fB-fnesc-cppdir=\fIdirectory\fR] [\fB-fnesc-separator=\fIseparator\fR]
[\fB-fnesc-no-inline\fR] [\fB-fnesc-optimize-atomic\fR]
[\fB--version\fR] [\fB-fnesc-include=\fIfile\fR] [\fB-fnesc-verbose\fR] [\fB-Wnesc-\fI...\fR]
[\fB-fnesc-dump=\fIspecification\fR] [\fB-fnesc-dumpfile=\fIfile\fR]
[\fB-fnesc-scheduler=\fIspecification\fR] [\fB-fnesc-path=\fIpath\fR]
[\fB-fnesc-no-debug\fR]
[\fB-fnesc-deputy\fR] [\fB-fnesc-no-deputy\fR]
[\fB-fnesc-default-safe\fR] [\fB-fnesc-default-unsafe\fR]
[any gcc option] \fIfiles\fR...
.SH DESCRIPTION
\fBnescc\fR is an extension to \fBgcc\fR that knows how to compile nesC
applications. If invoked on regular C files, it behaves exactly like
\fBgcc\fR. When invoked on a nesC component or interface (\fB.nc\fR
extension) file it compiles and links (except if the \fB-c\fR,
\fB-S\fR, \fB-conly\fR, \fB-E\fR or \fB-fsyntax-only\fR options are used) that component
with the other files specified on the command line.
.SH OPTIONS
\fBnescc\fR accepts all \fBgcc\fR options, and some additional nesC
specific options:
.TP
\fB-gcc=\fIgcc-name\fR -fnesc-gcc=\fIgcc-name\fR
Specify which gcc compiler to use to compile and link any C files, either
explicitly specified, or generated as the output of the nesC-to-C compiler.
This option supports cross-compilation of nesC code (the usual mode of
operation...).
.TP
\fB-fnesc-mingw-gcc\fR
Pass this option if the gcc version specified with \fB-gcc=...\fR was
compiled for Window's mingw environment, and hence expects Windows-style
rather than Unix-style paths.
.TP
\fB-fnesc-target=\fIarchitecture\fR
Specify the target architecture to compile for. Currently supported
platforms are \fBavr\fR (the Atmel AVR family), \fBmsp430\fR (the TI MSP430
family) and \fBself\fR (the machine the nesC compiler is running on).
If you use the \fBenv\fR target, the architecture details are read from
the \fBNESC_MACHINE\fR environment variable. See the separate env target
documentation for details.
.TP
\fB-fnesc-docdir=\fIdir\fR
Generate documentation for the compiled component in directory \fIdir\fR.
.TP
\fB-fnesc-topdir=\fIdir\fR
Specify directory paths that should be stripped from the source file names
when generating "package names" for the documentation files.
.TP
\fB-fnesc-docs-use-graphviz\fR
Explicitly enable or disable the use of the graphviz tool in the generated
documentation. Without this option, graphviz is enabled iff the \fBdot\fR
program is found in the current path. Use of graphviz requires \fBdot\fR. The
documentation generation tool checks the version of \fBdot\fR, and enables
client-side image maps, if supported.
.TP
\fB-fnesc-is-app\fR
Tell nescc that the source being compiled is an application, and to generate an app description page for the entire application.
.TP
\fB-fnesc-simulate\fR
Compile for a simulation environment.
.TP
\fB-fnesc-nido-tosnodes=\fIn\fR, \fB-fnesc-nido-motenumber=\fIexpression\fR
When \fB-fnesc-simulate\fR is specified, the nesC program is compiled for a
simulation environment, where a single executable will simulate \fIn\fR
nodes. Specifically, in the generated code, each global variable becomes an
\fIn\fR element array, and all accesses to global variables are indexed
with \fIexpression\fR.
.TP
\fB-conly\fR
Just compile to C, leaving the generated source code for top-level-component
\fIcomp.nc\fR in C file \fIcomp.c\fR (except if the \fB-fnesc-cfile\fR
option is specified).
.TP
\fB-fnesc-cfile=\fIfile\fR
Specify a file in which to save the C code generated when compiling a
component. Note: if you specify two components on the command line, then
the C code from the second one will overwrite the C code from the first.
.TP
\fB-fnesc-gccize\fR
Output target-specific extensions as gcc-style attributes rather than using
the target's original syntax. Can help if using \fB-conly\fR and sending the
nesC output from some other tool that understands gcc attributes but not the
target-specific extensions.
.TP
\fB-fnesc-cppdir=\fIdirectory\fR
Save all preprocessing results in \fIdirectory\fR. The directory is created
if it doesn't exist. This can be helpful to track down preprocessor-related
compilation problems. You probably want to ensure that \fIdirectory\fR is
empty when you call \fBnescc\fR, to make it obvious which files where
preprocessed as part of the current compilation.
.TP
\fB-fnesc-separator=\fIseparator\fR
Set separator used to create symbol names in the generated C code (default $).
The compiler needs to generate unique names to denote, e.g., a module
variable. It does this by concatenating various symbol names to ensure that
it generates unique names. For instance, variable \fBbar\fR in module
\fBMaz\fR becomes a global C variable \fBMaz$bar\fR in the compiler output.
Some C compilers do not like $ in symbol names, so you can specify a
different separator, e.g., \fB__\fR (leading to generated symbols like
\fBMaz__bar\fR).
You will get a compile-time warning if any symbol in the program being
compiled contains the separator you specify (the presence of the
separator in a symbol could lead to the generation of incorrect code).
The separator can however start or end a symbol.
.TP
\fB-fnesc-no-inline\fR
Disabled the automatic inlining of all small functions, and of all functions
with a single call site.
.TP
\fB-fnesc-optimize-atomic\fR
Optimize atomic statements [EXPERIMENTAL]: reduce or remove the overhead
of atomic statements in simple cases (e.g., single-byte reads).
.TP
\fB--version\fR
Print the version of \fBnescc\fR and of the selected gcc compiler
(see \fB-gcc\fR).
.TP
\fB-fnesc-include=\fIheader-file\fR
Include the specified file before compiling a nesC component. Behaves
as if \fBincludes \fIheader-file\fB;\fR was included at the start of
that component.
.TP
\fB-fnesc-dump=\fIspecification\fR
Output information on the compiled programs structure, and in particular
its user-specified attributes. For more details, see the separate nesC
dump documentation.
.TP
\fB-fnesc-dumpfile=\fIfile\fR
Where to output the information requested by \fB-fnesc-dump\fR. Defaults to
stdout.
.TP
\fB-fnesc-verbose\fR
Be more verbose than \fB-v\fR.
.TP
\fB-fnesc-scheduler=\fIcomponent\fR,\fIunique-string\fR,\fIinterface-name\fR,\fIinterface-definition\fR,\fIrun-event\fR,\fIpost-command\fR
By default, nesC compiles uses of \fBtask void \fItaskname\fB() ...\fR to
\fBvoid \fItaskname\fB()\fR, and \fBpost \fItaskname()\fR to
\fBTOS_post(\fItaskname\fB)\fR.
With this option, each task gets its own \fIinterface-definition\fR
interface, the task implementation is transformed into a \fIrun-event\fR
event and posts becomes a call to the \fIpost-command\fR command. This
per-task interface is automatically connected to the parameterised
\fIinterface-name\fR interface of scheduler component \fIcomponent\fR. The
parameter id for the connection is chosen with
\fBunique("\fIunique-string\fB")\fR.
.TP
\fB-fnesc-path=\fIpath\fR
Add colon separated directories to the nescc search path.
.TP
\fB-fnesc-no-debug\fR
Remove the functions \fBdbg()\fR, \fBdbg_clear()\fR, \fBdbg_active()\fR from the source code.
.TP
\fB-fnesc-deputy\fR
Compile with the deputy compiler.
.TP
\fB-fnesc-no-deputy\fR
Do not use the deputy compiler. This is the default.
.TP
\fB-fnesc-default-safe\fR
Make modules default to having the \fB@safe()\fR attribute. Has no effect if \fB-fnesc-deputy\fR is not set.
.TP
\fB-fnesc-default-unsafe\fR
Make modules default to having the \fB@unsafe()\fR attribute. Has no effect if \fB-fnesc-deputy\fR is not set.
.PP
There are a number of warnings specific to nesC, specified with
\fB-Wnesc-\fR (all these warnings are off by
default):
.TP
\fB-Wnesc-fnptr\fR
Warn when function pointers are used (use of function pointers is
deprecated in nesC and leads to inaccurate data race detection).
.TP
\fB-Wnesc-async\fR
Warn when interrupt handlers call commands or events not annotated with
\fBasync\fR.
.TP
\fB-Wnesc-data-race\fR
Warn about potential data races.
.TP
\fB-Wnesc-combine\fR
Warn when configuration wiring leads to "fan-out" and the function return
type does not have a combining function defined.
.TP
\fB-Wnesc-docstring\fR
Warn when unexpected documentation strings (starting with \fB/**\fR) are
seen.
.TP
\fB-Wnesc-implicit-conn\fR
Warn when implicit connections between components are used.
.TP
\fB-Wnesc-all\fR
Turns on \fB-Wnesc-fnptr\fR, \fB-Wnesc-async\fR, \fB-Wnesc-combine\fR
and\fB-Wnesc-data-race\fR.
.TP
\fB-Wnesc-error\fR
Turns the \fB-Wnesc-fnptr\fR, \fB-Wnesc-async\fR, \fB-Wnesc-combine\fR and
\fB-Wnesc-data-race\fR warnings into errors.
.PP
When compiling a nesC component, the nesC compiler recognizes the gcc C
language (\fB-f...\fR) and warning (\fB-W...\fR) options. The \fB-S\fR,
\fB-c\fR and \fB-o\fR options work as usual, the \fB-x\fR option accepts
\fBnesc\fR. The \fB-v\fR option causes the nesC compiler to print out the
paths of all components and interfaces that are loaded. Directories can be
added to nesC\fRs search path with \fB-I\fR.
.SH EXAMPLES
If you wish to compile a component Bar.nc to a C file, you can do:
.IP
nescc \-c \-o /dev/null \-fnesc\-cfile=Bar.c Bar.nc
.SH PREPROCESSOR SYMBOLS
\fBnescc\fR defines the following preprocessor symbol:
.TP
\fBNESC\fR (since v1.1)
set to XYZ where x.yz is the nesC version
.SH ENVIRONMENT VARIABLES
.TP
.B NESCPATH
A colon separated list of additional search directories for
nesC components.
.SH SEE ALSO
.IR gcc (1),
platform-specific gcc
.SH NOTES
The warnings for the new nesC 1.1 features (see \fB-Wnesc-all\fR) are off
by default to increase compatibility with nesC 1.0 code. To match the
language specification in the nesC 1.1 reference manual, you should compile
with \fB-Wnesc-all\fR and \fB-Wnesc-error\fR. These options will become the
default in future releases.
|