MATLAB: Do blocks in the VxWorks library generate VxWorks operating system calls in Real-Time Workshop 7.3 (R2009a)

simulink coder

We are migrating our development platform from an Intel Pentium / Celeron based platform to an Intel Core2 platform running VxWorks 6.6 or 6.7. Our fastest cyclic tasks run at rates of 250 µsec, other tasks at multiples of 250 µsec, and is triggered by an hardware interrupt which generates an interrupt service routine (ISR) that starts a task via a semaphore. For IO drivers, our code uses other semaphores as well.
We have found out that VxWorks operating system calls like semFlush(), semGive(), etc usually take about 2 µsec, occasionally more than 20 µsec, and up to 80 µsec has been observed. This occasionally violates the scheduling. We are considering running our fastest task in the ISR, without a task, but in an ISR most VxWorks OS calls like semaphore operations are not permitted. How can I guarantee that RTW generated code contains no operating system calls (which are forbidden in an ISR)?

Best Answer

Real-Time Workshop VxWorks blocks will leverage operating system calls. This is a feature. There are two VxWorks blocks provided, vxinterrupt1 (or vxinterrupt in older release) and vxtask1 (or vxtask in older release).
vxinterrupt1 is used in the context of ISR. This block uses operation system calls to save/restore floating pointer context, or lock/unlock interrupt. This block will not use semaphore related calls.
The VxWorks block task1 creates a Task which is spawned as a separate VxWorks task. When this block runs, a semaphore is used to enable the task execution. For this block, semaphore related calls are used. The Task Sync block is the only block which uses the VxWorks system call taskSpawn to spawn an independent task. The other blocks in the VxWorks library (“Async Interrupt”, “Protected RT” and “Unprotected RT”) will not generate VxWorks operating system calls.
So you should use vxinterrupt1, not task1 block.