[
KLOE Online ] [ Previous ] [ Index ] [ Bottom ]

UNIX VME Access Library

This is a first approach to implement a common UNIX VME access library for KLOE. It should support the VME CPU boards used in the KLOE final DAQ and the DAQ prototype but also the one used in KLOE test stands. It is available now as package Vme version v0.

The first priority is to have working version for all boards allowing simple VME read/write access. The implementation of things like bus-error and interrupt handling and performance optimization will need more effort and time.


Important Note There are some activities from the VIPA / VSC Software Working Group to standarize VME Access Software. CDF has actually implemented parts of the proposed standards in their vmeAccess software package but this package does not support our VME boards and operating systems (we don't use vxworks).

I'm currently evaluating if the proposed standards satisfy KLOE needs and if porting and implementation time is acceptable!


Index


VME boards and operating systems

In KLOE we have to deal with the following VME processer boards and UNIX operating systems:

Vendor   Board-Name   Processor-Type   Operating System

HP       742rt        PA-7100 50MHz     HP-RT
HP       743rt        PA-7150 100MHz    HP-UX, HP-RT

DEC      AXPvme160    21066 160MHz      OSF1
DEC      AXPvme230    21066 230MHz      OSF1

CETIA    VGPW2        PowerPC 601 50MHz LynxOS

CES      FIC8234      68040             LynxOS
CES      RTPC         PowerPC 603       LynxOS

Moterola MVME-176     68040             LynxOS
    

A simple VME access example

The main goal is to make the interface as simple as possible for the user e.g. to hide all VME specific stuff in the library. Here is how a VME read or write (single cycle) access and a VME copy looks like (error handling is not complete):

/* vme_exa.c, a simple Vme Access Example */
#include "stdio.h"
#include "Vme.h"

#define VME_ADDRESS 0x10000000 /* VME address to map */
#define VME_SIZE    0x100000   /* VME space to map */
#define VME_AM      0x09       /* VME address modifier */
#define VME_OFFSET  0x100      /* VME offset from base */

main ()
{
  int cid, data, count, *vme_ptr, blt_am=0x0b;
  char buffer[100];

  cid = VmeOpenChannel("Example");

  vme_ptr = (int*)VmeMapAddress(cid,VME_ADDRESS,VME_SIZE,VME_AM);
  *vme_ptr = 0xDEADBEEF;             /* VME A32/D32 write */
  data = *vme_ptr;                   /* VME A32/D32 read */

  /* define BLT D32 for VME read/write */
  (void)VmeSetProp(cid, Vme_SET_COPY_AM, &blt_am); 
  /* copy 100 bytes from VME to memory */
  count = VmeRead (cid, VME_OFFSET, buffer, 100);
  /* copy 100 bytes from memory to VME */
  count = VmeWrite(cid, VME_OFFSET, buffer, 100);

  (void)VmeCloseChannel(cid);
}
    
As you can see from this example I use the VmeSetProp() function to define specific properties (or options) for the used VME channel. For most properties there are already useful defaults defined.

Vme package setup and usage

The package organisation follows the rules defined for KLOE online software (follow the links in the online software page). To setup the package just type:

tcsh> packman Vme v0
    
Then you can link your programs with the VME access library:
tcsh> cc -o vme_exa vme_exa.c -I$VMESRC $VMELIBS
    

Implementation status of supported platforms

... coming soon !


Applications based on package Vme

... coming soon !


[ KLOE Online ] [ Previous ] [ Index ]

Suggestions, comments or questions? Please contact:


27/3/96