ClusterAlg.gif (577 bytes) The ATLAS Level-1 Calorimeter Trigger

[Home] [Architecture] [Meetings] [Participants] [Publications] [Software] [Search]


VIClib - A VIC8250 control library

Original Version by F Meiers(Cern)

Modified for LynxOs by Neil Geddes (RAL)

Documentation by Norman Gee (RAL)


VIClib is a collection of C callable functions allowing simple (basic) user control of VIC8250 operation. A set of utilities is provided to allow direct terminal access to the functions.

Command Utilities

Calling Sequences

Linking


Command Utilities

v50ground - initialise VIC.

Syntax

v50ground <base eg 8>

Description

Initialise the VIC at the specified local base address. The memory management unit and mailbox are cleared.

v50mmuena - enable VIC memory management unit.

Syntax

v50mmuena <base eg 8> <a24,a32,vsb>

Description

Enable the memory management unit of the VIC at the specified local base address for standard (a24) or extended (a32) addressing.

v50pagvme - map a remote crate.

Syntax

v50pagvme <base eg 8> <a24,a32,vsb> <page> <rmt-crate> <amod> <rmt-page>

Description

Map a 1-Megabyte page of address space (a24 or a32) in a remote crate to the specified local page. In the remote crate, VME cycles will use the specified address modifier (amod) regardless of the address modifier used in the local crate. Care should be taken to ensure that no other module in the local crate is using the same page.

v50pagmem - map remote VIC memory.

Syntax

v50pagmem <base eg 8> <a24,a32,vsb> <page> <rmt-crate>

Description

Map a 1-Megabyte page of remote VIC memory in a remote crate to the specified local page. Care should be taken to ensure that no other module in the local crate is using the same page.

v50show - display VIC settings.

Syntax

v50show <base eg 8>

Description

Displays the VIC settings. An example of the output following v50ground and after setting up mapping is shown below:
After V50ground...

ZCIO 0 A: 00 ........ B: F0 ++++.... C: 01 
ZCIO 1 A: 00 ........ B: 00 ........ C: 00 
ZCIO 2 A: 00 ........ B: 00 ........ C: 00 
ZCIO 3 A: 00 ........ B: 00 ........ C: 00 
crate 1 csrr    0 
online-broadcall 200 

After enabling mapping to remote crate with ...
v50mmuena 2 a24
v50pagvme 2 a24 c 9 39 c

ZCIO 0 A: 00 ........ B: F0 ++++.... C: 01 
ZCIO 1 A: 00 ........ B: 00 ........ C: 05 
ZCIO 2 A: 00 ........ B: 00 ........ C: 00 
ZCIO 3 A: 00 ........ B: 00 ........ C: 00 
A24 00C -> cr:9 am:39 00C sw:0 stat:00 
crate 1 csrr    0 
online-broadcall 200 
The first four lines give information from Zilog I/O controllers, each of which as three ports A, B, and C. For ports A and B both the hex value and the binary bit pattern are displayed.

Zilog 0: VIC Control & Status Register
port A:
Port B: Bits 0-2 Mailbox flags, bit 3 spare, bits 4-6 front panel switches SW01 SW03 SW05, bit 7 Terminator fitted.
Port C: Set to the VMV Crate number of this Vic as defined by the front panel rotary switch.

Zilog 1:VSB Control & Status Register
Port A: VSB to CSR address mapping (not used in MVME167 systems).
Port B: Internal buffer memory mailbox.
Port C: VMV and VME mapping logic enables.

Zilog 2:VME/VMV Interrupt Request Controller
Port A: VMV Vertical Demand bitmap, devfail and crates 1-7
Port B: VMV Vertical Demand bitmap, crates 8-15
Port C: VME IRQ level and interrupt enable

Zilog 3:VSB/VMV Interrupt Request Controller
Port A: VMV Vertical Demand bitmap, devfail and crates 1-7
Port B: VMV Vertical Demand bitmap, crates 8-15
Port C: VSB Window Mapping

If any mapping is enabled, a list is given. In the example, A24 addresses on local page C are mapped to remote crate 9 page C using address modifier 39.

The next line gives the VIC CSR contents. The last line gives a bitmap of online crates.

v50sysrst - reset remote crate.

Syntax

v50sysrst <base eg 8> <crate>

Description

Issue a VME system reset in the specified remote crate.

Calling Sequences

VicZgInit - Initialise Zilog I/O controllers.

Calling Sequence

#include "viccsr.h"

long VicZgInit(vicCsr)
struct vicCsr *vicCsr ;

Description

Initialize the four Z8536 controllers. The devices are first reset and at the end data ports are enabled, but interrupts are left disabled. Return Value: 0

VicMmuClear - Clear Memory Management.

Calling Sequence

#include "viccsr.h"

void VicMmuClear (vicCsr)
struct vicCsr *vicCsr ;

Description

Clear the memory management RAM.

VicMbxClear - Clear Mailbox.

Calling Sequence

#include "viccsr.h"

void VicMbxClear (vicCsr)
struct vicCsr *vicCsr ;

Description

Clear the Mailbox flags.

VicMmuCntrl - Read and Write MMU RAM.

Calling Sequence

#include "viccsr.h"

long VicMmuCntrl (vicCsr,fct,code)
struct vicCsr *vicCsr ;
long fct ;
unsigned long code ;

Description

Read and write the MMU RAM control bits in ZCIO dev 1 port C. Input: fct = type of access (0 = read, 1 = write 2 = OR existing content with code 3 = AND existing content with code code = MMU control bits Output: New MMU control bits or -1 on error.

VicVmvRstSet - Reset a Remote Crate.

Calling Sequence

#include "viccsr.h"

void VicVmvRstSet (pVicCsr,crate,val)
struct vicCsr *pVicCsr ;
int crate ;
long val ;

Description

Generates s VME Sysreset cycle in the specified crate. Any non-zero value will cause the reset to be generated.

VicMmuSetPageVme - Map a remote VME page to a local page.

Calling Sequence

#include "viccsr.h"

int VicMmuSetPageVme (vicCsr,space,page,crate,amod,rmtpage)
struct vicCsr *vicCsr ;                        
int space ;
unsigned long page ;
unsigned long crate ;
int amod ;
unsigned long rmtpage ;

Description

Maps a remote page to the local crate. See the v50pagvme utility for definition of arguments.

VicMmuSetPageBMem - Map Remote Vic Memory to a Local Page.

Calling Sequence

pagmem
#include "viccsr.h"

int VicMmuSetPageBMem (vicCsr,space,page,crate)
struct vicCsr *vicCsr ;                        
int space ;
register unsigned long page ;

Description

Maps a remote vic memory to the local crate. See the v50pagmem utility for definition of arguments.

Linking

Applications using the VIC8250 package must be linked with libvic8250.a