Next Previous Contents

## 3. How to talk to the VMEbus with the VMEUtils and the VMEShell Packages

## 3.1 What is the VMEUtils program

This program can be run as is. Once started, you will see a command prompt. Type ? And you will see a list of commands. While useful, I think you will find the VMEShell scripts a better way to go. They do use this program to speak with the kernel driver so it is necessary to have this program available in the current PATH.

The source code for "vmeutils" is also instruction on how to speak directly to the kernel driver. For those of you who wish to create programs that directly speak with the driver, these source files are good examples.

## 3.2 What are the VMEShell Scripts

The VMEShell programs are unix shell scripts. They offer the operator a simple way to access the data on a VMEbus. Using these commands creates temporary files in the user's working directory which store information on the last access you did. This is nice because it will be possible to log off the machine, log back in and proceed from where you left off without having to re-enter VMEbus information again. Plus, these files are stored in the current working directory, so you can have different VME access configuration just by setting up different directories for each VME board of interest.

Assuming you placed the shell programs and the "vmeutils" program in the /usr/local/bin directory, you should be able to log in as a regular user and run them. What follows assumes exactly this.

## 3.3 The "vmemap" command.

Login as a regular user and create a directory to experiment with. Once in this directory type:

    vmemap

You should get a help screen like this...

    Usage:  map address count space size type
      where address is VME Address to set Universe image to

        Space = 0 CR/CSR    Space = 1 A16
        Space = 2 A24       Space = 3 A32

        Size  = 1 8 bit     Size  = 2 16 bit
        Size  = 3 32 bit    Size  = 4 64 bit

        Type  = 0 USR/DATA  Type  = 1 USR/PRG
        Type  = 2 SUP/DATA  Type  = 3 SUP/PRG

This is where you tell VMELinux how you want to access the VMEbus. We assume you already know about the VMEbus' many modes of operation, but here is a short list to help you.

- address is the actual VMEbus address you wish to see. This should be set to the lower most value of the address range of interest.
- count is the number of bytes you consider a valid range to view. This is the number of bytes starting at the address specified above.
- space is the addressing space (mode). For those of you who do not know what we are talking about here, the VMEbus has four overlapping address spaces that can be called independent of each other. A16 is a 64 Kilobyte space. A24 is a 16 Megabyte space. A32 is a 4 Gigabyte space. There is an A64 space defined the VME specification, but the Universe does not support it.
- Size refers to the maximum data width allowed for the VME board you are accessing. Some VMEbus board only handle 8 bit data paths. Others transfer 32 bits (four bytes) at a time. Some can handle a special VME block mode which can move 64 bits per transaction. The Universe can handle all these modes allowing you to mix inexpensive serial port boards with hugh memory arrays.
- Type is the type of VME transaction performed. Some VME boards make a distinction between "User" access (USR) and "Supervisor" access (SUP). Also, some boards allow access to two "pages" of memory: Program (PRG) and Data. The Universe supports all modes.

Typing...

    vmemap 0x8000 0x100 1 2 0

sets up the VMELinux driver to access an A16 board at base address 8000 Hex with a range of 100H bytes with 16 bit data width and USR/DATA mode.

You will find two new files in your current directory.

- fa.vme
- map.vme

fa.vme stores a "fixed adder" value that will be added to all subsequent accesses with the programs below.

map.vme store the parameters above so you do not have to enter them every time.

All the following shell utilities read values from these two files to performs VME accesses.

## 3.4 Read Byte, Word or Long

Syntax:

- vmerb -options address size
- vmerw -options address size
- vmerl -options address size

## 3.5 Write Byte, Word or Long

Syntax:

- vmewb -options address value
- vmeww -options address value
- vmewl -options address value

## 3.6 Read the VMEbus to a file

Syntax:

- vmerf -options address size filename

## 3.7 Write a file to the VMEbus

Syntax:

- vmewf -options address filename

## 3.8 Parameters

There are several parameters used with these commands: address, size and filename.

- address - The actual hexadecimal VMEbus address you wish to read. If the map command is set to access A16 VME address space, the address should be 0xABCD. If the space is A24 then use 0xABCDEF. For A32 space use 0xABCDEFGH.
- size - The number of bytes to read. This value is always the number of bytes regardless of the data word size read. For example, if you want to read 16 bytes of information and use vmerl, the display will show 16 bytes displayed as 4 long words.
- filename - The name of the file to send "read" VMEbus data to or "write" VMEbus data from.
- value - a hex value written as "0xXXXX."

## 3.9 Options

Available options are defined with a single dash with the any combination of the following:

- q - Hides details on the access to the vmeutils program (default)
- Q - Shows details on the access to the vmeutils program
- p - Single access PCI addressing mode (opposite of d) (default)
- d - DMA access PCI addressing mode (opposite of p) (very fast access to the VMEbus)
- 0, 1, 2, or 3 - Which Universe chip "Image" to use (defaults to 0)
- b - binary mode off (default)
- B - binary mode on
- v - turn off verbose parameter printing (default)
- V - turn on verbose parameter printing to see how the driver is begin used

## 3.10 A Note about DMA mode.

VMELinux offers access to all the features of the Universe Chip. Especially useful is access to the DMA engine on the chip. With this feature the Universe chip transfers data on the PCI bus by becoming a PCI master. This is nice, but the real benefit comes from the VMEbus accesses. Even if the VMEbus interface is not using block mode transfers, the Universe chip can complete VMEbus transfers under 400 nanoseconds sustained. This is the direct result of the Universe taking complete control of both the PCI bus and the VMEbus. Thus, it is possible to access non block mode VMEbus peripherals much faster than older technologies.

Next Previous Contents