1.0 INTRODUCTION This is a discription of the operation of the list processing function of the RSX11M CAMAC driver. It has the following sections: 1. HOW TO GENERATE A LIST PROCESSING DRIVER 2. INPUT TO THE LIST PROCESSING PART 3. ERROR RETURNS 4. INTERNAL DATA STRUCTURES 5. DESIGN OF THE PROCESSING PART 2.0 HOW TO GENERATE A LIST PROCESSING DRIVER 3.0 INPUT TO THE LIST PROCESSING PART The purpose of the list processing CAMAC driver is to allow higher speed operations then is possable with the standard driver. This is done by providing a list of operations for the driver to do. This list must go to a DMA unit (an odd numbered unit) and as such must be legal DMA operations. Nondata transfer operations are accomplished by using a operation count of zero. The list processing part of the CAMAC driver works with two buffers. These buffers are the data buffer and the command buffer. Any operation in that occures compleatly in the data buffer is legal. Both the data buffer and the address buffer are addressed checked before the operation packet is queued to the driver. 3.1 Initeating a list operation To initeate a list operation, the following QIO is executed (standard system paramiters have been ommited). QIO$ IO.LPR,dma,,,,, Where: PAGE 2 1. dbufad is the data buffer address 2. dbufsz is the data buffer size in bytes 3. cbufad is the controll buffer address 4. dbufsz is the control buffer size in bytes 5. dma is a DMA CAMAC unit 6. IO.LPR is 3001 octal The status return from this operation is described in the error section. If either buffer violates the address check, the operation is aborted, and an error is returned in the $DSW word and carry will be set. 3.2 Format of the CAMAC Operation Packit List The CAMAC Operation Packit List (COP List) is a table of COPs which is terminated by a word of zero. Each COP in the COP List is made up of two parts; a mandtory part, and a optional part. 3.2.1 The mandatory part - Each COP must have the following format: **************************************** * BYTE COUNT ! FLAG BYTE * **************************************** * CRATE SELECT WORD * **************************************** * EXTENDED WORD COUNT WORD * **************************************** * FNA WORD * **************************************** **************************************** * OPTIONAL DATA * **************************************** 1. The byte count is used to index to the next COP as COPS are of variable length. 2. The type byte indicates the options that are included in the optinol part of the COP. 3. The crate select is the word that will be put in the corrosponding interface register. 4. The extended word count is the word that is put in the PAGE 3 corrosponding interface register 5. The fna word is the word that is placed in the corrosponding interface register. 3.2.2 Optional part - The optional part is controlled by the type byte in the mandatory part. This part contains information that is needed to do special operations on the list. The type byte has the following bit encodings: 1. bit 0= buffer offset requested 2. bit 1= do an station subaddress check on the compleated operation 3. bit 2= execute this COP some number of times. 4. bit 6= ignore CAMAC timout (T02) 5. bit 7= ignore crate overflow indication This byte is examined from the LSB to the MSB, and if the encoding exists, the optinal part is assumed to have the apreopreate data. The format for the data in the optinal part with respect to the type byte encodings is given below: 1. bit 0= byte in buffer to place first word of data read in. If this bit is not set, the data will be appended onto the data just finished. Initally, data will be placed starting at the first word of the buffer. If this bit is set, the word value must be even and less then the size of the data buffer. 2. bit 1= expected crate, station, and subaddress of the driver after the operation. This word has the following format ( where indicate the number of bits in the field and the starting bit of the field. i.e. <16:0> is a word, <8:0> is even byte, <8:8> is odd byte): subaddress <4:0>, station <5:4> end crate mask <7:9> 3. bit 2= request for repeat count. The corrosponding word contains the number of repatitions. 4. bit 6= ignore CAMAC time out . If this bit is set, no errors will be produced from a CAMAC timeout (T02). 5. bit 7= ignore crate overflow indication. If this bit is not set and a crate overflow occures, an error will occure. PAGE 4 PAGE 5 4.0 ERROR RETURNS f an error occures and if an IO status block was specified in the QIO, an error indication will be returned. The IO status block has the following format: **************************************** * PKT CNT ! RETURN CODE * **************************************** * USER SELECTED VALUE * **************************************** The return codes are: 1. IE.VER 2. IE.BAD 3. IE.ONP 4. IE.END= end fault, where end CNA was not the one expected. 5. IE.OVR= an attempt was made to access outside of the buffer 6. IE.CVF= unexpected crate overflow occured 7. IE.IMP= 18 bit address calculation error (imp indicates impossable). 8. IE.CT2= CAMAC time out error. 9. IE.JER= Jorway interface error (detected by check on calculated number of bytes transfered vs. actuall number of bytes transfered.) If this occures the UCB is marked offline as the interface is not working. The PKT CNT is the number of the packet that was being processed at the time of the error. The user selected value is any provided by the standard driver. PAGE 6 5.0 INTERNAL DATA STRUCTURES The following is the data structure for the list processing driver in the UCB above thos already used by the standard driver: **************************************** U.EEND * EXPECTED END LOCATION * **************************************** U.FLAG * FLAG WORD (LOW BYTE COP FLAG) * **************************************** U.DBBR * BYTES REMAINING IN DATA BUFFER * **************************************** U.LNPR * LAST 18 BIT ADDRESS OF * **************************************** * JORWAY ADDRESS POINTER * **************************************** U.CBSZ * BYTES IN CONTROLL BUFFER * **************************************** U.CBRL * RELOCATED ADDRESS OF CONTROL BUF * **************************************** * * **************************************** U.COPC * COP COUNT * **************************************** U.REPT * REPATITION COUNT FOR COP * **************************************** U.BYTR * BYTES TO BE TRANSFERED * **************************************** PAGE 7 6.0 DESIGN OF THE PROCESSING PART The initalization part for the first trnasfer of a COPL. MODULE LISTINI BEGIN FIRST=TRUE; MAP TO CONTROLL BUFFER; SETUPL(); INTERUPT ENABLE=TRUE; EXCTFN(); UNMAP FROM CONTROL BUFFER; END; ELUDOM LISTINI MODULE SETUPL BEGIN IF (BUFFOFSETREQ OR FIRST) THEN BEGIN IF (BUFFOFSET) THEN BEGIN IF (BUFFOFSET GT U.CNT) THEN (ERROR); U.LNPR=U.BUF+BUFFOFSET; U.DBBR=U.CNT-BUFFOFSET; END ELSE BEGIN U.LNPR=U.BUF; U.DBBR=U.CNT; END; FIRST=FALSE; LOADAD=TRUE; END; IF (ENDCK) THEN (U.EEND=ENDNA); IF (REPT AND (U.REPT EQ 0)) THEN (U.REPT=REPTCNT); IF (U.REPT EQ 0) THEN (U.REPT=1); IF (EXWC<12:0> NE 0) THEN BEGIN U.BYTR= -(170000 OR EXWC)*2; IF (24BITMODE) THEN (U.BYTR=U.BYTR*2); U.DBBR=U.DBBR-U.BYTR; IF (U.DBBR LT 0) THEN (ERROR); END; U.FLAG<8:0>=FLAG; END; ELUDOM SETUPL MODULE EXCTFN BEGIN PAGE 8 IF (LOADAD) THEN (J411ADD=U.LNPR; LOADAD=FALSE); J411CS=CRATESELECT; J411EXWC=EXTENDEDWORDCOUNT; J411FNA=FNA ! ! AT THIS POINT THE CAMAC OPERATION STARTS ! U.REPT=R.REPT-1; IF (U.REPT EQ 0) THEN BEGIN ADVANCE CONTROLL BUFFER POINTER U.COPC=U.COPC+1; END; END; ELUDOM EXCTFN MODULE INTERUPT BEGIN MAP TO CONTROLL BUFFER; WHILE (OPERATION COMPLEATE) DO BEGIN CLEAR J411 INTERUPT ENABLE AND SEQUEUCER ERRCK(); IF (DONE) THEN ( U.COPC=U.COPC-1; FORK); SETUPL(); INTERUPT ENABLE=TRUE; EXCTFN(); END; UNMAP FROM CONTROL BUFFER; INTEXIT; END; ELUDOM INTERUPT MODULE ERRCK BEGIN IF (J411CROV AND NOT CRTOVOK) THEN (ERROR); IF (J411T02 AND NOT T02OK) THEN (ERROR); IF (ENDCK) THEN BEGIN IF ((U.EEND AND 777) NE (J411FNA AND 777)) THEN (ERROR); IF ((U.EEND AND 177000) NE (J411CS AND 177000)) THEN (ERROR); END; IF ((J411EXWC AND 7777) EQ 0) THEN (NBYTES=0) ELSE BEGIN NBYTES= -(170000 OR J411EXWC)*2; IF (MD24) THEN (NBYTES=NBYTES*2); END; U.DBBR=U.DBBR+NBYTES; U.BYTR=U.BYTR-NBYTES; U.LNPR=U.LNPR+U.BYTR; PAGE 9 IF (U.LNPR NE J411MADR) THEN BEGIN SET UCB OFFLINE; ERROR; END; END ELUDOM ERRCK