
*************************************************************************
*                                                                       *
*                          LEVEL 1 TRIGGER                              *
*                       VBD  DATA_CABLE_DRIVER                          *
*                                                                       *
*                  VERSION: 2          DATE: 19-NOV-1992                *
*                ----------------------------------------               *
*                                                                       *
*                For Use with June-Nov 1992  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      *
*       $0034 0000  through  $0034 7FFF    "2nd" VME 214 Module for Vert Intr *
*       $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.         *
*                                                                             *
*       $10uv wxyz   Vertical Interconnect to Central Calorimeter.            *
*       $11uv wxyz   Vertical Interconnect to South End Cap Calo.             *
*       $12uv wxyz   Vertical Interconnect to North End Cap Calo.             *
*       $13uv wxyz   Vertical Intrcnct to Central Detector and Abso Time.     *
*                                                                             *
*                                                                             *
*    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 $00302C6C       Data built by the COMINT Card.         *
*    $00305000 through $0030501F       Crate Header data 5 longwords          *
*                                                                             *
*                                                                             *
*    The following is a list of the memory locations that will be used in     *
*    the "2nd" VME-214 Memory module to hold data read over the Vertical      *
*    Interconnect.   Recall that this 2nd memory module lives in VME          *
*    addresses $00340000  through  $00347FFF.                                 *
*                                                                             *
*        VME Address Range                     Contents                       *
*    ---------------------------      --------------------------------        *
*    $00340000 through $003400FF       Central Detector Pulser Data           *
*    $00340100 through $003401FF       Calorimeter Pulser Data                *
*    $00340800 through $00340817       Absolute Time Data                     *
*                                                                             *
*                                                                             *
*         List of VBD DMA sections used to build the data block               *
*            Block Structure of the April 1992 COMINT PROM's                  *
*       ---------------------------------------------------------             *
*                                                                             *
*                                                         Rev.  20-APR-1992   *
*                                                                             *
*                                     BLOCK                                   *
*          BLOCK LENGTH IN       STARTING LOCATION                            *
*       ---------------------   -------------------                           *
* BLK   967 ITEMS   LONGWORDS   967 ITEM   LONGWORD                           *
* Num    DECIMAL     DECIMAL    DECIMAL    ADRS HEX           CONTENTS        *
* ---   ---------------------   -------------------   ----------------------  *
*                                                                             *
* **"0"    "10"         5        "    "   $305000      Crate Header           *
*                                                                             *
*   1      532        266            1    $300004      Current Framework      *
*                                                                             *
*   2     1280        640          535    $300430      Current CTFE Et Data   *
*                                                                             *
*   3      532        266         1817    $300E34      Previous Framework     *
*                                                                             *
*   4     1280        640         2351    $301260      Previous CTFE Et Data  *
*                                                                             *
*   5      130         65         3633    $301C64      EM Et Jet List         *
*                                                                             *
*   6      130         65         3765    $301D6C      Total Et Jet List      *
*                                                                             *
*   7      640        320         3897    $301E74      Mask of Jet Patterns   *
*                                                                             *
*   8      320        160         4539    $302378      TRD Hot Tower Table    *
*                                                                             *
*   9       82         41         4861    $3025FC    Spec Trig Prog  vs       *
*                                                      EM or Tot Et Ref Set   *
*                                                    Spec Trig Prog Fired vs  *
*                                                      EM or Tot Et Ref Set   *
*                                                    Spec Trig Prog  vs       *
*                                                      Super Tower Ref Set    *
*                                                                             *
*  10       40         20         4945    $3026A4    Super Tower Jet Pattern  *
*                                                                             *
*  11       72         36         4987    $3026F8      Level 1.5 Data         *
*                                                                             *
*  12       12          6         5061    $340800      Absolute Time data     *
*                                                                             *
*  13      340        170         5075    $3027A8      Additional Level 1     *
*                                                      Scalers and Foreign    *
*                                                      Scalers                *
*                                                                             *
* **"14"   "256"      128        "5417"   $340000      Pulser Programm Data   *
*                                                                             *
*                                                                             *
*   Notes:  The symbol ** implies that this line is for reference only.       *
*           This is NOT part of the COMINT PROM's.                            *
*                                                                             *
*           From the start of the Header through the L1 & Foreign Scalers is  *
*           a total of 2714 LongWords.                                        *
*                                                                             *
*           From the start of the Header through the Pulser Programming Data  *
*           is a total of 2843 LongWords  (equals 11,372 Bytes).              *
*                                                                             *
*******************************************************************************


***************************************************************************
*                                                                         *
*                                                                         *
*    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 the          *
*  Absolute Time data that we are transporting.                         *
*************************************************************************

        JSR   Begin_Initialize_Hard_Soft      ;

        JSR   Begin_Initialize_Pulser         ;

        JSR   Begin_Initialize_Time           ;


*************************************************************************
*  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_Time,Begin_Cyclic

        END

