The Prototype of a VME-Based Front-End System for the T-C Factory
Control SystemF. Zhang J. Zhao
Institute of High Energy Physics,Chinese Academy of Sciences
P.O.Box 918(10) Beijing 100039,China
Abstract

2.2 Software

The VME-based prototype is aimed at researching somebasic technical matters in the front-end system of the T-Cfactory control system. Hardware and software aspects ofthe prototype system will be described in this paper. In
particular, we will discuss the embedded system generator:
vmexgen, network download, multiprocessor operation,VMEbus address space, interrupt service routines(ISR),
I/O device driver and VMEexec Network Environment(VNE). Finally, a VMEbus-based parallel processing
system will be discussed.

The software of the prototype consists of UNIXSYSTEM V and the Motorola VMEexec software package
which is a real-time system development environment
based upon a host running on a VMEmodule-driven
SYSTEM V operating system. It provides a comprehensive
set of board support and an I/O driver package forMotorola`s line of VME boards. The Application Program
Interface (API) of VMEexec is shown in figure 2.
Real-time1 Introduction

Xlib

The Beijing Tau-Charm Factory(BTCF) is a newelectron-positron collider project which has a luminosity
which is a hundred times higher than that of BEPC. Its
beam energy is 1.5 to 3 GeV. The BTCF will serve highenergy physical experiments. Its front-end system consistsof FECs(Front-End Computers), I/O devices and real-time
applications running on the FECs. The FECs connectedwith Ethernet or VMEbus access the I/O devices via theVMEbus or VMEbus-field bus interfaces. The basic
technical matters in the front-end system of the T-C factory
control system will be described in the following
paragraphs.
2 Structure of the prototype system
2.1 Hardware
In the prototype system shown in figure 1, a MVME187
host, two MVME162 targets and some I/O boards areassembled in one VME chassis. Both, the MVME187 andthe MVME162 have on-board Ethernet interfaces. Because
they can be assigned to different logical chassis in theVMEexec software package even though they locate in thesame chassis, the prototype system can support both,
VMEbus-based and network-based configurations.

Xterminal

application

MVME712SVIDlib
pSOS+
VMEexec system service

I/O device driver

hardwareFigure 2. The application program interface of VMEexec
3 The basic technical matters
3.1 vmexgen
Vmexgen is the process used to select and makemodifications to VMEexec configurations, define thestructure of the system, create VMEexec target kernels
based on the selected configurations. The kernels generated
by vmexgen will be the run-time environment of thecorresponding real-time application. Each of the following
technical aspects has its own vmexgen configuration.
3.2 Network download
Network download refers to VMEexec kernels and realtime applications downloading from host to target overEthernet. The network downloads usually fall into twogeneral categories: active and passive.

UNIXVMEexec

pSOS+

pSOS+

MVME187
HOST

MVME162
target 2

MVME162
target 3

VMEbusFigure 1. Structure of the prototype system

MVME512
I/O boardIn the case of active downloads, the targets initiate thenetwork download process after the targets’ reset or powerup. With the network download information which ispredefined in the targets’ NVRAM, the on-board Ethernet
interface and the tftp function of the on-board ROM, thetargets download their real-time kernels and applications,then start the real-time applications.
In the case of passive downloads, the targets boot fromthe local ROM and start a network download assistanceprocess. With this process, the host command gload can beused to download the corresponding real-time kernel andapplication to the targets.
The network download assistance process can bedownloaded through the active way, or be written in
EPROM and inserted in the socket of the target.
If there is no Ethernet interface on a target, its kernel andapplication can be indirectly downloaded with the assistantof another target which stays in the same VME chassis andhas an Ethernet interface. It must be noted that only thepassive style can be used in this condition, because thenetwork download assistance process can provide theindirect download service, but the tftp function can`t.
3.3 Multiprocessor operations″Multiprocessor operations″ means that tasks that makeup an application can reside on several targets and stillexchange data and synchronize execution as if they wererunning on a single processor. The pSOS+ defines a seriesof global objects which can be reached or referenced fromany target in the system. The global object classes include
task, event, memory partition, message queue andsemaphore. Using global objects, pSOS+ provides amechanism
ofparallel
processing
based
onmultiprocessors. For example:•Multitask scheduling based on multiprocessors wasrealized using a global task.
•Multitask synchronizing based on multiprocessors
was realized using a global event and/or semaphore.
•Exchanging data between tasks runing on different
processors was realized using a global message queue.
•Dual-ported memory was realized in VMEbus-based
systems using global memory partitions which is only
meaningful in tightly(i.e. , memory) coupled systems
and global message queues.
Because VMEexec provides a software layer hiding thehostMVME187
VMEbus mastercommunication media features, the implementation ofmultiprocessor operations based on VME and Ethernet
have the same synopsis.
3.4 VMEbus address space, Interrupt Service Routines(ISR) and I/O device driver
Because the VMEbus has address lines A00-A31, it’saddress space ranges is from $0 to $FFFFFFFF. InVMEbus-based multiprocessing systems, each board, as aVMEbus slave, occupies a section of the VMEbus address
space. The board with the master functional module canaccess the VMEbus address space[5]. The VMEbus
address space of the prototype system is shown in figure 3.
The host`s VMEbus address space access is forbidden.
Because each MVME162 can be the VMEbus masterand/or slave, their 4MB shared DRAMs are accessible foreach other, which is the hardware environment of global
memory partition operations. MVME512 is a VMEbus
slave which occupies 1KB section of the VMEbus address
space. Targets can control actions of the MVME512 andread the A/D data by accessing the 1KB VMEbus address
space.
Interrupt Service Routines(ISR) are critical to any realtime system. Two interrupts are generated and handled inthe prototype system. One is the VMEchip2 Tick Time 1
interrupt which is generated and handled by theMVME162. The other is the VMEchip2 VMEbus IRQ3
interrupt which is generated by the MVME512 andhandled by the MVME162 through the VMEbus IRQ3line. We use the VMEexec system service claimvct todeclare the entry address and another parameters of theISRs in both ISR implementations.
A device driver handles requests made by the pSOS+
kernel with regard to a particular type of device. ThepSOS+ furnishes a device-independent, standard methordfor integrating drivers into the system and for the user`sapplication to call these drivers. We have realized twodrivers, one for the A/D board MVME512, another for thedigital board MVME510, and integrated them into the thesystem. By isolating device-specific code in a device driverand by having a consistent interface to a kernel andapplication, adding a new device and performing I/O
operations is easier. The I/O device driver is the base ofthe control software in large scale real-time systems.

