mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
untangled moench from jungfrau, quite a few changes
This commit is contained in:
parent
7eda5f9de5
commit
3c646c3545
@ -137,7 +137,7 @@ int acceptConnection(int socketDescriptor) {
|
|||||||
|
|
||||||
|
|
||||||
//socklen_t address_length;
|
//socklen_t address_length;
|
||||||
size_t address_length=sizeof(struct sockaddr_in);
|
socklen_t address_length=sizeof(struct sockaddr_in);
|
||||||
|
|
||||||
if (socketDescriptor<0)
|
if (socketDescriptor<0)
|
||||||
return -1;
|
return -1;
|
||||||
|
1
slsDetectorSoftware/jungfrauDetectorServer/.gitignore
vendored
Normal file
1
slsDetectorSoftware/jungfrauDetectorServer/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.gdb
|
@ -6,17 +6,17 @@
|
|||||||
CROSS = bfin-uclinux-
|
CROSS = bfin-uclinux-
|
||||||
CC = $(CROSS)gcc
|
CC = $(CROSS)gcc
|
||||||
|
|
||||||
CFLAGS += -Wall -DMOENCHD -DMCB_FUNCS -DDACS_INT -DDEBUG -DV1 #-DVERBOSE #-DVERYVERBOSE #-DVIRTUAL #-DDACS_INT_CSERVER
|
CFLAGS += -Wall -DJUNGFRAUD -DMCB_FUNCS -DDACS_INT -DDEBUG -DV1 #-DVERBOSE #-DVERYVERBOSE #-DVIRTUAL
|
||||||
|
|
||||||
|
|
||||||
PROGS= jungfrauDetectorServerTest
|
PROGS= jungfrauDetectorServer
|
||||||
INSTDIR= /tftpboot
|
INSTDIR= /tftpboot
|
||||||
INSTMODE= 0777
|
INSTMODE= 0777
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BINS = testlib_sharedlibc
|
BINS = testlib_sharedlibc
|
||||||
SRCS = server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c sharedmemory.c
|
SRCS = server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c
|
||||||
OBJS = $(SRCS:%.c=%.o)
|
OBJS = $(SRCS:%.c=%.o)
|
||||||
|
|
||||||
|
|
||||||
@ -27,15 +27,11 @@ test: clean jungfrauADCTEst
|
|||||||
|
|
||||||
boot: $(OBJS)
|
boot: $(OBJS)
|
||||||
|
|
||||||
jungfrauDetectorServerTest: $(OBJS)
|
|
||||||
echo $(OBJS)
|
|
||||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@)
|
|
||||||
|
|
||||||
|
|
||||||
jungfrauDetectorServer: $(OBJS)
|
jungfrauDetectorServer: $(OBJS)
|
||||||
echo $(OBJS)
|
echo $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@)
|
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@)
|
||||||
|
|
||||||
|
|
||||||
jungfrauADCTEst: $(OBJS)
|
jungfrauADCTEst: $(OBJS)
|
||||||
echo $(OBJS)
|
echo $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@) -DTESTADC
|
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@) -DTESTADC
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,6 @@ u_int32_t bus_w(u_int32_t offset, u_int32_t data);
|
|||||||
u_int32_t bus_r(u_int32_t offset);
|
u_int32_t bus_r(u_int32_t offset);
|
||||||
|
|
||||||
int setPhaseShiftOnce();
|
int setPhaseShiftOnce();
|
||||||
int phaseStep(int st);
|
|
||||||
int adcPhase(int st);
|
int adcPhase(int st);
|
||||||
int getPhase();
|
int getPhase();
|
||||||
int cleanFifo();
|
int cleanFifo();
|
||||||
@ -37,8 +36,8 @@ int setDAQRegister();
|
|||||||
|
|
||||||
u_int32_t putout(char *s, int modnum);
|
u_int32_t putout(char *s, int modnum);
|
||||||
u_int32_t readin(int modnum);
|
u_int32_t readin(int modnum);
|
||||||
u_int32_t setClockDivider(int d, int ic);
|
u_int32_t setClockDivider(int d);
|
||||||
u_int32_t getClockDivider(int ic);
|
u_int32_t getClockDivider();
|
||||||
|
|
||||||
void resetPLL();
|
void resetPLL();
|
||||||
u_int32_t setPllReconfigReg(u_int32_t reg, u_int32_t val, int trig);
|
u_int32_t setPllReconfigReg(u_int32_t reg, u_int32_t val, int trig);
|
||||||
@ -68,7 +67,6 @@ int setTiming(int t);
|
|||||||
int setConfigurationRegister(int d);
|
int setConfigurationRegister(int d);
|
||||||
int setToT(int d);
|
int setToT(int d);
|
||||||
int setContinousReadOut(int d);
|
int setContinousReadOut(int d);
|
||||||
int startReceiver(int d);
|
|
||||||
|
|
||||||
int setDACRegister(int idac, int val, int imod);
|
int setDACRegister(int idac, int val, int imod);
|
||||||
int getDacRegister(int dacnum);
|
int getDacRegister(int dacnum);
|
||||||
@ -142,9 +140,7 @@ u_int32_t fifoReadStatus();
|
|||||||
u_int32_t fifo_full(void);
|
u_int32_t fifo_full(void);
|
||||||
|
|
||||||
|
|
||||||
|
void waitForAcquisitionEnd();
|
||||||
u_int16_t* fifo_read_event(int ns);
|
|
||||||
u_int16_t* fifo_read_frame();
|
|
||||||
u_int32_t* decode_data(int* datain);
|
u_int32_t* decode_data(int* datain);
|
||||||
//u_int32_t move_data(u_int64_t* datain, u_int64_t* dataout);
|
//u_int32_t move_data(u_int64_t* datain, u_int64_t* dataout);
|
||||||
int setDynamicRange(int dr);
|
int setDynamicRange(int dr);
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,15 @@
|
|||||||
#define MEM_SIZE 0x100000
|
#define MEM_SIZE 0x100000
|
||||||
|
|
||||||
|
|
||||||
|
//Constants
|
||||||
|
#define HALFSPEED_DBIT_PIPELINE 0x7f7c
|
||||||
|
#define QUARTERSPEED_DBIT_PIPELINE 0x8981
|
||||||
|
#define HALFSPEED_ADC_PIPELINE 0x20
|
||||||
|
#define QUARTERSPEED_ADC_PIPELINE 0x10
|
||||||
|
#define HALFSPEED_CONF 0x0
|
||||||
|
#define QUARTERSPEED_CONF 0xf
|
||||||
|
#define HALFSPEED_ADC_PHASE 65
|
||||||
|
#define QUARTERSPEED_ADC_PHASE 25
|
||||||
|
|
||||||
/* values defined for FPGA */
|
/* values defined for FPGA */
|
||||||
#define MCSNUM 0x0
|
#define MCSNUM 0x0
|
||||||
@ -409,14 +418,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/* settings/conf gain register */
|
/* settings/conf gain register */
|
||||||
#define GAIN_MASK 0x0000000f
|
#define GAIN_MASK 0x0000ffff
|
||||||
#define GAIN_OFFSET 0
|
#define GAIN_OFFSET 0
|
||||||
#define SETTINGS_MASK 0x000000f0
|
#define SPEED_GAIN_MASK 0xf0000000
|
||||||
#define SETTINGS_OFFSET 4
|
#define SPEED_GAIN_OFFSET 28
|
||||||
|
|
||||||
#define JUNGFRAU_GAIN_MASK 0x0000ffff
|
|
||||||
#define JUNGFRAU_SPEED_GAIN_MASK 0xf0000000
|
|
||||||
#define JUNGFRAU_SPEED_GAIN_OFFSET 28
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ int main(int argc, char *argv[])
|
|||||||
int retval=OK;
|
int retval=OK;
|
||||||
int sd, fd;
|
int sd, fd;
|
||||||
int iarg;
|
int iarg;
|
||||||
int checkType = 1;
|
|
||||||
|
|
||||||
|
|
||||||
for(iarg=1; iarg<argc; iarg++){
|
for(iarg=1; iarg<argc; iarg++){
|
||||||
@ -48,13 +47,6 @@ int main(int argc, char *argv[])
|
|||||||
printf("No test condition given. Exiting.\n");
|
printf("No test condition given. Exiting.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(!strcasecmp(argv[iarg+1],"with_gotthard")){
|
|
||||||
checkType = 0;
|
|
||||||
}else{
|
|
||||||
printf("could not decode test condition. Possible arguments: with_gotthard. Exiting\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,31 +60,21 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
b=0;
|
b=0;
|
||||||
printf("\n\nStop Server\nOpening stop server on port %d\n",portno);
|
printf("\n\nStop Server\nOpening stop server on port %d\n",portno);
|
||||||
checkType=0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//control server
|
//control server
|
||||||
else {
|
else {
|
||||||
portno = DEFAULT_PORTNO;
|
portno = DEFAULT_PORTNO;
|
||||||
if(checkType)
|
|
||||||
sprintf(cmd,"%s %d stopserver &",argv[0],DEFAULT_PORTNO+1);
|
sprintf(cmd,"%s %d stopserver &",argv[0],DEFAULT_PORTNO+1);
|
||||||
else
|
|
||||||
sprintf(cmd,"%s %d stopserver -test with_gotthard &",argv[0],DEFAULT_PORTNO+1);
|
|
||||||
printf("\n\nControl Server\nOpening control server on port %d\n",portno );
|
printf("\n\nControl Server\nOpening control server on port %d\n",portno );
|
||||||
|
|
||||||
//printf("\n\ncmd:%s\n",cmd);
|
//printf("\n\ncmd:%s\n",cmd);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
b=1;
|
b=1;
|
||||||
checkType=1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
init_detector(b);
|
||||||
|
|
||||||
init_detector(b, checkType);
|
|
||||||
|
|
||||||
|
|
||||||
sd=bindSocket(portno);
|
sd=bindSocket(portno);
|
||||||
|
@ -8,23 +8,15 @@
|
|||||||
|
|
||||||
// Hardware definitions
|
// Hardware definitions
|
||||||
#define NMAXMODY 1
|
#define NMAXMODY 1
|
||||||
#define NMAXMOD (NMAXMODX*NMAXMODY)
|
|
||||||
|
|
||||||
#define NCHAN 32
|
|
||||||
#define NCHIP 1
|
|
||||||
#define NADC 1
|
|
||||||
#define NDAC 16
|
|
||||||
#define NMAXMODX 1
|
#define NMAXMODX 1
|
||||||
|
#define NMAXMOD (NMAXMODX*NMAXMODY)
|
||||||
|
#define NCHAN (256*256)
|
||||||
|
#define NCHIP 8
|
||||||
|
#define NADC 0
|
||||||
|
#define NDAC 16
|
||||||
#define NCHANS (NCHAN*NCHIP*NMAXMOD)
|
#define NCHANS (NCHAN*NCHIP*NMAXMOD)
|
||||||
#define NDACS (NDAC*NMAXMOD)
|
#define NDACS (NDAC*NMAXMOD)
|
||||||
|
|
||||||
#define JUNGFRAU_NCHAN (256*256)
|
|
||||||
#define JUNGFRAU_NCHIP 8
|
|
||||||
#define JUNGFRAU_NADC 0
|
|
||||||
#define JUNGFRAU_NDAC 16
|
|
||||||
#define JUNGFRAU_NCHANS (JUNGFRAU_NCHAN*JUNGFRAU_NCHIP*NMAXMOD)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**when moench readout tested with gotthard module*/
|
/**when moench readout tested with gotthard module*/
|
||||||
#define GOTTHARDNCHAN 128
|
#define GOTTHARDNCHAN 128
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@ int sockfd;
|
|||||||
int function_table();
|
int function_table();
|
||||||
|
|
||||||
int decode_function(int);
|
int decode_function(int);
|
||||||
int init_detector(int,int);
|
int init_detector(int);
|
||||||
|
|
||||||
int M_nofunc(int);
|
int M_nofunc(int);
|
||||||
int exit_server(int);
|
int exit_server(int);
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
#include "sharedmemory.h"
|
|
||||||
|
|
||||||
struct statusdata *stdata;
|
|
||||||
|
|
||||||
int inism(int clsv) {
|
|
||||||
|
|
||||||
static int scansmid;
|
|
||||||
|
|
||||||
if (clsv==SMSV) {
|
|
||||||
if ( (scansmid=shmget(SMKEY,1024,IPC_CREAT | 0666 ))==-1 ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if ( (stdata=shmat(scansmid,NULL,0))==(void*)-1) {
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clsv==SMCL) {
|
|
||||||
if ( (scansmid=shmget(SMKEY,0,0) )==-1 ) {
|
|
||||||
return -3;
|
|
||||||
}
|
|
||||||
if ( (stdata=shmat(scansmid,NULL,0))==(void*)-1) {
|
|
||||||
return -4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_status_sm(char *status) {
|
|
||||||
strcpy(stdata->status,status);
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_stop_sm(int v) {
|
|
||||||
stdata->stop=v;
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_runnumber_sm(int v) {
|
|
||||||
stdata->runnumber=v;
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
#ifndef SM
|
|
||||||
#define SM
|
|
||||||
|
|
||||||
#include "sls_detector_defs.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
//#include <asm/page.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <sys/shm.h>
|
|
||||||
|
|
||||||
#include <sys/ipc.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
/* key for shared memory */
|
|
||||||
#define SMKEY 10001
|
|
||||||
|
|
||||||
#define SMSV 1
|
|
||||||
#define SMCL 2
|
|
||||||
|
|
||||||
|
|
||||||
struct statusdata {
|
|
||||||
int runnumber;
|
|
||||||
int stop;
|
|
||||||
char status[20];
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
/* for shared memory */
|
|
||||||
|
|
||||||
int inism(int clsv);
|
|
||||||
void write_status_sm(char *status);
|
|
||||||
void write_stop_sm(int v);
|
|
||||||
void write_runnumber_sm(int v);
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user