diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.cxx b/slsDetectorSoftware/eigerDetectorServer/Beb.cxx index aa358e9e0..80746bbe6 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.cxx +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.cxx @@ -51,7 +51,7 @@ void BebInfo::Print(){ } -Beb::Beb(){ +Beb::Beb(int arg1){ send_ndata = 0; send_buffer_size = 1026; @@ -74,6 +74,14 @@ Beb::Beb(){ ll = new LocalLinkInterface(XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR); SetByteOrder(); + + + new_memory = new LocalLinkInterface(); + if(!new_memory->InitNewMemory(XPAR_PLB_LL_NEW_MEMORY, arg1)) + printf("New Memory FAIL\n"); + else + printf("New Memory OK\n"); + } Beb::~Beb(){ diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.h b/slsDetectorSoftware/eigerDetectorServer/Beb.h index 28c5f22d5..6011e18c9 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.h +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.h @@ -55,6 +55,8 @@ class Beb{ // unsigned int GetBebInfoIndex(unsigned int beb_numb); LocalLinkInterface* ll; + LocalLinkInterface* new_memory; + int send_ndata; unsigned int send_buffer_size; @@ -82,7 +84,7 @@ class Beb{ // short bit_mode; public: - Beb(); + Beb(int arg1); virtual ~Beb(); bool SetBebSrcHeaderInfos(unsigned int beb_number, bool ten_gig, std::string src_mac, std::string src_ip, unsigned int src_port); diff --git a/slsDetectorSoftware/eigerDetectorServer/BebServer.cxx b/slsDetectorSoftware/eigerDetectorServer/BebServer.cxx index 52a8e1719..45be7064f 100755 --- a/slsDetectorSoftware/eigerDetectorServer/BebServer.cxx +++ b/slsDetectorSoftware/eigerDetectorServer/BebServer.cxx @@ -69,7 +69,13 @@ int main(int argc, char* argv[]){ */ init(); - Beb *bebs = new Beb(); + int arg1; + Beb *bebs; + + if(argc>1) + bebs = new Beb(atoi(argv[1])); + else + bebs = new Beb(-1); // unsigned short int port_number = atoi(argv[1]); @@ -203,7 +209,8 @@ int main(int argc, char* argv[]){ return_message.append("\tError executing: SetupTableEntry <1GbE(0) or 10GbE(1)> \n"); ret_val = 1; }else{ - ret_val = !bebs->SetBebSrcHeaderInfos(n[0],n[1],tmp_str[0],tmp_str[1],n[3])||!bebs->SetUpUDPHeader(n[0],n[1],n[2],tmp_str[2],tmp_str[3],n[4]); + for(int i=0;i<32;i++)/** modified for Aldo*/ + ret_val = !bebs->SetBebSrcHeaderInfos(n[0],n[1],tmp_str[0],tmp_str[1],n[3])||!bebs->SetUpUDPHeader(n[0],n[1],n[2]+i,tmp_str[2],tmp_str[3],n[4]); if(ret_val) return_message.append("\tError Executing: SetupTableEntry "); else return_message.append("\tExecuted: SetupTableEntry "); diff --git a/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c b/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c index cafafbee1..1378160f5 100644 --- a/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c +++ b/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c @@ -185,7 +185,7 @@ int RequestImages(){ int SetDestinationParameters(int i){ eiger_back_ret_val=0; - eiger_back_message_length = sprintf(eiger_back_message,"setdstparameters %d %d %d",ten_giga,32,i);// number of dsts + eiger_back_message_length = sprintf(eiger_back_message,"setdstparameters %d %d %d",ten_giga,1,i);// number of dsts return EigerBackSendCMD(); } diff --git a/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.cxx b/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.cxx index adb839080..ce67842e6 100644 --- a/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.cxx +++ b/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.cxx @@ -31,6 +31,48 @@ LocalLinkInterface::LocalLinkInterface(unsigned int ll_fifo_badr){ LocalLinkInterface::~LocalLinkInterface(){}; +LocalLinkInterface::LocalLinkInterface(){ + printf("Initialize new memory\n"); + } + +int LocalLinkInterface::InitNewMemory (unsigned int addr, int ifg){ + unsigned int CSP0BASE; + int fd; + + /*fd = open("/dev/mem", O_RDWR | O_SYNC, 0); + if (fd == -1) { + printf("\nCan't find /dev/mem!\n"); + return 0; + } + printf("/dev/mem opened\n"); + + + CSP0BASE = (u_int32_t)mmap(0, 0x1000, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, addr); + if (CSP0BASE == (u_int32_t)MAP_FAILED) { + printf("\nCan't map memmory area!!\n"); + return 0; + } + printf("CSP0 mapped\n"); + + + volatile u_int8_t *ptr1; + + ptr1=(u_int8_t*)(CSP0BASE); + + printf("pointer val=%x\n",(void*)ptr1); + + printf("ifg_control=%02x\n",*ptr1); + + *ptr1=ifg; + + printf("ifg_control new=%02x\n",*ptr1); + + close(fd); +*/ + return 1; +} + + bool LocalLinkInterface::Init(unsigned int ll_fifo_badr){ int fd; diff --git a/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.h b/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.h index 582b248c6..ae1b5ac82 100644 --- a/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.h +++ b/slsDetectorSoftware/eigerDetectorServer/LocalLinkInterface.h @@ -31,6 +31,9 @@ class LocalLinkInterface: public HardwareIO{ // int Test(unsigned int buffer_len, void *buffer); + LocalLinkInterface(); + int InitNewMemory (unsigned int addr, int ifg); + /* bool FiFoReset(unsigned int numb); int FifoSend(unsigned int numb, unsigned int frame_len, void *buffer); diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/beb_debug b/slsDetectorSoftware/eigerDetectorServer/bin/beb_debug index cf3828bf3..81a3ceee0 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/beb_debug and b/slsDetectorSoftware/eigerDetectorServer/bin/beb_debug differ diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index c3eb10c03..01b998f5d 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer differ diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug b/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug index 026d21127..679aad0f5 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug and b/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug differ diff --git a/slsDetectorSoftware/eigerDetectorServer/xparameters.h b/slsDetectorSoftware/eigerDetectorServer/xparameters.h index 4d4c2b9f8..08507bc72 100644 --- a/slsDetectorSoftware/eigerDetectorServer/xparameters.h +++ b/slsDetectorSoftware/eigerDetectorServer/xparameters.h @@ -52,6 +52,9 @@ #define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000 #define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF +/* Definitions for a new memory */ +#define XPAR_PLB_LL_NEW_MEMORY 0xC4200000 + /* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT */ #define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000