Name of the exercise
VMEbus data transfer
Responsible for the exercise
Markus Joos
Description of the exercise
The students will write a C program that executes VMEbus single cycles and block transfers to write data to a VME memory and to read it back.
What will the students learn
- Writing a simple C program to exchange data with a VMEbus module
- Understand and use an existing VMEbus library
- Compare the relative speed of different VMEbus transfer modes
Duration
2 hours. Time permitting the students can refine the program in the free time to go deeper into S/W performance profiling
List of material
H/W:
- 1 VMEbus crate
- The Pool does not seem to have enough usable 7-slot crates
- 1 CCT SBC
- 1 VMEbus D32/MBLT memory module (porbably a RIO2)
- 1 VMEbus display module VMDIS 8004
- 1 computer screen & keyboard
- Laptop with N/W connection is sufficient
S/W:
- Linux file system and gcc compiler / linker
- vme_rcc, cmem_rcc and io_rcc driver
- TDAQ RCD S/W (vme_rcc and related libraries)
Relevant Information
- The students have heard the lecture on modular electronics
- The students should have read:
Installation guide:
- Collect the H/W and turn the crate on.
- Make sure the SBC boots up. In case of problems contact the sysadmin. The SBC gets a Linux image from the central server.
- Log on with the DAQ school account (daqschool / daqsch00l) and use "lsmod" and "more /proc/xxx_rcc" to check if the drivers (vme_rcc, io_rcc and cmem_rcc) are loaded. The "proc" file of vme_rcc has to say that the Universe chip has been initialized
- Prepare the VMEbus slave (see below)
- Run "scanvme" and check if the memory module is seen at address 0x08000000
- Change directory to /exercise1/solution and run "make" to check if the example solution can be compiled
- Change directory to /exercise1/student and remove all files that may have been left by previous groups. Just keep the "makefile"
VMEbus slave preparation:
If the VMEbus slave of your set-up is a "RIOS 8061" you have to configure the mapping of the memory.
- Connect the RS232 cable to the "CONS." port (in terms of cables you need the RS232 adapter of the PBTM315 and the RS232-USB adapter)
- do not use a "NULL MODEM"
- Run the command "config" to chech the current configuration. You want this:
- A24 base disabled
- A32 base enabled. Base address = 0x08000000
- If you don't have this run the command "set vme"
- Configure VMEbus slave mapping. Take the default values for all parameters but:
- vme_slv_a24 = 0x0.d
- vme_slv_a32 = 0x08000000.e
Instruction sheet:
- Log on with the DAQ school account (daqschool / daqsch00l) and change directory to /exercise1/student
- Start an editor session (vi, nedit) and write a program that uses the vme_rcc library to execute the VMEbus cycles listed below:
- Write 0x12345678 to address 0x0 in A32 / D32 mode. Use the "safe" cycles
- Read the data back from address 0x0 and compare it
- Write 0x12345678 to address 0x4 in A32 / D32 mode. Use the "fast" cycles
- Read the data back from address 0x4 and compare it
- Write a block of 1 KB to address 0x1000 in A32 / D32 / BLT mode. You have to prepare the data in a cmem_rcc buffer.
- Read the data back in A32 / D64 / MBLT mode and compare it
- Watch the VMEbus transfers on the display module
Time permitting:
- Instrument your code with calls of the rcc_time_stamp library and measure the overhead of the transactions.
Solution
A coplete C-program is available in /home/daqSchool/exercise1/solution
Preparation of the exercise in Ankara
- Unpack the VMEbus crate and check if the modules are all looking OK
- Connect the upper RJ45 network port of the VP110 to the network. Make sure the server is switched on
- Connect the console RJ45 connector with the RJ45-DB9 adapter to the COM0 port of pcdaqschool1. "cd" to /kermit and run "rkermit .kermrc_vp110". Then type "connect". Switch on the VMEbus crate and check if you can see the messages from the BIOS of the VP110.
- Check if the VP110 boots OK
- unconnect the RS232 cable and set up a PC. This PC is required to "ssh" to the VMEbus SBC. It has to be connected to the DAQ school network. Linux is preferred. There has to be a program (xterm, etc.) that allows to "ssh" to the SBC. When the students execute this exercise they need this PC as well.
- Log on to the SBC via ssh and "cd" to "/home/daqSchool/exercise1/
- source "setup"
- "cd" to solution
- Execute "solution"
- report the result (screen output to Markus)
--
MarkusJoos - 2009-08-20