
*************************************************************************
*                                                                       *
*                          LEVEL 1 TRIGGER                              *
*                       VBD  DATA_CABLE_DRIVER                          *
*                                                                       *
*                  VERSION: 2       DATE:  12-APRIL-1991                *
*                ----------------------------------------               *
*                                                                       *
*                For Use with January 1991 COMINT PROM's                *
*              -------------------------------------------              *
*                                                                       *
*************************************************************************

*************************************************************************
*                                                                       *
*             MODIFICATION - ADDITION                  DATE      NAME   *
*   ----------------------------------------------   ---------   ----   *
*                                                                       *
*************************************************************************

***************************************************************************
*                                                                         *
*    Address Map of the Level 1 Trigger VME Crate (133A's view)           *
*                                                                         *
*        0000 0000  through  000F FFFF     133A Module Memory             *
*        0030 0000  through  0030 7FFF     VME 214 Module for Trig Block  *
*        0038 0000  through  003F FFFF     VBD Buffer Memory              *
*                                                                         *
*        FFFF 9000  through  FFFF 97FF     Short 214 IO Space Memory      *
*        FFFF A000  through  FFFF BFFF     VBD Control Memory             *
*        FFFF C000  through  FFFF C0FF     Crate ID Register Card         *
*        FFFF F000  through  FFFF F00F     Ironics 1623 Digital IO Card   *
*                            FFFF ????     Vertical Interconnect Reg.     *
*                                                                         *
*                                                                         *
*  The following is a list of the memory locations that will be used in   *
*  the VME-214 Memory module.   Recall that this module lives in VME      *
*  addresses $00300000  through  $00307FFF.                               *
*                                                                         *
*      VME Address Range                     Contents                     *
*  ---------------------------      --------------------------------      *
*  $00300000 through $00300FFF       Current Beam Crossing Data           *
*  $00301000 through $00301FFF       Previous Beam Crossing Data          *
*                                                                         *
*  $00301FB8 through $00302          Specific Trigger Programming vs      *
*                                    Ref Sets and Spec Trigs Fired Data.  *
*                                                                         *
*  $00304000 through $003040FF       Central Detector Pulser Data         *
*  $00304100 through $003041FF       Calorimeter Pulser Data              *
*  $00304400 through $003047FF       CAMAC Data                           *
*                                                                         *
*  $00305000 through $0030501F       Crate Header data 5 longwords        *
*                                                                         *
*  $00306000 through $003069FF       The VBD reads the Current Beam       *
*                                    Crossing CTFE Data from here.        *
*  $00307000 through $003079FF       The VBD reads the Previous Beam      *
*                                    Crossing CTFE Data from here.        *
*                                                                         *
*  $00306B00 through $00306C03       EM Et Jet List stored here           *
*                                    for the VBD to read.                 *
*  $00306D00 through $00306E03       Total Et Jet List stored here        *
*                                    for the VBD to read.                 *
*                                                                         *
*                                                                         *
*         List of VBD DMA sections used to build the data block           *
*                                                                         *
*  Length in Bytes    VME Starting                                        *
*  Decimal    Hex      Address Hex            Contents                    *
*  ---------------    ------------    ---------------------------------   *
*    1064    $428        $300004      Current Framework, Cal Trig Final   *
*                                     Sums, L0 Vertex, and L1.5  data     *
*                                                                         *
*    2560    $A00        $306000      Current Cal Trig EM Et and HD Et    *
*                                                                         *
*    1064    $428        $301004      Previous Framework, Cal Trg Final   *
*                                     Sums, L0 Vertex, and L1.5  data     *
*                                                                         *
*    2560    $A00        $307000      Previous Cal Trig EM Et and HD Et   *
*                                                                         *
*     260    $104        $306B00      EM Jet List                         *
*                                                                         *
*     260    $104        $306D00      Total Et Jet List                   *
*                                                                         *
*    1280    $500        $300830      Mask of Jet Patterns  "Jet Mask"    *
*                                                                         *
*     640    $280        $301E74      TRD Hot Tower Table Information     *
*                                                                         *
*     100     $64        $301FB8      Specific Trigger Programming Infrm  *
*                                                                         *
*     512    $200        $304000      Pulser Programming Data, 2 groups   *
*                                     of 64 longwords each, transported   *
*                                     by but not part of the L1 Trigger   *
*                                     Data Block. Central and Calorimeter *
*                                                                         *
*     256    $100        $304400      CAMAC Data about less then 100      *
*                                     longwords.  Transported by but not  *
*                                     part of the L1 Trigger Data Block.  *
***************************************************************************

***************************************************************************
*                                                                         *
*                                                                         *
*    Program Outline:                                                     *
*                                                                         *
*       1. Get the Version Number and the Rivision Numbers                *
***************************************************************************

VBDDRV2  IDNT                          ; title.
         ORG     $95000                ; start of code (MVME133A).

         JMP     STRINT                ; Jump to the start of initialization.

*************************************************************************
*  This sections calls all of the include files.                        *
*                                                                       *
*  68020_EQUATES.INC defines macros to be used to call MVME133ABUG ROM. *
*                                                                       *
*************************************************************************

        INCLUDE  68020_EQUATES.INC       ; Get the MVME133A BUG ROM Calls.

        INCLUDE  Main_Symbols.INCLUDE    ; Get the global symbol include file.

*************************************************************************
*                                                                       *
*        **********     START OF THE PROGRAM     **********             *
*                                                                       *
*************************************************************************
*                                                                       *
*  Send the Wake-Up message to the 68k terminal.                        *
*                                                                       *
*************************************************************************

STRINT  PEA.L   CS                      ; Put clear screen on stack.
        SYSCALL .WRITE                  ; Clear screen.
        PEA.L   HO                      ; Put home cursor on stack.
        SYSCALL .WRITE                  ; Home cursor.

        PEA.L   HELLO                   ; Push the Hello message address on
        SYSCALL .WRITELN                ; the stack and send it out.

        PEA.L   BlankLn                 ; Push the Blank Line address on the
        SYSCALL .WRITELN                ; stack and send it out.
        PEA.L   Motto                   ; Push the Motto message address on
        SYSCALL .WRITELN                ; the stack and send it out.
        PEA.L   BlankLn                 ; Push the Blank Line address on the
        SYSCALL .WRITELN                ; stack and send it out.

*************************************************************************
*                                                                       *
*   Get the MVME133A-20 instruction cashe memory running.               *
*************************************************************************

        MOVE.L   #1,D0                 ; Turn on the 68020 instruction cashe.
        MOVEC   D0,CACR

*************************************************************************
*  Initialization:                                                      *
*                                                                       *
*  Call the following routines to initialize the hardware and the       *
*  software for both the L1 Trigger and for the Pulser and CAMAC        *
*  data that we are transporting.                                       *
*************************************************************************

        JSR   Begin_Initialize_Hard_Soft      ;

        JSR   Begin_Initialize_Pulser         ;

        JSR   Begin_Initialize_CAMAC          ;


*************************************************************************
*  Cyclic Event Processing                                              *
*                                                                       *
*  Call the routine that handles the cyclic event processing.           *
*                                                                       *
*************************************************************************

        JSR   Begin_Cyclic                    ;

*************************************************************************
*  Define Constants:                                                    *
*                                                                       *
*  Data used to send messages to the 68k terminal screen.               *
*                                                                       *
*************************************************************************

CS            DC.B    4,$1B,'[2J'      ; clear screan sequence.
HO            DC.B    6,$1B,'[1;1H'    ; home cursor sequence.

HELLO         DC.B    42,'Level 1 Trigger VBD Driver Program  Ver: 2'

Motto         DC.B    42,'             DUM LICET UTERE              '

BlankLn       DC.B     4,'    '


*************************************************************************
*  Define Constants:                                                    *
*                                                                       *
*  Specify the symbols to Import.                                       *
*************************************************************************

        XREF   Begin_Initialize_Hard_Soft,Begin_Initialize_Pulser
        XREF   Begin_Initialize_CAMAC,Begin_Cyclic

        END

