Commit 79c8d0e0 authored by Raymond Knopp's avatar Raymond Knopp

updates for IF4p5 to handle >1 nb_rx/nb_tx. Tested with 2x2

parent 49bb8b4c
...@@ -91,8 +91,8 @@ int phy_init_RU(RU_t *ru) { ...@@ -91,8 +91,8 @@ int phy_init_RU(RU_t *ru) {
} }
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */ /* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]), //AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
"nb_antennas_rx too large"); //"nb_antennas_rx too large");
ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
......
...@@ -90,14 +90,18 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -90,14 +90,18 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
AssertFatal(txdataF[0]!=NULL,"txdataF_BF[0] is null\n"); AssertFatal(txdataF[0]!=NULL,"txdataF_BF[0] is null\n");
for (symbol_id=0; symbol_id<nsym; symbol_id++) { for (symbol_id=0; symbol_id<nsym; symbol_id++) {
for (element_id=0; element_id<db_halflength; element_id++) { for (int antenna_id=0; antenna_id<ru->nb_tx; antenna_id++) {
i = (uint16_t*) &txdataF[0][blockoffsetF+element_id]; for (element_id=0; element_id<db_halflength; element_id++) {
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8); i = (uint16_t*) &txdataF[antenna_id][blockoffsetF+element_id];
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
i = (uint16_t*) &txdataF[0][slotoffsetF+element_id]; i = (uint16_t*) &txdataF[antenna_id][slotoffsetF+element_id];
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8); data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
}
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
packet_header->frame_status &= ~(0x7);
packet_header->frame_status |= (ru->nb_tx-1);
packet_header->frame_status &= ~(0x000f<<26); packet_header->frame_status &= ~(0x000f<<26);
packet_header->frame_status |= (symbol_id&0x000f)<<26; packet_header->frame_status |= (symbol_id&0x000f)<<26;
...@@ -105,7 +109,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -105,7 +109,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
if ((ru->ifdevice.trx_write_func(&ru->ifdevice, if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
symbol_id, symbol_id,
&tx_buffer, &tx_buffer,
db_fulllength, db_fulllength*ru->nb_tx,
1, 1,
IF4p5_PDLFFT)) < 0) { IF4p5_PDLFFT)) < 0) {
perror("ETHERNET write for IF4p5_PDLFFT\n"); perror("ETHERNET write for IF4p5_PDLFFT\n");
...@@ -139,42 +143,45 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -139,42 +143,45 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
if (packet_type == IF4p5_PULFFT) { if (packet_type == IF4p5_PULFFT) {
for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) { for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) {
for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) {
uint32_t *rx0 = (uint32_t*) &rxdataF[0][blockoffsetF];
uint32_t *rx1 = (uint32_t*) &rxdataF[0][slotoffsetF]; uint32_t *rx0 = (uint32_t*) &rxdataF[antenna_id][blockoffsetF];
uint32_t *rx1 = (uint32_t*) &rxdataF[antenna_id][slotoffsetF];
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF4_SYMBOL, symbol_id );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF4_SYMBOL, symbol_id );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 1 );
start_meas(&ru->compression);
start_meas(&ru->compression);
for (element_id=0; element_id<db_halflength; element_id+=8) {
i = (uint16_t*) &rx0[element_id]; for (element_id=0; element_id<db_halflength; element_id+=8) {
d = (uint16_t*) &data_block[element_id]; i = (uint16_t*) &rx0[element_id];
d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8)); d = (uint16_t*) &data_block[element_id];
d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8)); d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8));
d[2] = ((uint16_t) lin2alaw_if4p5[i[4]]) | ((uint16_t)(lin2alaw_if4p5[i[5]]<<8)); d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8));
d[3] = ((uint16_t) lin2alaw_if4p5[i[6]]) | ((uint16_t)(lin2alaw_if4p5[i[7]]<<8)); d[2] = ((uint16_t) lin2alaw_if4p5[i[4]]) | ((uint16_t)(lin2alaw_if4p5[i[5]]<<8));
d[4] = ((uint16_t) lin2alaw_if4p5[i[8]]) | ((uint16_t)(lin2alaw_if4p5[i[9]]<<8)); d[3] = ((uint16_t) lin2alaw_if4p5[i[6]]) | ((uint16_t)(lin2alaw_if4p5[i[7]]<<8));
d[5] = ((uint16_t) lin2alaw_if4p5[i[10]]) | ((uint16_t)(lin2alaw_if4p5[i[11]]<<8)); d[4] = ((uint16_t) lin2alaw_if4p5[i[8]]) | ((uint16_t)(lin2alaw_if4p5[i[9]]<<8));
d[6] = ((uint16_t) lin2alaw_if4p5[i[12]]) | ((uint16_t)(lin2alaw_if4p5[i[13]]<<8)); d[5] = ((uint16_t) lin2alaw_if4p5[i[10]]) | ((uint16_t)(lin2alaw_if4p5[i[11]]<<8));
d[7] = ((uint16_t) lin2alaw_if4p5[i[14]]) | ((uint16_t)(lin2alaw_if4p5[i[15]]<<8)); d[6] = ((uint16_t) lin2alaw_if4p5[i[12]]) | ((uint16_t)(lin2alaw_if4p5[i[13]]<<8));
d[7] = ((uint16_t) lin2alaw_if4p5[i[14]]) | ((uint16_t)(lin2alaw_if4p5[i[15]]<<8));
i = (uint16_t*) &rx1[element_id];
d = (uint16_t*) &data_block[element_id+db_halflength]; i = (uint16_t*) &rx1[element_id];
d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8)); d = (uint16_t*) &data_block[element_id+db_halflength];
d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8)); d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8));
d[2] = ((uint16_t) lin2alaw_if4p5[i[4]]) | ((uint16_t)(lin2alaw_if4p5[i[5]]<<8)); d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8));
d[3] = ((uint16_t) lin2alaw_if4p5[i[6]]) | ((uint16_t)(lin2alaw_if4p5[i[7]]<<8)); d[2] = ((uint16_t) lin2alaw_if4p5[i[4]]) | ((uint16_t)(lin2alaw_if4p5[i[5]]<<8));
d[4] = ((uint16_t) lin2alaw_if4p5[i[8]]) | ((uint16_t)(lin2alaw_if4p5[i[9]]<<8)); d[3] = ((uint16_t) lin2alaw_if4p5[i[6]]) | ((uint16_t)(lin2alaw_if4p5[i[7]]<<8));
d[5] = ((uint16_t) lin2alaw_if4p5[i[10]]) | ((uint16_t)(lin2alaw_if4p5[i[11]]<<8)); d[4] = ((uint16_t) lin2alaw_if4p5[i[8]]) | ((uint16_t)(lin2alaw_if4p5[i[9]]<<8));
d[6] = ((uint16_t) lin2alaw_if4p5[i[12]]) | ((uint16_t)(lin2alaw_if4p5[i[13]]<<8)); d[5] = ((uint16_t) lin2alaw_if4p5[i[10]]) | ((uint16_t)(lin2alaw_if4p5[i[11]]<<8));
d[7] = ((uint16_t) lin2alaw_if4p5[i[14]]) | ((uint16_t)(lin2alaw_if4p5[i[15]]<<8)); d[6] = ((uint16_t) lin2alaw_if4p5[i[12]]) | ((uint16_t)(lin2alaw_if4p5[i[13]]<<8));
d[7] = ((uint16_t) lin2alaw_if4p5[i[14]]) | ((uint16_t)(lin2alaw_if4p5[i[15]]<<8));
}
} }
stop_meas(&ru->compression); stop_meas(&ru->compression);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
packet_header->frame_status &= ~(0x07);
packet_header->frame_status |= ru->nb_rx-1;
packet_header->frame_status &= ~(0x000f<<26); packet_header->frame_status &= ~(0x000f<<26);
packet_header->frame_status |= (symbol_id&0x000f)<<26; packet_header->frame_status |= (symbol_id&0x000f)<<26;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
...@@ -182,7 +189,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -182,7 +189,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
if ((ru->ifdevice.trx_write_func(&ru->ifdevice, if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
symbol_id, symbol_id,
&tx_buffer, &tx_buffer,
db_fulllength, db_fulllength*ru->nb_rx,
1, 1,
IF4p5_PULFFT)) < 0) { IF4p5_PULFFT)) < 0) {
perror("ETHERNET write for IF4p5_PULFFT\n"); perror("ETHERNET write for IF4p5_PULFFT\n");
...@@ -221,28 +228,30 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -221,28 +228,30 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
int16_t *rxF; int16_t *rxF;
for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) {
#ifdef Rel14 #ifdef Rel14
if (packet_type > IF4p5_PRACH) if (packet_type > IF4p5_PRACH)
rxF = &prach_rxsigF_br[packet_type - IF4p5_PRACH - 1][0][0]; rxF = &prach_rxsigF_br[packet_type - IF4p5_PRACH - 1][0][0];
else else
#endif #endif
rxF = &prach_rxsigF[0][0]; rxF = &prach_rxsigF[antenna_id][0];
AssertFatal(rxF!=NULL,"rxF is null\n"); AssertFatal(rxF!=NULL,"rxF is null\n");
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
memcpy((void *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t), memcpy((void *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t+PRACH_BLOCK_SIZE_BYTES*antenna_id),
(void*)rxF, (void*)rxF,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} else { } else {
memcpy((void *)(tx_buffer_prach + sizeof_IF4p5_header_t), memcpy((void *)(tx_buffer_prach + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES*antenna_id),
(void *)rxF, (void *)rxF,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
}
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
if ((ru->ifdevice.trx_write_func(&ru->ifdevice, if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
symbol_id, symbol_id,
&tx_buffer_prach, &tx_buffer_prach,
db_fulllength, db_fulllength*ru->nb_rx,
1, 1,
packet_type)) < 0) { packet_type)) < 0) {
perror("ETHERNET write for IF4p5_PRACH\n"); perror("ETHERNET write for IF4p5_PRACH\n");
...@@ -276,9 +285,9 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint ...@@ -276,9 +285,9 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 ); if (ru->idx==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
if (ru->function == NGFI_RRU_IF4p5) { if (ru->function == NGFI_RRU_IF4p5) {
db_fulllength = (12*fp->N_RB_DL); db_fulllength = (12*fp->N_RB_DL)*ru->nb_tx;
} else { // This is not an RRU } else { // This is not an RRU
db_fulllength = (12*fp->N_RB_UL); db_fulllength = (12*fp->N_RB_UL)*ru->nb_rx;
} }
db_halflength = db_fulllength>>1; db_halflength = db_fulllength>>1;
...@@ -316,7 +325,9 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint ...@@ -316,7 +325,9 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
*packet_type = packet_header->sub_type; *packet_type = packet_header->sub_type;
LOG_D(PHY,"recv_IF4p5: Frame %d, Subframe %d: packet_type %x\n",*frame,*subframe,*packet_type); LOG_D(PHY,"recv_IF4p5: Frame %d, Subframe %d: packet_type %x\n",*frame,*subframe,*packet_type);
if (*packet_type == IF4p5_PDLFFT) { if (*packet_type == IF4p5_PDLFFT) {
db_fulllength/=ru->nb_tx;
db_halflength/=ru->nb_tx;
*symbol_number = ((packet_header->frame_status)>>26)&0x000f; *symbol_number = ((packet_header->frame_status)>>26)&0x000f;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF4_SYMBOL, *symbol_number ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF4_SYMBOL, *symbol_number );
LOG_D(PHY,"DL_IF4p5: RU %d frame %d, subframe %d, symbol %d\n",ru->idx,*frame,*subframe,*symbol_number); LOG_D(PHY,"DL_IF4p5: RU %d frame %d, subframe %d, symbol %d\n",ru->idx,*frame,*subframe,*symbol_number);
...@@ -324,18 +335,22 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint ...@@ -324,18 +335,22 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size)+1;// + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size)+1;// + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 );
for (element_id=0; element_id<db_halflength; element_id++) { for (int antenna_id=0;antenna_id<ru->nb_tx;antenna_id++) {
i = (uint16_t*) &txdataF[0][blockoffsetF+element_id]; for (element_id=0; element_id<db_halflength; element_id++) {
*i = alaw2lin_if4p5[ (data_block[element_id] & 0xff) ]; i = (uint16_t*) &txdataF[antenna_id][blockoffsetF+element_id];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id]>>8) ]; *i = alaw2lin_if4p5[ (data_block[element_id] & 0xff) ];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id]>>8) ];
i = (uint16_t*) &txdataF[0][slotoffsetF+element_id];
*i = alaw2lin_if4p5[ (data_block[element_id+db_halflength] & 0xff) ]; i = (uint16_t*) &txdataF[antenna_id][slotoffsetF+element_id];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id+db_halflength]>>8) ]; *i = alaw2lin_if4p5[ (data_block[element_id+db_halflength] & 0xff) ];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id+db_halflength]>>8) ];
}
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
} else if (*packet_type == IF4p5_PULFFT) { } else if (*packet_type == IF4p5_PULFFT) {
db_fulllength/=ru->nb_rx;
db_halflength/=ru->nb_rx;
*symbol_number = ((packet_header->frame_status)>>26)&0x000f; *symbol_number = ((packet_header->frame_status)>>26)&0x000f;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF4_SYMBOL, *symbol_number ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF4_SYMBOL, *symbol_number );
...@@ -343,50 +358,53 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint ...@@ -343,50 +358,53 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size); slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size);
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 );
for (element_id=0; element_id<db_halflength; element_id++) { for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) {
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id]; for (element_id=0; element_id<db_halflength; element_id++) {
*i = alaw2lin_if4p5[ (data_block[element_id] & 0xff) ]; i = (uint16_t*) &rxdataF[antenna_id][blockoffsetF+element_id];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id]>>8) ]; *i = alaw2lin_if4p5[ (data_block[element_id] & 0xff) ];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id]>>8) ];
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id]; i = (uint16_t*) &rxdataF[antenna_id][slotoffsetF+element_id];
*i = alaw2lin_if4p5[ (data_block[element_id+db_halflength] & 0xff) ]; *i = alaw2lin_if4p5[ (data_block[element_id+db_halflength] & 0xff) ];
*(i+1) = alaw2lin_if4p5[ (data_block[element_id+db_halflength]>>8) ]; *(i+1) = alaw2lin_if4p5[ (data_block[element_id+db_halflength]>>8) ];
//if (element_id==0) LOG_I(PHY,"recv_if4p5: symbol %d rxdata0 = (%u,%u)\n",*symbol_number,*i,*(i+1)); //if (element_id==0) LOG_I(PHY,"recv_if4p5: symbol %d rxdata0 = (%u,%u)\n",*symbol_number,*i,*(i+1));
}
LOG_D(PHY,"PULFFT_IF4p5: CC_id %d : frame %d, subframe %d (symbol %d)=> %d dB\n",ru->idx,*frame,*subframe,*symbol_number,
dB_fixed(signal_energy((int*)&rxdataF[antenna_id][slotoffsetF],db_halflength)+
signal_energy((int*)&rxdataF[antenna_id][blockoffsetF],db_halflength)));
} }
LOG_D(PHY,"PULFFT_IF4p5: CC_id %d : frame %d, subframe %d (symbol %d)=> %d dB\n",ru->idx,*frame,*subframe,*symbol_number, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
dB_fixed(signal_energy((int*)&rxdataF[0][slotoffsetF],db_halflength)+
signal_energy((int*)&rxdataF[0][blockoffsetF],db_halflength)));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
} else if (*packet_type >= IF4p5_PRACH && } else if (*packet_type >= IF4p5_PRACH &&
*packet_type <= IF4p5_PRACH + 4) { *packet_type <= IF4p5_PRACH + 4) {
int16_t *rxF; int16_t *rxF;
for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) {
#ifdef Rel14 #ifdef Rel14
if (*packet_type > IF4p5_PRACH) if (*packet_type > IF4p5_PRACH)
rxF = &prach_rxsigF_br[*packet_type - IF4p5_PRACH - 1][0][0]; rxF = &prach_rxsigF_br[*packet_type - IF4p5_PRACH - 1][antenna_id][0];
else else
#endif #endif
rxF = &prach_rxsigF[0][0]; rxF = &prach_rxsigF[antenna_id][0];
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
db_fulllength = PRACH_NUM_SAMPLES; db_fulllength = PRACH_NUM_SAMPLES;
AssertFatal(rxF!=NULL,"rxF is null\n"); AssertFatal(rxF!=NULL,"rxF is null\n");
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
memcpy(rxF, memcpy(rxF,
(int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t), (int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t)+PRACH_BLOCK_SIZE_BYTES*antenna_id,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} else { } else {
memcpy(rxF, memcpy(rxF,
(int16_t*) (rx_buffer+sizeof_IF4p5_header_t), (int16_t*) (rx_buffer+sizeof_IF4p5_header_t)+PRACH_BLOCK_SIZE_BYTES*antenna_id,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
}
} }
LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe, LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe,
dB_fixed(signal_energy((int*)&prach_rxsigF[0][0],839))); dB_fixed(signal_energy((int*)&prach_rxsigF[0][0],839)));
for (idx=0;idx<ru->num_eNB;idx++) ru->wakeup_prach_eNB(ru->eNB_list[idx],ru,*frame,*subframe); for (idx=0;idx<ru->num_eNB;idx++) ru->wakeup_prach_eNB(ru->eNB_list[idx],ru,*frame,*subframe);
...@@ -449,21 +467,21 @@ void malloc_IF4p5_buffer(RU_t *ru) { ...@@ -449,21 +467,21 @@ void malloc_IF4p5_buffer(RU_t *ru) {
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
ru->ifbuffer.tx[i] = malloc(RAW_IF4p5_PRACH_SIZE_BYTES); ru->ifbuffer.tx[i] = malloc(RAW_IF4p5_PRACH_SIZE_BYTES*ru->nb_tx);
memset((void*)ru->ifbuffer.tx[i],0,RAW_IF4p5_PRACH_SIZE_BYTES); memset((void*)ru->ifbuffer.tx[i],0,RAW_IF4p5_PRACH_SIZE_BYTES*ru->nb_tx);
} }
ru->ifbuffer.tx_prach = malloc(RAW_IF4p5_PRACH_SIZE_BYTES); ru->ifbuffer.tx_prach = malloc(RAW_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
memset((void*)ru->ifbuffer.tx_prach,0,RAW_IF4p5_PRACH_SIZE_BYTES); memset((void*)ru->ifbuffer.tx_prach,0,RAW_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
ru->ifbuffer.rx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES); ru->ifbuffer.rx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
memset((void*)ru->ifbuffer.rx,0,RAW_IF4p5_PRACH_SIZE_BYTES); memset((void*)ru->ifbuffer.rx,0,RAW_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
} else { } else {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
ru->ifbuffer.tx[i] = malloc(UDP_IF4p5_PRACH_SIZE_BYTES); ru->ifbuffer.tx[i] = malloc(UDP_IF4p5_PRACH_SIZE_BYTES*ru->nb_tx);
memset((void*)ru->ifbuffer.tx[i],0,UDP_IF4p5_PRACH_SIZE_BYTES); memset((void*)ru->ifbuffer.tx[i],0,UDP_IF4p5_PRACH_SIZE_BYTES*ru->nb_tx);
} }
ru->ifbuffer.tx_prach = malloc(UDP_IF4p5_PRACH_SIZE_BYTES); ru->ifbuffer.tx_prach = malloc(UDP_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
memset((void*)ru->ifbuffer.tx_prach,0,UDP_IF4p5_PRACH_SIZE_BYTES); memset((void*)ru->ifbuffer.tx_prach,0,UDP_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
ru->ifbuffer.rx = malloc(UDP_IF4p5_PRACH_SIZE_BYTES); ru->ifbuffer.rx = malloc(UDP_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
memset((void*)ru->ifbuffer.rx,0,UDP_IF4p5_PRACH_SIZE_BYTES); memset((void*)ru->ifbuffer.rx,0,UDP_IF4p5_PRACH_SIZE_BYTES*ru->nb_rx);
} }
} }
...@@ -74,9 +74,9 @@ eNBs = ...@@ -74,9 +74,9 @@ eNBs =
srs_ackNackST =; srs_ackNackST =;
srs_MaxUpPts =;*/ srs_MaxUpPts =;*/
pusch_p0_Nominal = -96; pusch_p0_Nominal = -104;
pusch_alpha = "AL1"; pusch_alpha = "AL1";
pucch_p0_Nominal = -104; pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6; msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3"; pucch_deltaF_Format1b = "deltaF3";
...@@ -188,8 +188,8 @@ RUs = ( ...@@ -188,8 +188,8 @@ RUs = (
remote_portd = 50001; remote_portd = 50001;
local_rf = "no" local_rf = "no"
tr_preference = "udp_if4p5" tr_preference = "udp_if4p5"
nb_tx = 1 nb_tx = 2
nb_rx = 1 nb_rx = 2
att_tx = 0 att_tx = 0
att_rx = 0; att_rx = 0;
eNB_instances = [0]; eNB_instances = [0];
......
...@@ -1300,7 +1300,7 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1300,7 +1300,7 @@ void wakeup_eNBs(RU_t *ru) {
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) { if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) {
proc->RU_mask[ru->proc.subframe_rx] = 0; proc->RU_mask[ru->proc.subframe_rx] = 0;
clock_gettime(CLOCK_MONOTONIC,&t); clock_gettime(CLOCK_MONOTONIC,&t);
AssertFatal(t.tv_nsec < proc->t[ru->proc.subframe_rx].tv_nsec+500000, AssertFatal(t.tv_nsec < proc->t[ru->proc.subframe_rx].tv_nsec+5000000,
"Time difference for subframe %d => %d > 5ms\n", "Time difference for subframe %d => %d > 5ms\n",
ru->proc.subframe_rx,t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec); ru->proc.subframe_rx,t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment