Bus Errors Power PC u VME Bus Error

Bus Errors & Power PC u VME Bus Error can generate a Machine Check Exception (MCE) u The WRS mv 2700 BSP doesn’t have code to do this u u Write cycles complete “normally”, Read cycles return 0 xffff I can provide code to generate a MCE on VME Bus Error For read cycles on an mv 2700, the MCE appears to be synchronous u u EPICS The instruction that caused the MCE is given (although vx. Works’ exception report doesn’t say what address was being accessed) Write cycles can be delayed well beyond the end of their instruction The Universe-2 VMEbus interface chip contains a Write Posting FIFO u u Write Posting is usually enabled for the A 32 window, but not the A 16 MCE is not asserted if a write-posted cycle gets a Bus Error u u It can generate an interrupt instead, and the BERR address is saved For a coupled write cycle, the MCE is asynchronous and may indicate a different routine (a task switch seems unlikely, too many instructions) 1

EPICS C++ Guidelines for Base Andrew Johnson APS/ANL 2

C++ in R 3. 14 Alpha-1 u u 3. 14 is the first version of Base with C++ code in the IOC Tornado 2. 0 first version of vx. Works to support this u u Solaris, Win 32, Linux and RTEMS also support C++ Why use C++? u u EPICS Increased type safety Structural advantages: modularity, inheritance, templates Future needs of EPICS community No C++ compiler is fully ISO C++ compliant yet u u Different C++ features are missing on different compilers The C++ Standard Library is not uniformly implemented or efficient on different platforms 3

C++ in Base u 3. 14 Alpha-1 has the following C++ components u u Portable CA server (not used in the IOC yet) Channel Access client library Some C++ facilities in lib. Com used in the above Don’t rely on the lib. Com C++ facilities in 3. 14 Alpha-1! u u EPICS The APIs and functionality will be changing 3. 14 lib. Com C++ facilities are being revised to provide u A subset of ISO Standard C++ APIs where practical u u string, linked list, hash table Simple class interfaces to common facilities independent of OS u binary & mutex semaphores, threads, timestamp, timers, ring buffer 4

C++ Features to Beware u Exceptions are not fully supported on all platforms u u u EPICS Exception-safe library code is hard to write correctly Base will provide macros to allow platform-independent code, calling cant. Proceed() where throw() is not available Namespaces are not supported on all platforms u Where they are, C++ facilities in lib. Com will appear inside a namespace epics { … } block. u u u Base will provide macros to allow platform-independent code Explicit template instantiation can vary slightly between the different compilers The more advanced template features are commonly unavailable on one or more compilers 5

The C++ Standard Library u EPICS 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 u u Tornado 2. 0 versions are particularly bad, list is up to 12 times as slow as the equivalent ell. List library in C Where these are most useful Base will provide an efficient version that supports a subset of the standard API Standard library containers could fragment the free memory pool over a long period of time u u u Every list insert and delete operation [de]allocates memory Base implementations of standard containers use free-lists Base provides a free-list template for other classes to use 6

Further C++ Reading u IOC Application Developers Guide for R 3. 14 u u Will describes the C++ facilities in lib. Com when finalized [More] Effective C++ by Scott Meyers, Addison Wesley u u u EPICS 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 Mozilla has even bigger portability problems than EPICS, and provides guidelines for developers at http: //www. mozilla. org/hacking/portable-cpp. html 7
- Slides: 7