mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
a check in gotthard server to ensure that it is really gotthard and not moench module
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@529 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -1226,9 +1226,9 @@ int setADC(int adc){
|
|||||||
reg|=(ACTIVE_ADC_MASK & mask);
|
reg|=(ACTIVE_ADC_MASK & mask);
|
||||||
bus_w(CHIP_OF_INTRST_REG,reg);
|
bus_w(CHIP_OF_INTRST_REG,reg);
|
||||||
|
|
||||||
#ifdef DDEBUG
|
//#ifdef DDEBUG
|
||||||
printf("Chip of Intrst Reg:%x\n",bus_r(CHIP_OF_INTRST_REG));
|
printf("Chip of Interest:%x\n",bus_r(CHIP_OF_INTRST_REG));
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
adcConfigured = adc;
|
adcConfigured = adc;
|
||||||
|
|
||||||
@ -1460,22 +1460,15 @@ u_int32_t runState(void) {
|
|||||||
int startStateMachine(){
|
int startStateMachine(){
|
||||||
|
|
||||||
//#ifdef VERBOSE
|
//#ifdef VERBOSE
|
||||||
printf("*******Starting State Machine***************\n");
|
printf("*******Starting State Machine*******\n");
|
||||||
//#endif
|
//#endif
|
||||||
cleanFifo();
|
cleanFifo();
|
||||||
// fifoReset(); printf("Starting State Machine\n");
|
// fifoReset();
|
||||||
now_ptr=(char*)ram_values;
|
now_ptr=(char*)ram_values;
|
||||||
#ifdef SHAREDMEMORY
|
#ifdef SHAREDMEMORY
|
||||||
write_stop_sm(0);
|
write_stop_sm(0);
|
||||||
write_status_sm("Started");
|
write_status_sm("Started");
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
#ifdef MCB_FUNCS
|
|
||||||
setCSregister(ALLMOD);
|
|
||||||
clearSSregister(ALLMOD);
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
//putout("0000000000000000",ALLMOD);
|
|
||||||
bus_w16(CONTROL_REG, START_ACQ_BIT | START_EXPOSURE_BIT);
|
bus_w16(CONTROL_REG, START_ACQ_BIT | START_EXPOSURE_BIT);
|
||||||
bus_w16(CONTROL_REG, 0x0);
|
bus_w16(CONTROL_REG, 0x0);
|
||||||
printf("statusreg=%08x\n",bus_r(STATUS_REG));
|
printf("statusreg=%08x\n",bus_r(STATUS_REG));
|
||||||
@ -1487,9 +1480,9 @@ int startStateMachine(){
|
|||||||
|
|
||||||
int stopStateMachine(){
|
int stopStateMachine(){
|
||||||
|
|
||||||
#ifdef VERBOSE
|
//#ifdef VERBOSE
|
||||||
printf("Stopping State Machine\n");
|
printf("*******Stopping State Machine*******\n");
|
||||||
#endif
|
//#endif
|
||||||
#ifdef SHAREDMEMORY
|
#ifdef SHAREDMEMORY
|
||||||
write_stop_sm(1);
|
write_stop_sm(1);
|
||||||
write_status_sm("Stopped");
|
write_status_sm("Stopped");
|
||||||
@ -1693,39 +1686,6 @@ u_int32_t* decode_data(int *datain)
|
|||||||
|
|
||||||
|
|
||||||
int setDynamicRange(int dr) {
|
int setDynamicRange(int dr) {
|
||||||
/*
|
|
||||||
int ow;
|
|
||||||
int nm;
|
|
||||||
|
|
||||||
u_int32_t np=getProbes();
|
|
||||||
#ifdef VERYVERBOSE
|
|
||||||
printf("probes==%02x\n",np);
|
|
||||||
#endif
|
|
||||||
if (dr>0) {
|
|
||||||
nm=setNMod(-1);
|
|
||||||
if (dr==1) {
|
|
||||||
dynamicRange=1;
|
|
||||||
ow=5;
|
|
||||||
} else if (dr<=4) {
|
|
||||||
dynamicRange=4;
|
|
||||||
ow=4;
|
|
||||||
} else if (dr<=8) {
|
|
||||||
dynamicRange=8;
|
|
||||||
ow=3;
|
|
||||||
} else if (dr<=16) {
|
|
||||||
dynamicRange=16;
|
|
||||||
ow=2;
|
|
||||||
} else {
|
|
||||||
dynamicRange=32;
|
|
||||||
ow=0; //or 1?
|
|
||||||
}
|
|
||||||
setCSregister(ALLMOD);
|
|
||||||
initChipWithProbes(0, ow,np, ALLMOD);
|
|
||||||
putout("0000000000000000",ALLMOD);
|
|
||||||
setNMod(nm);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return getDynamicRange();
|
return getDynamicRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1735,46 +1695,6 @@ int setDynamicRange(int dr) {
|
|||||||
|
|
||||||
|
|
||||||
int getDynamicRange() {
|
int getDynamicRange() {
|
||||||
/*
|
|
||||||
int dr;
|
|
||||||
u_int32_t shiftin=bus_r(GET_SHIFT_IN_REG);
|
|
||||||
u_int32_t outmux=(shiftin >> OUTMUX_OFF) & OUTMUX_MASK;
|
|
||||||
u_int32_t probes=(shiftin >> PROBES_OFF) & PROBES_MASK;
|
|
||||||
#ifdef VERYVERBOSE
|
|
||||||
printf("%08x ",shiftin);
|
|
||||||
printf("outmux=%02x probes=%d\n",outmux,probes);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (outmux) {
|
|
||||||
case 2:
|
|
||||||
dr=16;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
dr=8;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
dr=4;
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
dr=1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dr=32;
|
|
||||||
}
|
|
||||||
dynamicRange=dr;
|
|
||||||
if (probes==0) {
|
|
||||||
dataBytes=nModX*nModY*NCHIP*NCHAN*dynamicRange/8;
|
|
||||||
} else {
|
|
||||||
dataBytes=nModX*nModY*NCHIP*NCHAN*4;///
|
|
||||||
}
|
|
||||||
#ifdef VERBOSE
|
|
||||||
printf("Number of data bytes %d - probes %d dr %d\n", dataBytes, probes, dr);
|
|
||||||
#endif
|
|
||||||
if (allocateRAM()==OK) {
|
|
||||||
;
|
|
||||||
} else
|
|
||||||
printf("ram not allocated\n");
|
|
||||||
*/
|
|
||||||
dynamicRange=16;
|
dynamicRange=16;
|
||||||
return dynamicRange;
|
return dynamicRange;
|
||||||
|
|
||||||
|
Binary file not shown.
@ -62,29 +62,26 @@ int init_detector( int b) {
|
|||||||
|
|
||||||
//confirm if it is really gotthard
|
//confirm if it is really gotthard
|
||||||
if (((bus_r(PCB_REV_REG) & DETECTOR_TYPE_MASK)>> DETECTOR_TYPE_OFFSET) == MOENCH_MODULE){
|
if (((bus_r(PCB_REV_REG) & DETECTOR_TYPE_MASK)>> DETECTOR_TYPE_OFFSET) == MOENCH_MODULE){
|
||||||
printf("This is a MOENCH detector. Exiting Gotthard Server.\n");
|
printf("This is a MOENCH detector. Exiting Gotthard Server.\n\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
printf("***This is a GOTTHARD detector with %d chips per module***\n", NCHIP);
|
printf("***This is a GOTTHARD detector with %d chips per module***\n", NCHIP);
|
||||||
|
printf("\nBoard Revision:0x%x\n",(bus_r(PCB_REV_REG)&BOARD_REVISION_MASK));
|
||||||
#ifdef MCB_FUNCS
|
#ifdef MCB_FUNCS
|
||||||
initDetector();
|
initDetector();
|
||||||
printf("Initializing Detector\n");
|
printf("Initializing Detector\n");
|
||||||
#endif
|
#endif
|
||||||
testFpga();
|
testFpga();
|
||||||
testRAM();
|
testRAM();
|
||||||
|
|
||||||
//gotthard specific
|
//gotthard specific
|
||||||
setPhaseShiftOnce();
|
setPhaseShiftOnce();
|
||||||
prepareADC();
|
prepareADC();
|
||||||
setADC(-1); //already does setdaqreg and clean fifo
|
setADC(-1); //already does setdaqreg and clean fifo
|
||||||
printf("Chip of interest:0x%x\n",bus_r(CHIP_OF_INTRST_REG));
|
|
||||||
int reg = (NCHAN*NCHIP)<<CHANNEL_OFFSET;
|
|
||||||
reg&=CHANNEL_MASK;
|
|
||||||
reg|=ACTIVE_ADC_MASK;
|
|
||||||
bus_w(CHIP_OF_INTRST_REG,reg);
|
|
||||||
printf("Chip of interest:0x%x\n",bus_r(CHIP_OF_INTRST_REG));
|
|
||||||
setSettings(GET_SETTINGS,-1);
|
setSettings(GET_SETTINGS,-1);
|
||||||
|
|
||||||
//Initialization
|
//Initialization
|
||||||
setFrames(1);
|
setFrames(1);
|
||||||
setTrains(1);
|
setTrains(1);
|
||||||
@ -92,7 +89,6 @@ int init_detector( int b) {
|
|||||||
setPeriod(1e9);
|
setPeriod(1e9);
|
||||||
setDelay(0);
|
setDelay(0);
|
||||||
setGates(0);
|
setGates(0);
|
||||||
|
|
||||||
setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
|
setTiming(GET_EXTERNAL_COMMUNICATION_MODE);
|
||||||
setMaster(GET_MASTER);
|
setMaster(GET_MASTER);
|
||||||
setSynchronization(GET_SYNCHRONIZATION_MODE);
|
setSynchronization(GET_SYNCHRONIZATION_MODE);
|
||||||
|
Reference in New Issue
Block a user