VMUSB vmetcl

Name

VMUSB vmetcl -- VME access via VM-USB for Tcl scripts.

Synopsis

package require vmusbvme

vme enumerate

vme create name ?options? base size

vme list

vme delete name

name get -l | -w | -b offset

name put -l | -w | -b offset value

DESCRIPTION

vmusbvme is a drop in replacement for the SBS Vme Tcl package. Note that since, on linux, only one program can own a VME device at a time, this package is intended to be used with VME crates that are not involved in the readout of the experiment.

In addition to the SBS subcommands for creating, listing and deleting address windows in the VME crate, the package supports getting an enumeration of the crates that are visible on the hosts USB subsystem. This can be used to determine which crate an application really wants to open in a multi-crate environment.

vmusbvme contains a single public command which has several subcommands.

SUBCOMMANDS

vme create name options... base-address size

Creates a new named window in the vme crate address space. The base-address is the start of this window and size the number of bytes covered by this window.

name provides a name for the address space. The name becomes a new Tcl command if the vme create command succeeds. See WINDOW SUB-COMMANDS for information on how to use this new command to access the contents of the address window.

options are a set of pairs of command parameters. The first element of each pair is an option name and the second its value.

The option -device determines which address modifier is used to access the window. It can have the values standard, extended, shortio and geo. The geo address modifier is inteded for accessing CAEN 32 channel digitizer in geographical addressing mode. It is actually address modifier 0x2f which the VME standard reserves for Configuration ROM/Control&Status Register (CR/CSR) accesses. This option defaults to standard

The -crate option specifies the crate number to create the map in. This defaults to 0 if not supplied. See the enumerate subcommand.

On success this command returns the name.

vme list

Returns a list of currently defined VME address windows. Each list element is a pair. The first element of each pair is the name of the window and the second is the base address of the window.

vme delete name

Deletes the vme address window specified by name. The command is destroyed and the window will no longer appear in the list of windows returned by vme list.

vme enumerate

Returns an enumeration of the controllers that are currently attached to the host system. The enumeration is a list of pairs. The first element of each pair is a crate number to use when creating maps in that VME crate. The second element of each pair is the serial number string of the VM-USB controller that is interfacing the host to that crate.

WINDOW SUB-COMMANDS

VME address spaces created via vme create are command ensembles. The name of the space is the ensemble name. Each command has the following subcommands:

get size offset

Fetches data from the VME bus. The size parameter is one of -l, -w or -b specifying respectively 32 bit, 16 bit or 8 bit accesses. The offset is the byte offset into the VME window from which the data are to be fetched.

put size offset value

Writes data to the VME bus. The size parameter specifies the width of the transfer (same values as for get). The offset parameter is the byte offset into the window to which the write will be performed and value is the value written.