target 2
MVME162

target 3
MVME162

VMEbus master/slave

VMEbus master/slave

I/O board
MVME512
VMEbus slave

VMEbusthe prototype's
VMEbus slave
address space$0

global memory
partition$2000000

host (node 1) 32MB

$2400000

node 2$FFFFFFFF

VMEbus accessprotection

4MB

no used$3C00000

node 3$FFFF0000$FFFF03FF$4000000

4MBMVME512

Figure 3. The VMEbus address space of the prototype system

1KB

X windows
application

Local terminal
applicationNetworkcommunication

Real-time I/O applications

Daul-ported memory
andGlobal semaphores

I/O device
drivers

Interruptor

ISR

ISR

Interruptor

target 2

VME-based

I/O
modulestarget 3

Figure 4. The software architecture of the VMEbus-based parallel processing system
3.6 VMEexec network environment(VNE)
The VNE server task provides a socket interface for thecommunication between VMEexec targets and computerswhich run different operating systems with the TCP/IP
protocol. We ran a pair of sending and recieving
applications in two conditions. In both conditions, theUNIX socket interface is used by the host`s receiving
application.
•In the first condition, the sending application and theVNE server task just reside in target 2.
•
In the second condition, the VNE server task resides
on target 2 and the sending application resides ontarget 3. The VNE socket interface used by target 3
transparently used a Remote Procedure Call (RPC)
mechanism to communicate its requests to the VNE
server residing on target 2 via the VMEbus.

network communication applications. Target 3 performs
real-time I/O operations through I/O device drivers. Twotargets exchange data and sychronize their operations
through daul-ported memories and global semaphores. Theinterruptors and the ISRs reside on both targets toaccomplish some critical operations related with the twotargets. In this VMEbus-based parallel processing system,
the performance of the real-time embedded applications isscaled beyond the capabilities of a single CPU.
5 Current status
With the prototype system, the network download,
multiprocessor operations, ISRs, I/O device driver andnetwork communications through the VNE socket interface
have been realized. In the R&D stage of the BTCF, a SUN
workstation, the VxWorks operating system and the EPICS
software tool kits will be installed in our system to develop
the control system of BTCF.

4 The VMEbus-based parallel processing system
The VMEbus-based parallel processing system includes
two MVME162 modules and several high performance I/O
modules. All these modules are assembled in one VME
chassis. The tasks of the system include the X Windows
man-machine interface, local character terminalapplications, network communications, and real-time I/Ooperations.
Because the system includes several high performance
I/O modules, such as the MVME512 with a A/Dconversion time of 33µs, and because the system isrequired to fully use the performance of the I/O modules,
the first MVME162 runing the real-time I/O operations
bears a heavy load. The second MVME162 must be added
to share other tasks. The software architecture of thesystem is shown in figure 4.
Target 2 runs X Windows, the local terminal andReferences[1] VMEexec User`s Guide,” by MOTOROLA ComputerGroup.
[2] pSOS+/68K Real-time Executive User`s Guide,” byMOTOROLA Computer Group.
[3] VMEexec System Services User`s Guild,” by
MOTOROLA Computer Group.
[4] VMEexec Networking Environment User`s Guild,” byMOTOROLA Computer Group.
[5] THE VMEbus SPECIFICATION, by VMEbus
International Trade Association.
[6] MVME162 Embedded Controller Programmer`sReference Guild,” by MOTOROLA Computer Group.
[7] MVME512-003 and MVME512-004 User`s Manual,by MOTOROLA Computer Group.