|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 18432 (0x4800) Types: TextFile Names: »camac«
└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system └─⟦72244f0ef⟧ └─⟦this⟧ »camac«
>a1 GENERAL DESCRIPTION The NE 9030 - 9039 Interface creates a physical link between an RC3600 computer and a CAMAC System by direct attachment. The CAMAC Driver Process handles the channel interface hardware, the MUS/DOMUS system interface, and a CAMAC module dependent emulation. The CAMAC driver is able to transfer data to and from a CAMAC System emulating almost any CAMAC module. A maximum of 255 different devices can be emulated simultanously. The driver consists of 3 logical parts: a) An interrupt service which handles CAMAC interrupts. b) A driver monitor which acts as central logical for a number of dynamically created device coroutines. c) A device emulator which consists of a number of device coroutines, each executing a device emulator program. When the CAMAC driver is loaded it starts in an idle, offline state without any CAMAC device numbers defined. Application programs that want to use a device number (a device is a logical set of CAMAC modules) send a conversion message to the CAMAC driver defining the device address, the address of the emulator program, and a storage area to be used by the driver as device descriptor for the device (coroutine descriptor). From this moment the emulator program will gain control whenever a message for this device is received. The device program, which is excecuted by the emulator in the driver, interpretates the CAMAC requests, controls data and status transfers, and accepts and answers messages from application programs. >a1 MESSAGES Control, input, and output messages are accepted. Normally mess0 (0 : 7) specifies the device number. Normally at return mess2 (8 : 15) contains the device number. >a2 Control Messages Reservation, Conversion, Termination, and Disconnect are executed but mutual exclusive. Any other control message is accepted and answered with zero status but has no effect. >a3 Conversion This message is used to include an emulated device as a legal device. Mess0 (0 : 7) is ignored and mess2//2 is used as a wordaddress of a 32 word storage area to be used by the driver as device descriptor (coroutine descriptor) for the device. If mess2 is zero, or the device is legal already, the message is answered with status illegal. The two words EMDEV and EMPGM in the device descriptor area must be defined. For a detailed description of the device descriptor, see 4.1. The answer is returned with zero status after END, termination message, or break. >a3 Termination The device with device number in mess0 (0 : 7) will be excluded as legal device, the device coroutine removed, and the device descriptor area released. All pending messages for the device (including the conversion and the termination message itself) are returned with status: em. If the device number specified in mess0 is unknown, the termination message is answered with status: illegal. >a3 Release (Reservation and mess1 = 0) If the device number specified in mess0 is known the message is treated as a termination, else it is checked for disconnection. >a3 Disconnect The interface is initialized, the driver is initialized, all pending messages are returned with status: offline. >a2 Transput Messages Transput messages are handled by the relevant device emulator rather than the driver itself. The device number is specified in Mess0 (0 : 7). Contents of Mess1, Mess2, and Mess3 are defined by and answers are returned by the emulator program. When a transput message arrives, the driver verifies that Mess0 (0 : 7) contains a legal device number. If the device number is legal the device emulator is notified, if not, the message is returned with status: illegal. >a1 BREAK AND FIXED STATUS The break action which is also used for initialization is described in section 2.1.4. The following is a list of the status that may be generated by the driver. In addition to this the emulator may generate any status. 1B0 Disconnect or break received. 1B1 Off-line, the interface mode has changed from on-line to off-line. 1B6 Illegal, the device number specified in Mess0 (0 : 7) is illegal. 1B11 End medium, the buffer was found in the driver event queue when the device emulator was removed by a termination message. 1B10 Parity error. An error occured during last received data operation. >a1 DEVICE EMULATION In order to facilitate flexibility the device dependent driver reactions towards the CAMAC interface is not defined in the driver but in an individual device emulator program for each device. An emulator program consists of emulator instructions and the driver can be considered as a small computer excecuting these emulator instructions multiprogrammed (scheduled as coroutines). Each emulated device may have its own emulator program or an emulator program can be shared among several emulated devices. In the latter case normal rules for reentrant programs must be obeyed. Each emulated device is defined by a device descriptor which serves as a coroutine descriptor. >a2 Device Description Each device description consists of a 32 word (decimal) area supplied by the application program that wants to communicate with the CAMAC equipment. The following is a description of layout, contents, and usage of this area: DISPLACE- NAME CONTENTS AND MENT USAGE (in words) +0 EMNEXT Used by the driver process for queuing the device de- scriptors. +1 EMDEV CAMAC device code. 0 < EMDEV<=255. This must be defined by the user. +2 EMPGM Address of the emulator program. This must be defined by the user. +3 EMPC Emulator program counter. Used by the driver process. +4 EMAC Emulator Accumulator. Sometimes used by the driver process. +5 EMRA Emulator subroutine return address. Used by the driver process. +6 EMCAUSE Emulator waiting causes. When the emulator program is waiting for some events these are re- presented by bits in this variable. When the emulator program is star- ted after waiting the starting reason(s) are specified in this variable. +7 EMREASON This variable is used by the driver process to buffer events from their occurence to the emulator can be started. +8 EMBUF Address of current buffer or zero. +9 AMADR EMBUF. Mess2. Set when a buffer is accepted by the emulator. +10 EMCOUNT EMBUF. Mess1. Set as MADR. +11 EMSPEC Used by the driver process when the emulator accepts a buffer EMSPEC is set to EMBUF. Mess3. +12 EMTIMER Used as timer count when waiting. Decreasing one per 0.1 sec. +13 EMHOME Address of conversion buffer. +14 EMCHAIN Used by the driver logic to chain together with the device descriptors. The last device descriptor points to 0. +15 EMLINK Saved coroutine PC. +16 EMSUB Subroutine return address. +17 EMSEM Semaphore. +18 EMNOTE Set by WAIT to point to a received note (signalled to EMSEM). +19 EMLAM Set by WAIT to point to a crate entry. +20 EMCRATE Crate number. Branch *256 + crate no. +21 EMSTAT Station no. +22 EMQX Q, X status. >a2 Emulator Programs and Instructions An emulator program is a core area containing emulator instructions. Two addresses are fixed in emulator programs: EMP + 32 The emulator program counter program EMPC is set to this address whenever the emulator is started or restarted. >ul Addressing Two types of addressing are used in emulator programs: Program and Relative. Program addresses are integers greater than or equal to 32. These are used as word displacements in the emulator program. Relative addresses are integers less than 32. These are used as word displacements in the device description. Integer procedure cont (addr); integer addr; begin cont: = if addr < 32 then core (addr + cur device) else core (addr + cur emulator program); end; This means that storage addresses cannot be absolute addressed, i.e. the MUS monitor constants cannot be used, instead constants must be defined locally in the emulator program. This means that program addresses less than 32 cannot be addressed. It also means that program addresses less than 32 cannot be addressed. It also means that the program may be located in address cur device + 32. >ul Instructions Emulator instructions occupies one or more words of storage. The first word always contains the instruction code. The following is a description of format, name, and function of all the emulator instructions. In the following core (addr) means contents of the storage word with address addr + EM and cont (addr) means 'contents of' using the addressing described above. EM means address of current emulator program. DEV means address of current device descriptor. Undefined instructions works as END. >ul Direct execution If necessary the emulator program may be programmed in assembler. If the first instruction in the emulator program is a "JMP .+1" (octal value 401), then the emulator program is executed direct i.e. not via the emulation process. >np >ul ?GOGO 0 addr EMPC:= if addr <0 then DEV + addr else if addr <32 then core (DEV + addr) else EM + addr; In this case core (DEV + addr) is used as absolute address. >ul ?IFGO 1 op 1 op 2 addr If cont (op 1) = cont (op 2) then ?GOTO (addr); EMPC:= EMPC + 4; >ul ?IFAN (if and nonzero then goto) 2 op 1 op 1 addr If cont (op 1) and cont (op 2) <> 0 then ?GOTO (addr); EMPC:= EMPC + 4; >ul ?WAIT 3 cause timer addr EMPC:= EMPC + 2; EMCAU:= cause; EMTIMER:= TIMER WAIT; (EMCAUSE, TIMER, label) EMCAUSE:= starting reasons; If ECAUSE and WSIGNAL <> 0 the EMNOTE points to the received signal. < * WAIT is a function of the internal driver monitor * >. If EMCAUSE and @@@@@@@kan ikke læses.! >ul ?SIGN (signal to a queued semaphore) 4 devno noteaddr EMPC:= EMPC + 3; EMAC:= rate:= cont(note) SIGNAL (devno, note) < * SIGNAL is a function of the internal driver monitor. Devno must be a legal device. >ul ?CALL (subroutine jump) 5 addr EMSUB:= EMPC + 2; ?GOTO (addr); >ul ?RESE (reserve LAM source) 6 lamref addr EMPC:= EMPC + 2; RERSERVELAM (EMCRATE cont (lamref)); < * this instruction inserts current device as a user of the mentioned LAM source, identified by EMCRATE and station number * > >ul ?RELE (release LAM source) 7 lamref addr EMPC:= EMPC + 2 RELEASELAM (EMCRA cont (lamref)); < * this instruction releases the LAM source * >. >ul ?MOVE 8 fromaddr toaddr length < * MUS procedure move is used * > move (cont(length), conttoaddr), cont(fromaddr)); EMPC:= EMPC + 4; >ul ?MIX (move from array) 9 base index toaddr EMPC:= EMPC + 4 addr: cont (base) + cont (index); if toaddr < 32 then core (DEV + toaddr):=core (addr) else core (EM + toaddr):= core (addr); if index < 32 then core (DEV + index): = cont (index +1 else core (EM + index): = cont (index +1; >ul ?ADD (addition) 10 op 1 op 2 result EMPC:= EMPC + 4; if result < 32 then core (DEV + result): = cont (op 1) + cont (op 2) else core (EM + result): = cont (op 1) + cont (op 2); >ul ?DJNZ (decrement, jump if not zero) 11 op addr EMPC: = EMPC + 3; v: = cont (op) -1; if op < 32 then core (DEV + op): = v else core (EM + op): = v if v <> then ?GOTO (addr); >ul ?GETI (get input buffer) 12 EMPS:= EMPC +1; buf:= cur.event; EMBUF:=0, for buf:= buf. next while buf <> cur.event do if buf. Mess0 (0 : 7) = EMDEV and buf.Mess0 and 3 = 1 then begin EMBUF:= buf; EMADR:= BUF.MESS2; EMCOU:= BUF.MESS1; EMSPEC:= BUF.MESS3; EMAC:= EMAC:= EMADDR/2; END; >ul ?GETO (get output buffer) 13 EMPC:= EMPC + 1; buf:= cur.event; EMBUF:= 0; for buf:= buf.next while buf <> cur.event do if buf. Mess0 (0 : 7) = EMDEV and buf Mess0 and 3 = 3 then begin EMBUF:= buf; EMADR@ =: BUF.MESS2; EMCOU@ =: BUF.MESS1; EMSPEC =: BUF.MESS3; EMAC@@@=: EMADR/2; END; >ul ?RETB (return buffer) 14 status EMPC:= EMPC + 2 EMBUF.mess3:= EMSPEC; EMBUF.mess2:= EMDEV; count:= EMCOUNT; sendanswer (status, count, EMBUF); >ul ?END (end activity) 15 < * return conversion message and remove this emulator program Instruction codes 16 - 24 are reserved for CAMAC actions. >ul Single actions 16 SA Single action, any F-code. 17 SJQ Single action branching on Q = 1. 18 SJNQ Single action branching on Q = 0. >ul Uni device block actions (may be implemented later) Transfers a datablock to or from I CAMAC address. Terminated by 1) Number of CAMAC functions. 2) Block length. 3) Q = 0. 4) Error condition. 19 UBL LAM-synchronized. 20 UBC Controller-synchronized. 21 UBK Repeat while not Q. >ul Multi device actions (may be implemented later) Using the same F-code for more CAMAC addresses. Terminated by 1) Number of CAMAC functions. 2) Blocklength. 3) Error condition. 22 MA Using address array. 23 MNQ Repeat while not Q. 24 MAD Using a Q-scan set (ref. 3, 5.13). >ul ?SA (single action) 16 f-code ext data EMPC:= EMPC + 4 < * selects crate EMCRATE station and subaddress are cont (ext) function:= F-code; data is byte address of data to transfer for read and write. Room for cont bytes * >. >ul ?SJQ (single action, jump on Q = 1) 17 f-code ext data count addr EMPC:= EMPC + 5 ?SA (f-code, ext, data); if EMQX and 2 <> 0 then ?GOTO (addr); >ul ?SJNQ (single action, jump on Q = 0) 18 f-code ext data count addr EMPC:= EMPC + 5; ?SA (f-code, ext, data); if EMQX and 2 = 0 then ?GOTO (addr); >a1 TESTOUTPUT The CAMAC Driver exists in two versions, one with and one without test output facilities. The following section describes the dynamic control of test output generation and the test output record format and is relevant only for the driver version with these facilities. Test output records, when generated, are stored cyclical in a 252 word core buffer located at the button of the driver process descriptor. A 4 word area in the process descriptor describes whether and where test output records are stored: CAMAC + TSOUT ; test output conditional ; 0 no test output ; 1B15 interrupt records stored ; 1B14 emulator records stored ; 1B13 comonitor records stored CAMAC + TSFIR ; test output buffer first word CAMAC + TSTOF ; test output buffer top word CAMAC + TSNXT ; test output buffer next word Test output generation is controlled dynamically by the front panel, switch settings with the same bits as TSOUT above. In order to generate a certain type of test output records the corresponding bit must be set in both TSOUT and fron panel switches. Four types of test output records are possible, the first word of all records defines the type: >ul Emulator records -1 EM EMPC instr. where LAM1 is error ,Q,X,LAM(24:17) LAM0 is LAM(16:1) CRATE is crate register 3 This record is stored at entrence of the interrupt service. >ul Comonitor records >ul WAIT record -3 EM EMCAUSE where EM is the addr. of the device description EMCAUSE is EM.EM CAUSE This record is stored at entry to the coroutine monitor function: WAIT. >ul START record -4 EM EMCAUSE EMREASON where EM is the addr. of the device description EMCAUSE is EM.EM CAUSE EMREASON is EM.EM REASON This record is stored before exit from the coroutine monitor function: START. >a1 CAMAC PARAMETERS This section contains a listing of the CAMAC Parameters. These parameters should be assembled ahead of any source using symbolic names of CAMAC driver displacements, i.e. emulator programs, test output processes, the driver itself etc. >a1 EXAMPLE This section contains a sample emulator program and application program emulating a NE 9030 - 9039 equipped with a NE 9068 Digital voltmeter. ▶EOF◀