mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-03 03:10:04 +02:00
tried some stuff with ifg
This commit is contained in:
parent
024e386f50
commit
95947778c5
@ -51,7 +51,7 @@ void BebInfo::Print(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Beb::Beb(){
|
Beb::Beb(int arg1){
|
||||||
|
|
||||||
send_ndata = 0;
|
send_ndata = 0;
|
||||||
send_buffer_size = 1026;
|
send_buffer_size = 1026;
|
||||||
@ -74,6 +74,14 @@ Beb::Beb(){
|
|||||||
ll = new LocalLinkInterface(XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR);
|
ll = new LocalLinkInterface(XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR);
|
||||||
|
|
||||||
SetByteOrder();
|
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(){
|
Beb::~Beb(){
|
||||||
|
@ -55,6 +55,8 @@ class Beb{ //
|
|||||||
unsigned int GetBebInfoIndex(unsigned int beb_numb);
|
unsigned int GetBebInfoIndex(unsigned int beb_numb);
|
||||||
|
|
||||||
LocalLinkInterface* ll;
|
LocalLinkInterface* ll;
|
||||||
|
LocalLinkInterface* new_memory;
|
||||||
|
|
||||||
|
|
||||||
int send_ndata;
|
int send_ndata;
|
||||||
unsigned int send_buffer_size;
|
unsigned int send_buffer_size;
|
||||||
@ -82,7 +84,7 @@ class Beb{ //
|
|||||||
short bit_mode;
|
short bit_mode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Beb();
|
Beb(int arg1);
|
||||||
virtual ~Beb();
|
virtual ~Beb();
|
||||||
|
|
||||||
bool SetBebSrcHeaderInfos(unsigned int beb_number, bool ten_gig, std::string src_mac, std::string src_ip, unsigned int src_port);
|
bool SetBebSrcHeaderInfos(unsigned int beb_number, bool ten_gig, std::string src_mac, std::string src_ip, unsigned int src_port);
|
||||||
|
@ -69,7 +69,13 @@ int main(int argc, char* argv[]){
|
|||||||
*/
|
*/
|
||||||
init();
|
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]);
|
// unsigned short int port_number = atoi(argv[1]);
|
||||||
|
|
||||||
@ -203,7 +209,8 @@ int main(int argc, char* argv[]){
|
|||||||
return_message.append("\tError executing: SetupTableEntry <beb_number> <1GbE(0) or 10GbE(1)> <dst_number> <src_mac> <src_ip> <src_port> <dst_mac> <dst_ip> <dst_port>\n");
|
return_message.append("\tError executing: SetupTableEntry <beb_number> <1GbE(0) or 10GbE(1)> <dst_number> <src_mac> <src_ip> <src_port> <dst_mac> <dst_ip> <dst_port>\n");
|
||||||
ret_val = 1;
|
ret_val = 1;
|
||||||
}else{
|
}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 ");
|
if(ret_val) return_message.append("\tError Executing: SetupTableEntry ");
|
||||||
else return_message.append("\tExecuted: SetupTableEntry ");
|
else return_message.append("\tExecuted: SetupTableEntry ");
|
||||||
|
@ -185,7 +185,7 @@ int RequestImages(){
|
|||||||
|
|
||||||
int SetDestinationParameters(int i){
|
int SetDestinationParameters(int i){
|
||||||
eiger_back_ret_val=0;
|
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();
|
return EigerBackSendCMD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,48 @@ LocalLinkInterface::LocalLinkInterface(unsigned int ll_fifo_badr){
|
|||||||
|
|
||||||
LocalLinkInterface::~LocalLinkInterface(){};
|
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){
|
bool LocalLinkInterface::Init(unsigned int ll_fifo_badr){
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -31,6 +31,9 @@ class LocalLinkInterface: public HardwareIO{ //
|
|||||||
|
|
||||||
int Test(unsigned int buffer_len, void *buffer);
|
int Test(unsigned int buffer_len, void *buffer);
|
||||||
|
|
||||||
|
LocalLinkInterface();
|
||||||
|
int InitNewMemory (unsigned int addr, int ifg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bool FiFoReset(unsigned int numb);
|
bool FiFoReset(unsigned int numb);
|
||||||
int FifoSend(unsigned int numb, unsigned int frame_len, void *buffer);
|
int FifoSend(unsigned int numb, unsigned int frame_len, void *buffer);
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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_BASEADDR 0xC4100000
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF
|
#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 */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user