⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x-vxsim3.html

📁 这个包包是Vxworks的编程手册!全英文的!很好很强大!希望大家喜欢!!!!
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    VxSim   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-vxsim.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-vxsim2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-vxsim4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="84437">H.3  &nbsp;&nbsp;Building Applications</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84438"> </a>The following sections describe how to use the VxSim compilers. The recommended way to build VxSim modules is to use the project tool. For complete information on this tool, see the <i class="title">Tornado User's Guide: Projects</i>. If you are using manual methods in your project, the information required for manual builds and loading is summarized below.</p><dd><p class="Body"><a name="84439"> </a>This information applies to using manual methods on both the built-in version of VxSim and the optional networking product.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84441">Defining the CPU Type</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84442"> </a>Setting the preprocessor variable <b class="symbol_UC">CPU</b> ensures that VxWorks and your applications build with the appropriate features enabled. Define this variable to one of the following values, to match the host you are using: &nbsp;&nbsp;<p class="table"><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84445"> </a><b class="symbol_UC">SIMSPARCSOLARIS </b></p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84447"> </a>VxSim for Solaris </p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84449"> </a><b class="symbol_UC">SIMHPPA</b> </p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84451"> </a>VxSim for HP-UX </p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84453"> </a><b class="symbol_UC">SIMNT</b> </p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84455"> </a>VxSim for Windows NT </p></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84456">The Toolkit Environment</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84466"> </a>All VxWorks simulators use the GNU C/C++ compiler.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="84461"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION:  </font></b></a>The compiler used by the Tornado tools to compile VxSim applications for Windows is the GNU C/C++ compiler rather than the MicroSoft tools.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84467">Compiling C and C++ Modules</a></i></h4></font><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="84468">Solaris</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="84469"> </a>The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of <b class="file">applic</b>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="84470"></b><tt class="output">% </tt><b>ccsimso -DCPU=SIMSPARCSOLARIS -ansi -nostdinc -g -fno-builtin \ -fvolatile -DRW_MULTI_THREAD -D_REENTRANT -O2 -I. \ -I /wind/target/h -c applic.c</a></b></pre></dl></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="84471">HP-UX</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="84472"> </a>The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of <b class="file">applic</b>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="84473"></b><tt class="output">% </tt><b>cchppa -g -ansi -nostdinc -DRW_MULTI_THREAD -D_REENTRANT -O2 \ -fvolitile -fno-builtin -I. -I/wind/target/h -DCUP_SIMHPPA \ -c applic.c</a></b></pre></dl></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="84474">Windows</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="84475"> </a>The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of <b class="file">applic</b>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="84476"></b><tt class="output">% </tt><b>ccsimpc -DCPU=SIMNT -mpentium -ansi -nostdinc -g -nostdlib \ -fno-builtin -fno-defer-pop -Wall -DRW_MULTI_THREAD \ -D_REENTRANT -I. -I C:/Tornado/target/h -c applic.c </a></b></pre></dl></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="84477">Option Definitions </a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="84481"> </a>The options shown in the example have the following meanings:<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup></p></dl><dl class="margin"><dd><div class="Item"><a name="84482"> </a><b class="symbol_lc">ccsimso</b> </div><dl class="margin"><dd><div class="Indent"><a name="84483"> </a>Required; use <b class="symbol_lc">ccsimso</b> for the Solaris simulator, <b class="symbol_lc">cchppa</b> for the HP-UX simulator, and <b class="symbol_lc">ccsimpc </b>for the Windows simulator.</div><br></dl><dd><div class="Item"><a name="84484"> </a><b class="symbol_UC">-DCPU=SIMNT</b> </div><dl class="margin"><dd><div class="Indent"><a name="84487"> </a>Required; defines the CPU type. See the table on page <a href="x-vxsim3.html#84441"><i class="title">Defining the CPU Type</i></a>. </div><br></dl><dd><div class="Item"><a name="84489"> </a><b class="symbol_lc">-mpentium</b> </div><dl class="margin"><dd><div class="Indent"><a name="84490"> </a>Optional for Windows only; specifies Pentium optimizations. </div><br></dl><dd><div class="Item"><a name="84491"> </a><b class="command">-ansi</b> </div><dl class="margin"><dd><div class="Indent"><a name="84492"> </a>Recommended; supports all ANSI standard C programs.</div><br></dl><dd><div class="Item"><a name="84493"> </a><b class="command">-nostdinc</b> </div><dl class="margin"><dd><div class="Indent"><a name="84494"> </a>Required; searches only the directories specified with the <b class="command">-I</b> flag (see below) and the current directory for header files. Does not search host-system include files.</div><br></dl><dd><div class="Item"><a name="84495"> </a><b class="command">-O2</b> </div><dl class="margin"><dd><div class="Indent"><a name="84496"> </a>Optional; implements optimization. Not recommended for the PC simulator. </div><br></dl><dd><div class="Item"><a name="84497"> </a><b class="command">-g</b> </div><dl class="margin"><dd><div class="Indent"><a name="84498"> </a>Optional; produces debugging information.</div><br></dl><dd><div class="Item"><a name="84499"> </a><b class="command">-nostdlib</b> </div><dl class="margin"><dd><div class="Indent"><a name="84500"> </a>Required for Windows; does not use the standard system startup files or libraries when linking.</div><br></dl><dd><div class="Item"><a name="84501"> </a><b class="command">-fvolatile</b> </div><dl class="margin"><dd><div class="Indent"><a name="84502"> </a>Required for Solaris and HP-UX; considers all memory references through pointers to be volatile.</div><br></dl><dd><div class="Item"><a name="84503"> </a><b class="command">-fno-builtin</b> </div><dl class="margin"><dd><div class="Indent"><a name="84504"> </a>Required; uses library calls even for common library subroutines.</div><br></dl><dd><div class="Item"><a name="84505"> </a><b class="command">-fno-defer-pop</b> </div><dl class="margin"><dd><div class="Indent"><a name="84506"> </a>Required for Windows, optional for UNIX. Causes arguments to each function call to be popped as soon as the function returns.</div><br></dl><dd><div class="Item"><a name="84507"> </a><b class="command">-Wall</b></div><dl class="margin"><dd><div class="Indent"><a name="84508"> </a>Optional; enables most warnings. </div><br></dl><dd><div class="Item"><a name="84509"> </a><b class="command">-</b><b class="symbol_UC">DRW_MULTI_THREAD </b></div><dl class="margin"><dd><div class="Indent"><a name="84510"> </a>Required; specifies Rogue Wave multi-threading. </div><br></dl><dd><div class="Item"><a name="84511"> </a><b class="command">-</b><b class="symbol_UC">D_REENTRANT</b><b class="command"> </b></div><dl class="margin"><dd><div class="Indent"><a name="84512"> </a>Required; causes reentrant code to be generated. </div><br></dl><dd><div class="Item"><a name="84513"> </a><b class="command">-I</b><b class="symbol_UC"> $WIND_BASE</b><b class="command">/target/h</b> </div><dl class="margin"><dd><div class="Indent"><a name="84514"> </a>Required; includes VxWorks header files. (Additional <b class="command">-I</b> flags may be included to specify other header files.)</div><br></dl><dd><div class="Item"><a name="84515"> </a><b class="command">-c</b> </div><dl class="margin"><dd><div class="Indent"><a name="84516"> </a>Required; specifies that the module is to be compiled only, and not linked for execution under the host.</div><br></dl><dd><div class="Item"><a name="84517"> </a><b class="file">applic.</b><i class="textVariable">language_id </i></div><dl class="margin"><dd><div class="Indent"><a name="84518"> </a>Required; the files to compile. For C compilation, specify a suffix of <b class="file">.c</b>. For C++ compilation, specify a suffix of <b class="file">.cpp</b>. The output is an unlinked object module with the suffix <b class="file">.o</b>; for the example, the output is <b class="file">applic.o</b>. The object module format for each simulator is as follows: <p class="table"><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84521"> </a><b class="symbol_UC">SIMSPARCSOLARIS </b></p></td><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84523"> </a><b class="symbol_UC">ELF</b> </p></td></tr><tr valign="top"><td colspan=1 rowspan=1><p class="BodyLeft"><a name="84525"> </a><b class="symbol_UC">SIMHPPA</b> </p></td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -