1 EPICS Bus Errors & Power PC u VME Bus Error can generate a Machine Check Exception (MCE) u The WRS mv2700 BSP doesn’t have code to do this u Write cycles complete “normally”, Read cycles return 0xffffffff u I can provide code to generate a MCE on VME Bus Error u For read cycles on an mv2700, the MCE appears to be synchronous u The instruction that caused the MCE is given (although vxWorks’ exception report doesn’t say what address was being accessed) u Write cycles can be delayed well beyond the end of their instruction u The Universe-2 VMEbus interface chip contains a Write Posting FIFO u Write Posting is usually enabled for the A32 window, but not the A16 u MCE is not asserted if a write-posted cycle gets a Bus Error u It can generate an interrupt instead, and the BERR address is saved u For a coupled write cycle, the MCE is asynchronous and may indicate a different routine (a task switch seems unlikely, too many instructions)
2 EPICS C++ Guidelines for Base Andrew Johnson APS/ANL
3 EPICS C++ in R3.14 Alpha-1 u 3.14 is the first version of Base with C++ code in the IOC u Tornado 2.0 first version of vxWorks to support this u Solaris, Win32, Linux and RTEMS also support C++ u Why use C++? u Increased type safety u Structural advantages: modularity, inheritance, templates u Future needs of EPICS community u No C++ compiler is fully ISO C++ compliant yet u Different C++ features are missing on different compilers u The C++ Standard Library is not uniformly implemented or efficient on different platforms
4 EPICS C++ in Base u 3.14 Alpha-1 has the following C++ components u Portable CA server (not used in the IOC yet) u Channel Access client library u Some C++ facilities in libCom used in the above Don’t rely on the libCom C++ facilities in 3.14 Alpha-1! u The APIs and functionality will be changing u 3.14 libCom C++ facilities are being revised to provide u A subset of ISO Standard C++ APIs where practical u string, linked list, hash table u Simple class interfaces to common facilities independent of OS u binary & mutex semaphores, threads, timestamp, timers, ring buffer
5 EPICS C++ Features to Beware u Exceptions are not fully supported on all platforms u Exception-safe library code is hard to write correctly Base will provide macros to allow platform-independent code, calling cantProceed() where throw() is not available u Namespaces are not supported on all platforms Where they are, C++ facilities in libCom will appear inside a namespace epics { … } block. u Base will provide macros to allow platform-independent code u Explicit template instantiation can vary slightly between the different compilers u The more advanced template features are commonly unavailable on one or more compilers
6 EPICS The C++ Standard Library u We want to use standard C++ APIs where we can, but u The implementation of the standard containers (list etc.) is very slow on certain platforms u Tornado 2.0 versions are particularly bad, list is up to 12 times as slow as the equivalent ellList library in C u Where these are most useful Base will provide an efficient version that supports a subset of the standard API u Standard library containers could fragment the free memory pool over a long period of time u Every list insert and delete operation [de]allocates memory u Base implementations of standard containers use free-lists u Base provides a free-list template for other classes to use
7 EPICS Further C++ Reading u IOC Application Developers Guide for R3.14 u Will describes the C++ facilities in libCom when finalized u [More] Effective C++ by Scott Meyers, Addison Wesley u These 2 books are now available in HTML on one CD-ROM with a search engine, extensive cross-links and some extra material The GNU C++ compiler in Tornado 2 has a –Weffc++ switch that warns about code that violates some of Meyers’ guidelines u Mozilla has even bigger portability problems than EPICS, and provides guidelines for developers at