mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 05:47:14 +02:00
a rough working version
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@591 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
CC = powerpc-4xx-softfloat-gcc
|
CC = powerpc-4xx-softfloat-gcc
|
||||||
CLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST #-DVIRTUAL
|
CLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST #-DVERBOSE #-DVIRTUAL
|
||||||
LDLIBS += -lm -lstdc++
|
LDLIBS += -lm -lstdc++
|
||||||
|
|
||||||
PROGS = eigerDetectorServer
|
PROGS = eigerDetectorServer
|
||||||
@ -13,10 +13,12 @@ OBJS = $(SRC_CLNT:.cpp=.o)
|
|||||||
|
|
||||||
all: clean $(PROGS)
|
all: clean $(PROGS)
|
||||||
|
|
||||||
pc: clean pccompile $(PROGS)
|
|
||||||
|
|
||||||
pccompile:
|
3pc: clean pccompile $(PROGS)
|
||||||
CC := gcc
|
|
||||||
|
|
||||||
|
#pccompile:
|
||||||
|
#CC := gcc
|
||||||
|
|
||||||
boot: $(OBJS)
|
boot: $(OBJS)
|
||||||
|
|
||||||
|
@ -6,6 +6,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
/** temporary*/
|
||||||
|
#include <sys/mman.h> //PROT_READ,PROT_WRITE,MAP_FILE,MAP_SHARED,MAP_FAILED
|
||||||
|
#include <fcntl.h> //O_RDWR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const int nChans=NCHAN;
|
const int nChans=NCHAN;
|
||||||
const int nChips=NCHIP;
|
const int nChips=NCHIP;
|
||||||
@ -36,7 +41,7 @@ int nModBoard;
|
|||||||
extern int dataBytes;
|
extern int dataBytes;
|
||||||
|
|
||||||
|
|
||||||
/** temporary */
|
/** temporary
|
||||||
u_int32_t CSP0BASE;
|
u_int32_t CSP0BASE;
|
||||||
int mapCSP0(void) {
|
int mapCSP0(void) {
|
||||||
CSP0BASE = (u_int32_t)malloc(0xFFFFFFF);
|
CSP0BASE = (u_int32_t)malloc(0xFFFFFFF);
|
||||||
@ -45,11 +50,39 @@ int mapCSP0(void) {
|
|||||||
printf("CSPOBASE=from %08x to %x\n",CSP0BASE,CSP0BASE+0xFFFFFFF);
|
printf("CSPOBASE=from %08x to %x\n",CSP0BASE,CSP0BASE+0xFFFFFFF);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
#define CSP0 0xC4100000 //XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
||||||
|
#define MEM_SIZE 0xFFFFFFF
|
||||||
|
|
||||||
|
u_int32_t CSP0BASE;
|
||||||
|
int mapCSP0(void) {
|
||||||
|
int fd;
|
||||||
|
printf("Mapping memory\n");
|
||||||
|
#ifdef VIRTUAL
|
||||||
|
CSP0BASE = (u_int32_t)malloc(MEM_SIZE);
|
||||||
|
printf("memory allocated\n");
|
||||||
|
#else
|
||||||
|
if ((fd=open("/dev/mem", O_RDWR | O_SYNC)) < 0){
|
||||||
|
printf("Cant find /dev/mem!\n");
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
printf("/dev/mem opened\n");
|
||||||
|
CSP0BASE = (u_int32_t)mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, CSP0);
|
||||||
|
if (CSP0BASE == (u_int32_t)MAP_FAILED) {
|
||||||
|
printf("\nCan't map memmory area!!\n");
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
printf("CSPOBASE is 0x%x \n",CSP0BASE);
|
||||||
|
printf("CSPOBASE=from %08x to %x\n",CSP0BASE,CSP0BASE+MEM_SIZE);
|
||||||
|
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int initializeDetectorStructure(){
|
int initializeDetectorStructure(){
|
||||||
|
printf("EIGER 5\n");
|
||||||
int imod;
|
int imod;
|
||||||
int n=getNModBoard(X)*getNModBoard(Y);
|
int n=getNModBoard(X)*getNModBoard(Y);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
Reference in New Issue
Block a user