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

📄 c-vxsim.html

📁 vxbuild 是一个 CSP/eybuild 的WEB 示例运行于 VxWorks 之上的演示程序.
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<dd><table border="0" cellpadding="2" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan=1 rowspan=1><div align="left"><a name="84713"></a><b><font face="Helvetica, sans-serif" size="-1" class="sans">Interrupts</font></b></div></td><td colspan=1 rowspan=1><div align="left"><a name="84715"></a><b><font face="Helvetica, sans-serif" size="-1" class="sans">Assigned To</font></b></div></td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div align="left"><a name="84717"></a>0xc000-0xc010</div></td><td colspan=1 rowspan=1><div align="left"><a name="84719"></a>host messages</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div align="left"><a name="84721"></a>0xc011 on</div></td><td colspan=1 rowspan=1><div align="left"><a name="84723"></a>available for user messages </div></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></dl></dl></p><dl class="margin"><dl class="margin"></p><dd><p class="Body"><a name="84725"></a>Pseudo-drivers can be created to use these interrupts. Interrupt code must be connected with the standard VxWorks <b class="routine">intConnect(&nbsp;)</b> mechanism. </p><dd><p class="Body"><a name="84726"></a>For example, to install an ISR that logs a message whenever host message <b class="symbol_UC">WM_TIMER_CLOCK</b><b class="routine"> </b>arrives, execute the following:</p><dl class="margin"><dd><font color="009090"><pre class="Terminal2"><a name="84727"></a>-&gt; <font color="00a000"><b>intConnect (0xc011, logMsg, "Help!\n")</b></font></pre></font></dl><dd><p class="Body"><a name="84728"></a>Then send message 0xc011 to VxSim from a host task. Every time the message is received, the ISR (<b class="routine">logMsg(&nbsp;)</b> in this case) runs. </p><dd><p class="Body"><a name="84729"></a>If a VxSim task reads from a host device, the task would normally block while reading; however, this would stop the VxSim process entirely until data is ready. Instead the device is put into asynchronous mode so that a message is sent whenever data becomes ready. In this case, an input ISR reads the data, puts it in a buffer, and unblocks some waiting task.</p><dd><p class="Body"><a name="84733"></a>Since VxSim uses the task's stack when taking interrupts, the task stacks are artificially inflated to compensate. You may notice this if you spawn a task of a certain size and then examine the stack size.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84735"></a>Clock and Timing Issues</i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84745"></a>The execution times of VxSim functions are not, in general, the same as on a real target. For example, the VxWorks <b class="routine">intLock(&nbsp;)</b> function is normally very fast because it just writes to the processor status register. However, under VxSim, <b class="routine">intLock(&nbsp;) </b>is relatively slow because it takes a host semaphore, allowing other processes to run.</p><dd><p class="Body"><a name="84746"></a>The clock facilities are provided by the Windows API <b class="routine">SetTimer(&nbsp;)</b> for both the system and auxiliary clocks. The problem with using <b class="routine">SetTimer(&nbsp;)</b> for the target system clock is that it produces inaccurate timings when VxSim is swapped out as a host process. On the other hand, the timing of VxSim is, in general, different than on an actual target, so this is not really a problem. </p></dl></dl><dl class="margin"><dd><p class="table"><table border="0" cellpadding="2" cellspacing="0"><tr valign="top"><td colspan=1 rowspan=1></td><td><hr></td></tr><tr valign="top"><td><img border="0" alt="*" src="icons/note.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan=1 rowspan=1><div class="CalloutCell"><a name="88167"></a><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE:  </font></b>Because VxSim is a host process, it shares resources with all other processes and is swapped in and out. In addition, the kernel's idle loop has been modified to suspend VxSim until a signal arrives (rather than busy waiting), thus allowing other processes to run.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1></td><td colspan=1 rowspan=1><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p><dl class="margin"><dd><p class="Body"><a name="84750"></a>The <b class="routine">spy(&nbsp;)</b> facility is built on top of the auxiliary clock. The task monitoring occurs during each interrupt of the auxiliary clock to see which task is executing or if the kernel is executing. Because the profiling timer includes host system time and user time, discrepancies can occur, especially if intensive host I/O occurs.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="89040"></a>WindView Instrumentation on the Windows Simulator</i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89042"></a>Due to some specifics of the Windows emulator, there is a critical section at the end of the <b class="routine">intUnlock(&nbsp;)</b> routine where interrupts can occur but scheduling is forbidden. If a reschedule is necessary at the end of the interrupt, it is not done when the interrupt is exited but is delayed until the end of the critical section of the <b class="routine">intUnlock(&nbsp;)</b> routine.</p><dd><p class="Body"><a name="89049"></a>This behavior can have an impact on a WindView graph. If a high priority task is made ready within an interrupt handler, this task may not be run when the interrupt is exited but instead may run slightly later.</p></dl></dl><dl class="margin"><dd><p class="table"><table border="0" cellpadding="2" cellspacing="0"><tr valign="top"><td colspan=1 rowspan=1></td><td><hr></td></tr><tr valign="top"><td><img border="0" alt="*" src="icons/note.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan=1 rowspan=1><div class="CalloutCell"><a name="89093"></a><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE:  </font></b>This delay of the rescheduling has no impact on the relative scheduling between VxWorks tasks.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1></td><td colspan=1 rowspan=1><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></dl><br class="H2"><a name="84752"></a><br class="H2navbar"><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i>6.5  &nbsp;&nbsp;Configuring the VxSim Full Simulator</i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84754"></a>This section contains information pertaining only to the VxSim full simulator. (All information in previous sections also pertains to that product, as well as to the integrated version.) The VxSim full simulator provides networking facilities. Most of the special considerations associated with it are network considerations. </p><dd><p class="Body"><a name="84755"></a>If you purchase the VxSim optional full simulator for networking, you must take additional configuration steps. </p></dl><dl class="margin"><dd><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84756"></a>Install the VxSim full simulator using <b class="symbol_UC">SETUP</b>, either when you install Tornado 2.2 or at a later time. (For more information, see the<i class="title">Tornado Getting Started Guide</i>.)</li></ul></p><dd><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84759"></a>Install the appropriate network driver on your host. (See <a href="c-vxsim.html#84778"><i class="title">Installing VxSim Network Drivers</i></a>.)</li></ul></p><dd><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84761"></a>Configure VxWorks to use networking, rebuild it, and download it using either the project facility or manual methods. (See <a href="c-vxsim.html#90638"><i class="title">Configuring VxSim for Networking</i></a>.)</li></ul></p></dl></dl><dl class="margin"><dd><p class="table"><table border="0" cellpadding="2" cellspacing="0"><tr valign="top"><td colspan=1 rowspan=1></td><td><hr></td></tr><tr valign="top"><td><img border="0" alt="*" src="icons/warning.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan=1 rowspan=1><div class="CalloutCell"><a name="84769"></a><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">WARNING:  </font></b>Project facility configuration and building of projects is independent of the methods used for configuring and building applications prior to Tornado 2.x (which included manually editing <b class="file">config.h</b> and <b class="file">configAll.h</b>). Use of the project facility is the recommended, and is much simpler. However, the manual method may still be used (see <a href="c-config.html#84365"><i class="title">5.&nbsp;Command Line Configuration and Build</i></a> for details). Avoid using the two methods together for the same project except where specific BSP and driver macros are not available in the project facility.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1></td><td colspan=1 rowspan=1><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p><dl class="margin"><dd><p class="listspace"><ul class="Bullet" type="disc"><li><a name="88201"></a>Be sure to correctly set target server options for the full simulator:</li></ul></p><dl class="margin"><dd><p class="listspace"><ul class="Dash2" type="circle"><li><a name="89113"></a>Click the <font face="Helvetica, sans-serif" size="-1" class="sans">Launch Simulator</font> icon. Select <font face="Helvetica, sans-serif" size="-1" class="sans">Custom-built simulator</font> and set the path to a full simulator project directory. Click <font face="Helvetica, sans-serif" size="-1" class="sans">OK</font>. The <font face="Helvetica, sans-serif" size="-1" class="sans">VxSim Launch: Launch Target Server</font> window pops up. Click on <font face="Helvetica, sans-serif" size="-1" class="sans">Details</font>. Select <font face="Helvetica, sans-serif" size="-1" class="sans">Full simulator</font> to set default target server options for the full simulator. Finally, click <font face="Helvetica, sans-serif" size="-1" class="sans">OK</font> to launch a target server.</li></ul></p><dd><p class="listspace"><ul class="Dash2" type="circle"><li><a name="90599"></a>Click on <font face="Helvetica, sans-serif" size="-1" class="sans">Tools&gt;TargetServer&gt;Configure</font>. In the <font face="Helvetica, sans-serif" size="-1" class="sans">Configure Target Servers</font> window, select <font face="Helvetica, sans-serif" size="-1" class="sans">wdbrpc</font> in the <font face="Helvetica, sans-serif" size="-1" class="sans">Available Back Ends</font> list, and set the IP address of the simulator in the <font face="Helvetica, sans-serif" size="-1" class="sans">Target Name/IP Address</font> field. Set the target server name to <font face="Helvetica, sans-serif" size="-1" class="sans">vxsim</font>. The target server command line should be:</li></ul></p><dl class="margin"><dd><font color="0000a0"><pre class="Code3"><a name="90600"></a>    tgtsvr.exe 192.168.255.1 -n vxsim -V -B wdbrpc</pre></font>

⌨️ 快捷键说明

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