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

BocAddresses.h

00001 //File: BocAddresses.h
00002 
00003 #ifndef SCTPIXELROD_BOCADDRESSES_H
00004 #define SCTPIXELROD_BOCADDRESSES_H
00005 
00018 #include "../CommonWithDsp/processor.h"
00019 #include "../CommonWithDsp/memoryPartitions.h"
00020 
00021 namespace SctPixelRod {
00022 
00023 // Use only the names in this file in C++ code.
00024 
00025 //Get the BOC base address from the testBench definitions.
00026 //CE0_BASE is the start of the window for RRIF registers
00027 //Unfortunately, memoryPartitions.h does not define the BOC
00028 //offset from this base in an available form.
00029 
00030 const unsigned long BOC_ADDRESS_BASE =         CE0_BASE + 0x8000;
00031 
00032 const unsigned long BOC_ADDRESS_WINDOW =       0x1000;
00033 
00034 // Default width for BOC registers. Registers with smaller range
00035 // are defined explicitly below.
00036 const unsigned long BOC_REGISTER_WIDTH =       8;
00037 
00038 //The following addresses are offsets from BOC_ADDRESS_BASE for BOC1
00039 
00040 //Start with the BPM12 chips - base for channel 0
00041 const unsigned long BOC_BPM_BASE =             0x000;
00042 
00043 //Offsets within BPM12 for individual channel functions
00044 enum bocBpmRegisters {
00045     BOC_BPM_INHIBIT =        0x0,
00046     BOC_BPM_MARK_SPACE =     0x4,
00047     BOC_BPM_COARSE =         0x8,
00048     BOC_BPM_FINE =           0xC
00049 };
00050 const unsigned long BOC_BPM_INHIBIT_WIDTH =    1;
00051 const unsigned long BOC_BPM_MARK_SPACE_WIDTH = 5;
00052 const unsigned long BOC_BPM_COARSE_WIDTH =     5;
00053 const unsigned long BOC_BPM_FINE_WIDTH =       7;
00054 
00055 //Start addresses for other "blocks" 
00056 const unsigned long BOC_LASER_DAC =            0x600;
00057 const unsigned long BOC_DATA_DELAY =           0x800;
00058 const unsigned long BOC_DATA_DELAY_WIDTH =     5;
00059 const unsigned long BOC_STROBE_DELAY =         0xA00;
00060 const unsigned long BOC_STROBE_DELAY_WIDTH =   5;
00061 const unsigned long BOC_THRESHOLD_DAC =        0xC00;
00062 
00063 //Channel counts (useful for Pixels??)
00064 const unsigned long BOC_TRANSMIT_CHANNELS =    48;
00065 const unsigned long BOC_RECEIVE_CHANNELS =     96;
00066 const unsigned long BOC_STROBE_CHANNELS =      26;
00067 
00068 //The following addresses are for single registers.
00069 const unsigned long BOC_BPM_CLK_PHASE =        0x980;
00070 const unsigned long BOC_BREG_CLK_PHASE =       0x98C;
00071 const unsigned long BOC_VERNIER_CLK0_PHASE =   0x990;
00072 const unsigned long BOC_VERNIER_CLK0_WIDTH =   5;
00073 const unsigned long BOC_VERNIER_CLK1_PHASE =   0x994;
00074 const unsigned long BOC_VERNIER_CLK1_WIDTH =   5;
00075 
00076 const unsigned long BOC_RESET =                0xF00;
00077 const unsigned long BOC_BPM_RESET =            0xF04;
00078 const unsigned long BOC_TXDAC_CLEAR =          0xF08;
00079 const unsigned long BOC_RXDAC_CLEAR =          0xF0C;
00080 
00081 // For series BOCs, all resets are on BOC_RESET as
00082 // individual bits. Also more resets are defined.
00083 enum boc_reset_bits {
00084     BOC_OK_RESET_BIT = 3,
00085     BOC_VPIN_RESET_BIT = 4,
00086     BOC_RXDAC_CLEAR_BIT = 5,
00087     BOC_TXDAC_CLEAR_BIT = 6,
00088     BOC_BPM_RESET_BIT = 7
00089 };
00090 
00091 const unsigned long BOC_STATUS =               0xF10;
00092 
00093 // The meanings of the BOC_STATUS bits are different for
00094 // pre-production and production BOCs. Some bits are
00095 // not used.
00096 enum boc_pre_production_status_bits {
00097     BOC_PRE_PRODUCTION_SW1 = 0,
00098     BOC_PRE_PRODUCTION_SW4 = 1,
00099     BOC_PRE_PRODUCTION_SW5 = 2,
00100     BOC_PRE_PRODUCTION_SW6 = 3,
00101     BOC_PRE_PRODUCTION_RODSENSE = 5,
00102     BOC_PRE_PRODUCTION_LOCLASEN = 6,
00103     BOC_PRE_PRODUCTION_REMLASEN = 7
00104 };
00105 //
00106 enum boc_production_status_bits {
00107     BOC_PRODUCTION_BOCOK = 1,
00108         BOC_PRODUCTION_VBOK = 2,
00109         BOC_PRODUCTION_VAOK = 3,
00110         BOC_PRODUCTION_ERRFLAG = 4,
00111         BOC_PRODUCTION_RODSENSE = 5,
00112         BOC_PRODUCTION_LOCLASEN= 6,
00113         BOC_PRODUCTION_REMLASEN = 7
00114 };
00115 
00116 const unsigned long BOC_RX_DATA_MODE =         0xF14;
00117 const unsigned long BOC_RX_DATA_MODE_WIDTH =   3;
00118 // Define the Rx Data mode register values
00119 // NB - not bits!!
00120 enum boc_rx_data_mode_values {
00121     BOC_RX_DATA_MODE_NORMAL = 0,
00122     BOC_RX_DATA_MODE_TIMING = 1,
00123     BOC_RX_DATA_MODE_PIXEL2 = 2,
00124     BOC_RX_DATA_MODE_PIXEL1 = 3,
00125     BOC_RX_DATA_MODE_CLOCK = 6,
00126     BOC_RX_DATA_MODE_TRANSPARENT = 7
00127 };
00128 const unsigned long BOC_VERNIER_FINE_PHASE =   0xF20;
00129 const unsigned long BOC_CLK_CONTROL =          0xF28;
00130 //Width of series Clock Control register. Pre-production
00131 //BOCs have the register 1 bit smaller.
00132 const unsigned long BOC_CLK_CONTROL_WIDTH  =   5;
00133 // Define the clock control bits
00134 enum boc_clk_control_bits {
00135     BOC_CLOCK_INVERT = 0,
00136     BOC_CLOCK_HALF = 1,
00137     BOC_CLOCK_VERNIER_BYPASS = 2,
00138     BOC_CLOCK_BPMPH_BYPASS = 3,
00139     BOC_CLOCK_PHOS4_FIX = 4
00140 };
00141 
00142 const unsigned long BOC_FW_REV =               0xF40;
00143 const unsigned long BOC_HW_REV =               0xF44;
00144 const unsigned long BOC_MODULE_TYPE =          0xF48;
00145 const unsigned long BOC_MANUFACTURER =         0xF4C;
00146 const unsigned long BOC_SERIAL_NUMBER =        0xF60;
00147 
00148 //Monitor ADC is new for the series BOCs. Details are different
00149 //for the Rev A, B or C boards.
00150 // Also there are potentially versions of the boards with 10
00151 // or 12-bit ADCs.
00152 
00153 const unsigned long BOC_ADC_SETUP =            0xE00;
00154 const unsigned long BOC_ADC_CONFIG =           0xE04;
00155 const unsigned long BOC_ADC_CONVERT =          0xE08;
00156 const unsigned long BOC_ADC_LSB =              0xE10;
00157 const unsigned long BOC_ADC_MSB =              0xE14;
00158 const unsigned long BOC_ADC_MSB_WIDTH[2] =     {2 ,4};
00159 
00160 const unsigned long BOC_MONITOR_CHANNELS =     12;
00161 
00162 //BOC_BUSY_0 is bit 2 of RRIF_STATUS_1. I can't find the definition of
00163 //this register anywhere, so put it here for now.
00164 //This is now defined as an index elsewhere. Until I decide how to map
00165 //the index to a real address, the name below has changed.
00166 
00167 const unsigned long RRIF_STATUS_1_ADDRESS =    CE0_BASE + 0x4420;
00168 enum rrif_status_1_bits {
00169     BOC_BUSY_0 =        0x4
00170 };
00171 
00172 }; //  End namespace SctPixelRod
00173 
00174 #endif //SCTPIXELROD_BOCADDRESSES_H

Generated on Thu Jul 15 09:50:43 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5