Technical Bulletin

SC-4 and VxWorks

This bulletin is being issued to SuperCard-4 Customers who are using the VxWorks operating system on their SuperCard. Several Customer's have encountered problems in the areas mentioned below. These notes will be added to the next version of the Manual. Some of this material is covered in the SuperCard man pages.

FLOATING POINT UNIT
Each processor on the SC4 is an Intel i860 which has an embedded Floating Point Unit (FPU). The compiler defaults to producing code that contain floating point instructions even if no floating point code is obvious. For example, the compiler will normally use the floating point unit to perform integer multiplication.

However, the basic premise of VxWorks is that only tasks may use the FPU; and only if the FPU option has been specified when the task is spawned. ("sp" defaults to allow the FPU option. xc_task_spawn in the Host Control Function Library requires that VX_FP_TASK be ORed into the options argument). Any user code not directly executed as a task must not use the floating point unit. Such code sequences include: signal handlers, interrupt handlers, exception handlers, and routines connected to clock and DMA interrupts. To guarantee that the compiler does not produce floating point instructions, you must instruct the compiler not to do so by either one of two methods. The first method is to use the compiler invocation option

"-Hoff=FPU -Hoff=FPU_VAR_ARGS ".

The second method is to place enabling/disabling of the floating point option in line. This is performed via

#pragma Off(FPU)
#pragma Off(FPU_VAR_ARGS)

Both compiler options FPU and FPU_VAR_ARGS must be on or off simultaneously.

Saving and restoring floating point registers during task swapping is a time consuming proposition on the i860. Therefore, it may be prudent to only spawn tasks with the floating point option if the task absolutely requires it. However, code will generally run faster if it uses the FPU.

CACHE FLUSHING
Wind River vxWorks supplies the cache flushing cacheFlush which allows the user to specify the number of bytes to flush. On the i860, individual cache lines may not be flushed. Rather, the entire cache must be flush. If a user calls this function without specifying "ENTIRE_CACHE", then this function will return an error without flushing the cache.

Example: my_return = cacheFlush( DATA_CACHE, (void *) 0, ENTIRE_CACHE);
or my_return = cacheFlush( INSTRUCTION_CACHE, (void *) 0, ENTIRE_CACHE);

The same restrictions applies to the following functions: cacheLock, cacheUnlock, and cacheClear.

CACHE LINE AND FLUSHING
Cache lines are 32 bytes (8 words) long. Users must flush when they need to communicate to an external device by way of the DMA routine or when an external device will poke at the SC4 memory via the shared memory window. Once flushed, the entire memory is visible to any external device including the DMA engine.

If the memory location that the external device is poking at resides on the same cache line as a local variable, then that memory location may brought back into the cache during the call to the DMA routine. Consequently, the DMA routine may pick up stale data.

The user must guarantee that all elements used for communications are grouped together to reside on their own cache line.

If the user has included vxWorks basic MMU library, then the function cacheDmaMalloc will return a pointer which is 4kb aligned. This memory location pointed to will be marked as non-cacheable. When using memory locations obtained via this method, no flushing is required.

WARNING: Function cacheDmaMalloc will always return an allocated region independent of whether the MMU basic is installed. If MMU basic is not installed, then the allocated region is NOT protected.

To include MMU basic, the vxWorks kernel must be rebuilt. Edit config.h to include:

"#define INCLUDE_MMU_BASIC"

somewhere in the file. Afterwards, remake the kernel by executing "make". Copy the kernel and symbol table (vxWorks and vxWorks.sym) to $CSPI_BASE/host/mv167-vx/sc4 or $CSPI_BASE/host/mv1600-vx/sc4.

DMA
The DMA routine x_move_data usees floating point registers to perform data copies between PEs on the same board. In addition, if the data being copied is "large (approximately 16 words), then this routine will allocate 8kb from the stack as a temporary work buffer.

DMA routines should not be called within any ISR (Interrupt Service Routine) if a potential exists for onboard DMA between PEs.

DMA ISRs
The DMA done ISR and the DMA bus interrupt ISR run as a high priority background task. These tasks are spawned with 8kb of stack space and without floating point options.

IPC tasks
IPC tasks execute as background tasks which execute each time an IPC request is made. These background tasks have been spawned with the floating point options enabled and with a stack size of 30000 bytes.

Contacting Customer Support
If there are any problems installing or using this software, or if any bugs or possible enhancements are noticed, contact the CSPI Customer Support Department.

  • tel: 1-800-325-3110 / 978-663-7598 ext. 1309
  • fax: 978-663-0150
  • e-mail: support@cspi.com

Although the information contained herein is believed to be accurate and up-to-date, CSPI assumes no responsibility for inaccuracies or omissions.


Return to MultiComputer Division Home Page     .    E-Mail Webmaster     .     Copyright ©2008 CSP, Inc.     .     Top of Page