Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

comRegDfns.h

Go to the documentation of this file.
00001 /************************************************************************************
00002  * comRegDfns.h:  Defines bits in the registers of the RRIF dual port register block
00003  *                and the master-slave communication mailbox (in each slave IDRAM).
00004  ************************************************************************************/
00005 #ifndef COM_REG_DFNS
00006 #define COM_REG_DFNS
00007 
00008 #include "smSendTxtBuff.h"         /* pick up N_TXT_BUFFS */
00009 #include "rodConfiguration.h"      /* pick up N_SLV_DSPS */
00010 
00011 /* DSP Register Map from memoryPartitions.h
00012 STATUS_REG_0     STATUS_REG_1     STATUS_REG_2     COMMAND_REG_0
00013 DIAGNOSTIC_REG   TRAPSTAT_REG_0   TRAPSTAT_REG_1   LOOP_REG
00014 HCMD_STAT_REG_0  HCMD_STAT_REG_1  HSTAT_REG_0      HSTAT_REG_1   
00015 RESERVED_REG_0   RESERVED_REG_1   RESERVED_REG_2   RESERVED_REG_3  
00016 RESERVED_REG_4   RESERVED_REG_5   RESERVED_REG_6   TASK_STATE_REG   
00017 HCMD_REG         TRAP_CMD_STAT    INTR_DSP_HSHK    INTR_DSP_HSHK 
00018 */
00019 
00020 /* STATUS_REG_0 */
00021 #define SR_RUNNING                0
00022 #define SR_BUSY                   (1 + (SR_RUNNING))
00023 #define SR_EXECUTING              (1 + (SR_BUSY))
00024 #define SR_PAUSED                 (1 + (SR_EXECUTING))
00025 
00026 #define SR_OUT_LIST_RDY           (1 + (SR_PAUSED))
00027 #define SR_DSP_ACK                (1 + (SR_OUT_LIST_RDY))
00028 #define SR_DMA_ACCESS_ACK         (1 + (SR_DSP_ACK))
00029 #define SR_DMA_ACCESS_ERR         (1 + (SR_DMA_ACCESS_ACK))
00030 
00031 #define SR_TXT_BUFF_NE(x)         (1 + (x) + (SR_DMA_ACCESS_ERR))
00032 
00033 /* the next available register bit is (1 + (N_TXT_BUFFS) + (SR_DSP_ACK)) */
00034 #define SR_TXT_BUFF_PROC(x)       (1 + (x) + (SR_TXT_BUFF_NE(N_TXT_BUFFS-1)))
00035 
00036 /* bit 16: */
00037 #define SR_NTASKS                 (1 + (SR_TXT_BUFF_PROC(N_TXT_BUFFS-1)))
00038 #define SR_NTASKS_W               3
00039 #define SR_EVM                    (3 + (SR_NTASKS))          /* Slave DSPs */
00040 
00041 #define SR_IDLS_ACTIVE            (1 + (SR_EVM))             
00042 #define SR_IDLP_ACTIVE            (1 + (SR_IDLS_ACTIVE))     /* Master DSP */
00043 #define SR_UNDEFINED1             (1 + (SR_IDLP_ACTIVE))
00044 #define SR_UNDEFINED2             (2 + (SR_IDLP_ACTIVE))
00045 
00046 #define SR_UNDEFINED3             (3 + (SR_IDLP_ACTIVE))
00047 #define SR_UNDEFINED4             (4 + (SR_IDLP_ACTIVE))
00048 #define SR_UNDEFINED5             (5 + (SR_IDLP_ACTIVE))
00049 #define SR_UNDEFINED6             (6 + (SR_IDLP_ACTIVE))
00050 
00051 #define SR_UNDEFINED7             (7 + (SR_IDLP_ACTIVE))
00052 #define SR_UNDEFINED8             (8 + (SR_IDLP_ACTIVE))
00053 #define SR_LOAD_ERROR             (1 + (SR_UNDEFINED8))      /* Master DSP */
00054 #define SR_EMIF_ERROR             (1 + (SR_LOAD_ERROR))
00055 
00056 /* STATUS_REG_1 */
00057 #define SR_PRIM_LIST_INDEX      0
00058 #define SR_PRIM_LIST_INDEX_W    4
00059 #define SR_PRIM_INDEX          ((SR_PRIM_LIST_INDEX) + (SR_PRIM_LIST_INDEX_W))
00060 #define SR_PRIM_INDEX_W        20
00061 
00062 /* STATUS_REG_2 */
00063 #define SR_SLVCOMM(x)             (x)
00064 #define SR_HLTS(x)                (1 + (x) +(SR_SLVCOMM(N_SLV_DSPS-1)))
00065 #define SR_SLVATTEND              (1 +(SR_HLTS(N_SLV_DSPS-1)))
00066 
00067 /* COMMAND_REG_0 */
00068 #define CR_IN_LIST_RDY            0
00069 #define CR_PAUSE                  (1 + (CR_IN_LIST_RDY))
00070 #define CR_RESUME                 (1 + (CR_PAUSE))
00071 #define CR_ABORT                  (1 + (CR_RESUME))
00072 #define CR_TXT_BUFF_RR(x)         (1 + (x) + (CR_ABORT))
00073 /* the next available register bit is (1 + (N_TXT_BUFFS) + (CR_ABORT))  */
00074 #define CR_ID                     (1 + CR_TXT_BUFF_RR(N_TXT_BUFFS-1))
00075 #define CR_ID_W                   2   /* IDs for slave DSPs- on master, unused. */
00076 #define CR_DMA_ACCESS_REQ         ((CR_ID_W) + (CR_ID))
00077 #define CR_FLUSH_EVENTS           (1 + (CR_DMA_ACCESS_REQ))   /* Slave DSPs */
00078 #define CR_IDLP_ACTIVE            (1 + (CR_FLUSH_EVENTS))     /* Slave DSPs */
00079 #define CR_HISTO_OVERRIDE         (1 + (CR_IDLP_ACTIVE))      /* Slave DSPs */
00080 
00081 /* Diagnostic Register */
00082 #define DR_DISP_ROD_REG_ID       0
00083 #define DR_LOOPEVENT             0  //SDSP
00084 #define DR_DISP_SERIAL_LOOPS     1
00085 #define DR_HISTO_1               2  //SDSP
00086 #define DR_USE_ROD_MASK_LUT      2  //MDSP
00087 #define DR_HISTO_3               3
00088 #define DR_DISP_MIRROR_CTIME     4
00089 //#define DR_HCTRL_CAPTURE_SET     5
00090 #define DR_STEP_CTRL             6
00091 #define DR_STEP_TRIGGER          7
00092 //#define DR_DELAY                 8
00093 #define DR_SOFT_BC_RESET         9
00094 //#define DR_MUTE                  10
00095 //#define DR_ARDY                  11
00096 #define DR_MAINLOOP_TOGGLE       12
00097 
00098 #define DR_PULSE_PAUSE           14
00099 #define DR_TIMING_DISPLAY        15
00100 #define DR_INFO_DISPLAY          16
00101 //#define DR_DMA_ACK               17
00102 #define DR_MODULE_CFG_LOOP       17
00103 #define DR_SLAVE_WRITE_TEST      18
00104 #define DR_CACHE_FLUSH           17 //SDSP
00105 #define DR_CACHE_RANGE_FLUSH     18 //SDSP
00106 #define DR_CACHE_TOGGLE          19 //SDSP
00107 
00108 #define DR_ISR_DELAY             19
00109 #define DR_DISP_LINK_DATA        20
00110 #define DR_AUTO_STALL            21
00111 #define DR_STAGE_PAUSE           22
00112 //#define DR_REPORTS               23
00113 #define DR_BIN_PAUSE             24
00114 //#define DR_DELAY_DEBUG           25
00115 #define DR_NEW_FMTR              26
00116 #define DR_DYN_DBG               27
00117 //#define DR_PAUSE_STAGE           30
00118 #define DR_RESET_FIFOS           31
00119 
00120 /* Histogram Command & Status Registers */
00121 #if (defined(I_AM_MASTER_DSP) || defined(I_AM_NT_HOST) || defined(I_AM_LINUX_HOST))
00122     #define HCSR0_BIN          0
00123     #define HCSR0_BIN_W        8
00124     #define HCSR0_CHIP         8
00125     #define HCSR0_CHIP_W       8
00126     #define HCSR0_STAGE        16
00127     #define HCSR0_STAGE_W      16
00128 
00129     //#define HCSR0_CALLINE      8
00130     //#define HCSR0_CALLINE_W    5
00131     //#define HCSR0_CALLINE_EN   15
00132     //#define HCSR0_ERRORCNT     16
00133     //#define HCSR0_ERRORCNT_W   16
00134 
00135     #define HCSR1_AVGTRANS     0
00136     #define HCSR1_AVGTRANS_W   8
00137     #define HCSR1_AVGLEN       8
00138     #define HCSR1_AVGLEN_W     8
00139     #define HCSR1_AVGPROC      16
00140     #define HCSR1_AVGPROC_W    16
00141 
00142     #define HSR_SLV_W        16
00143     #define HSR0_SLV3        16
00144     #define HSR0_SLV2        0
00145     #define HSR1_SLV1        16
00146     #define HSR1_SLV0        0
00147 #endif
00148 
00149 /* Definitions of the slave's command and status registers are different; 
00150    master must know both. */
00151 #define HCSR0_SLV_BIN          0
00152 #define HCSR0_SLV_BIN_W        8
00153 #define HCSR0_SLV_CALLINE      8
00154 #define HCSR0_SLV_CALLINE_W    5
00155 #define HCSR0_SLV_CALLINE_EN   15
00156 #define HCSR0_SLV_NEWBIN       16
00157 #define HCSR0_SLV_NEWCAL       17
00158 
00159 #define HCSR1_SLV_BINEVT       0
00160 #define HCSR1_SLV_BINEVT_W     32
00161 
00162 #define HSR0_SLV_RDY          0
00163 #define HSR0_SLV_EXP          1
00164 #define HSR0_SLV_PROC         2
00165 #define HSR0_SLV_DONE         3
00166 #define HSR0_SLV_BINERR       8
00167 #define HSR0_SLV_BINERR_W     8
00168 #define HSR0_SLV_PROCTIME     16
00169 #define HSR0_SLV_PROCTIME_W   16
00170 
00171 #define HSR1_SLV_EVTS_REC     0
00172 #define HSR1_SLV_EVTS_REC_W   32
00173 
00174 /* Trap command-status register */
00175 #define TCSR_TRAILER           0
00176 #define TCSR_TRANSMIT          1
00177 #define TCSR_HEADER            2
00178 #define TCSR_ISR_ACTIVE        3
00179 
00180 #define TCSR_DATA_ERROR        4
00181 #define TCSR_HEADER_ERROR      5
00182 #define TCSR_TRAILER_ERROR     6
00183 #define TCSR_LINK_ERROR        7
00184 
00185 #define TCSR_ERROR             8
00186 #define TCSR_ISR_PENDING      11
00187 
00188 #define TCSR_OVERFLOW_ERROR   14
00189 #define TCSR_OVERFLOW         15
00190 
00191 #define TCSR_ERR_COUNT        16
00192 #define TCSR_ERR_COUNT_W       8
00193 
00194 #define TCSR_EVT_COUNT        24
00195 #define TCSR_EVT_COUNT_W       8
00196 
00197 /* Trap status register 0 */
00198 #define TSR0_EVT_WORD_CNT        0
00199 #define TSR0_EVT_WORD_CNT_W     16
00200 
00201 #define TSR0_IFRAME_TAIL        16
00202 #define TSR0_IFRAME_TAIL_W      8
00203 #define TSR0_XFRAME_TAIL        24
00204 #define TSR0_XFRAME_TAIL_W      8
00205 
00206 /* Trap status register 1 */
00207 #define TSR1_IFRAME_HEAD        16
00208 #define TSR1_IFRAME_HEAD_W      8
00209 #define TSR1_XFRAME_HEAD        24
00210 #define TSR1_XFRAME_HEAD_W      8
00211 
00212 
00213 
00214 /* The loop register (increments once per loop */
00215 #define LR_CNT                0
00216 #define LR_CNT_W             32
00217 
00218 
00219 /* INTR_DSP_HSHK_WR and INTR_DSP_HSHK_RD */
00220 /* The following bits are defined in each of these registers.  They are used for the
00221  * handshake between the master and a slave when either sends a list to the other.
00222  * The state machine is simpler than for host-originated lists, e.g. there is no
00223  * option to pause. */
00224  
00225 #define INTR_DSP_IN_LIST_RDY    (0)
00226 #define INTR_DSP_ABORT          ((INTR_DSP_IN_LIST_RDY) + 1)
00227 #define INTR_DSP_ACK            ((INTR_DSP_ABORT) + 1)
00228 #define INTR_DSP_OUT_LIST_RDY   ((INTR_DSP_ACK) + 1)
00229 
00230 #endif
00231 

Generated on Mon Dec 15 19:35:59 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3