mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 12:40:28 +00:00
Compare commits
7 Commits
cppcheck_2
...
develop-mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06bae02383 | ||
|
|
7d0c9393ae | ||
|
|
6c6e54f851 | ||
|
|
bbaec98c6a | ||
|
|
2cb279d633 | ||
|
|
06c4da479b | ||
|
|
401549af59 |
@@ -79,6 +79,8 @@ typedef struct {
|
||||
int *nb_L1_CC;
|
||||
/// Number of RU instances in this node
|
||||
int nb_RU;
|
||||
/// Flag to start collecting channel estimates sent from the RRUs
|
||||
int collect;
|
||||
/// FlexRAN context variables
|
||||
flexran_agent_info_t **flexran;
|
||||
/// eNB context variables
|
||||
|
||||
@@ -45,6 +45,22 @@ ID = ENB_PHY_INPUT_SIGNAL
|
||||
DESC = eNodeB received signal in the time domain for a duration of 1ms
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata
|
||||
ID = RAU_INPUT_SIGNAL
|
||||
DESC = RAU received data from the RRUs
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,tag : int,frame : int,subframe : buffer,rxdataF
|
||||
ID = RAU_INPUT_DMRS
|
||||
DESC = RAU received DMRS from the RRUs
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,tag : int,frame : int,subframe : buffer,rxdataF_ext
|
||||
ID = CALIBRATION_CHANNEL_ESTIMATES
|
||||
DESC = RAU received DMRS estimates from the RRUs
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,tag : int,frame : int,subframe : int,symbol : buffer,calib_ch
|
||||
ID = CALIBRATION_CHANNEL_ESTIMATES_TIME
|
||||
DESC = RAU received DMRS estimates in the time domain from the RRUs
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,tag : int,frame : int,subframe : buffer,calib_ch_time
|
||||
ID = ENB_PHY_OUTPUT_SIGNAL
|
||||
DESC = eNodeB sent signal in the time domain for a duration of 1ms
|
||||
GROUP = ALL:PHY:HEAVY:ENB
|
||||
|
||||
@@ -18,6 +18,8 @@ void usage(void)
|
||||
" (you can use several -f options)\n"
|
||||
" -after <raw time> <nsec> 'event' time has to be greater than this\n"
|
||||
" -count <n> dump 'n' matching events (less if EOF reached)\n"
|
||||
" -modulo <n> dump frame which modulo <rru-count> is <n>\n"
|
||||
" -rru-count <n> set rru count\n"
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
@@ -51,10 +53,13 @@ int main(int n, char **v)
|
||||
int filter_arg[n];
|
||||
int filter_value[n];
|
||||
int filter_count = 0;
|
||||
int filter_frame;
|
||||
int buffer_arg;
|
||||
int found;
|
||||
int count = 1;
|
||||
int check_time = 0;
|
||||
int modulo = 0;
|
||||
int rru_count = 1;
|
||||
time_t sec;
|
||||
long nsec;
|
||||
|
||||
@@ -77,6 +82,10 @@ int main(int n, char **v)
|
||||
}
|
||||
if (!strcmp(v[i], "-count"))
|
||||
{ if (i > n-2) usage(); count = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-modulo"))
|
||||
{ if (i > n-2) usage(); modulo = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-rru-count"))
|
||||
{ if (i > n-2) usage(); rru_count = atoi(v[++i]); continue; }
|
||||
if (file == NULL) { file = v[i]; continue; }
|
||||
if (event_name == NULL) { event_name = v[i]; continue; }
|
||||
if (buffer_name == NULL) { buffer_name = v[i]; continue; }
|
||||
@@ -108,6 +117,8 @@ int main(int n, char **v)
|
||||
for (i = 0; i < filter_count; i++)
|
||||
filter_arg[i] = get_filter_arg(&f, filter[i], "int");
|
||||
|
||||
filter_frame = get_filter_arg(&f, "frame", "int");
|
||||
|
||||
fd = open(file, O_RDONLY);
|
||||
if (fd == -1) { perror(file); exit(1); }
|
||||
|
||||
@@ -125,6 +136,8 @@ int main(int n, char **v)
|
||||
break;
|
||||
if (i != filter_count)
|
||||
continue;
|
||||
if (e.e[filter_frame].i % rru_count != modulo)
|
||||
continue;
|
||||
if (check_time &&
|
||||
!(e.sending_time.tv_sec > sec ||
|
||||
(e.sending_time.tv_sec == sec && e.sending_time.tv_nsec >= nsec)))
|
||||
|
||||
@@ -482,30 +482,31 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
//FIXME
|
||||
pusch_vars[UE_id] = (LTE_eNB_PUSCH *) malloc16_clear (NUMBER_OF_UE_MAX * sizeof (LTE_eNB_PUSCH));
|
||||
|
||||
pusch_vars[UE_id]->rxdataF_ext = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->drs_ch_estimates = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_comp = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->ul_ch_mag = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->ul_ch_magb = (int32_t **) malloc16 (2 * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_ext = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->drs_ch_estimates = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->rxdataF_comp = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->ul_ch_mag = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
pusch_vars[UE_id]->ul_ch_magb = (int32_t **) malloc16 (NB_PUSCH_ANT_PORTS * sizeof (int32_t *));
|
||||
|
||||
AssertFatal (fp->ofdm_symbol_size > 127, "fp->ofdm_symbol_size %d<128\n", fp->ofdm_symbol_size);
|
||||
AssertFatal (fp->symbols_per_tti > 11, "fp->symbols_per_tti %d < 12\n", fp->symbols_per_tti);
|
||||
AssertFatal (fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n", fp->N_RB_UL);
|
||||
for (i = 0; i < 2; i++) {
|
||||
for (i = 0; i < NB_PUSCH_ANT_PORTS; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear( NB_PUSCH_ANT_PORTS*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
}
|
||||
|
||||
pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
LOG_I(PHY,"llr[0] %p\n",pusch_vars[UE_id]->llr);
|
||||
} //UE_id
|
||||
|
||||
|
||||
@@ -570,7 +571,7 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB)
|
||||
free_and_zero(prach_vars->rxsigF[0]);
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
for (i = 0; i < NB_PUSCH_ANT_PORTS; i++) {
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_ext[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->rxdataF_ext2[i]);
|
||||
free_and_zero(pusch_vars[UE_id]->drs_ch_estimates[i]);
|
||||
|
||||
@@ -46,9 +46,7 @@ int phy_init_RU(RU_t *ru) {
|
||||
|
||||
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx);
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
generate_ul_ref_sigs_rx();
|
||||
}
|
||||
generate_ul_ref_sigs_rx();
|
||||
|
||||
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
|
||||
// Time-domain signals
|
||||
@@ -62,12 +60,10 @@ int phy_init_RU(RU_t *ru) {
|
||||
fp->samples_per_tti*10*sizeof(int32_t));
|
||||
}
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
calibration->drs_ch_estimates_time = (int32_t**)malloc16_clear(ru->nb_rx*sizeof(int32_t*));
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
calibration->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear(2*sizeof(int32_t)*fp->ofdm_symbol_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0;i<ru->nb_rx;i++) {
|
||||
@@ -107,7 +103,6 @@ int phy_init_RU(RU_t *ru) {
|
||||
LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx);
|
||||
}
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
// allocate FFT output buffers after extraction (RX)
|
||||
calibration->rxdataF_ext = (int32_t**)malloc16(2*sizeof(int32_t*));
|
||||
calibration->drs_ch_estimates = (int32_t**)malloc16(2*sizeof(int32_t*));
|
||||
@@ -117,7 +112,6 @@ int phy_init_RU(RU_t *ru) {
|
||||
LOG_I(PHY,"rxdataF_ext[%d] %p for RU %d\n",i,calibration->rxdataF_ext[i],ru->idx);
|
||||
calibration->drs_ch_estimates[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti);
|
||||
}
|
||||
}
|
||||
|
||||
/* 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]),
|
||||
@@ -196,12 +190,10 @@ void phy_free_RU(RU_t *ru)
|
||||
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
|
||||
for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdata[i]);
|
||||
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]);
|
||||
if (ru->is_slave == 1) {
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(calibration->drs_ch_estimates_time[i]);
|
||||
}
|
||||
free_and_zero(calibration->drs_ch_estimates_time);
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(calibration->drs_ch_estimates_time[i]);
|
||||
}
|
||||
free_and_zero(calibration->drs_ch_estimates_time);
|
||||
free_and_zero(ru->common.txdata);
|
||||
free_and_zero(ru->common.rxdata);
|
||||
} // else: IF5 or local RF -> nothing to free()
|
||||
@@ -217,14 +209,12 @@ void phy_free_RU(RU_t *ru)
|
||||
// free FFT output buffers (RX)
|
||||
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdataF[i]);
|
||||
free_and_zero(ru->common.rxdataF);
|
||||
if (ru->is_slave == 1) {
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(calibration->rxdataF_ext[i]);
|
||||
free_and_zero(calibration->drs_ch_estimates[i]);
|
||||
}
|
||||
free_and_zero(calibration->rxdataF_ext);
|
||||
free_and_zero(calibration->drs_ch_estimates);
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(calibration->rxdataF_ext[i]);
|
||||
free_and_zero(calibration->drs_ch_estimates[i]);
|
||||
}
|
||||
free_and_zero(calibration->rxdataF_ext);
|
||||
free_and_zero(calibration->drs_ch_estimates);
|
||||
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(ru->prach_rxsigF[i]);
|
||||
|
||||
@@ -127,7 +127,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB *eNB,module_id_t UE_id)
|
||||
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
|
||||
|
||||
AssertFatal(frame_parms->ofdm_symbol_size > 127,"frame_parms->ofdm_symbol_size %d<128\n",frame_parms->ofdm_symbol_size);
|
||||
AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<3,"frame_parms->nb_antennas_rx %d not in [0,1]\n",
|
||||
AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<NB_PUSCH_ANT_PORTS+1,"frame_parms->nb_antennas_rx %d not in [0,1,2]\n",
|
||||
frame_parms->nb_antennas_rx);
|
||||
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
|
||||
temp = 0;
|
||||
|
||||
@@ -117,6 +117,57 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
|
||||
slotoffsetF += fp->ofdm_symbol_size;
|
||||
blockoffsetF += fp->ofdm_symbol_size;
|
||||
}
|
||||
} else if (packet_type == IF4p5_PULCALIB) {
|
||||
LOG_D(PHY,"send PULCALIB_IF4p5: RU %d frame %d, subframe %d\n",ru->idx,frame,subframe);
|
||||
|
||||
AssertFatal(subframe_select(fp,subframe)==SF_S, "calling PULCALIB in non-S subframe\n");
|
||||
db_fulllength = 12*fp->N_RB_UL;
|
||||
db_halflength = (db_fulllength)>>1;
|
||||
slotoffsetF = 0;
|
||||
blockoffsetF = (fp->ofdm_symbol_size)-db_halflength;
|
||||
|
||||
|
||||
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||
} else {
|
||||
packet_header = (IF4p5_header_t *)(tx_buffer);
|
||||
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
|
||||
}
|
||||
gen_IF4p5_ul_header(packet_header, packet_type, frame, subframe);
|
||||
|
||||
AssertFatal(rxdataF[0]!=NULL,"rxdataF[0] is null\n");
|
||||
for (symbol_id=0; symbol_id<11; symbol_id++) {
|
||||
if (symbol_id==3 || symbol_id==10) {
|
||||
for (int antenna_id=0; antenna_id<ru->nb_tx; antenna_id++) {
|
||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||
i = (uint16_t*) &rxdataF[antenna_id][blockoffsetF+element_id];
|
||||
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
|
||||
|
||||
i = (uint16_t*) &rxdataF[antenna_id][slotoffsetF+element_id];
|
||||
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 );
|
||||
packet_header->frame_status &= ~(0x7);
|
||||
packet_header->frame_status |= (ru->nb_rx-1);
|
||||
|
||||
packet_header->frame_status &= ~(0x000f<<26);
|
||||
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 1 );
|
||||
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
symbol_id,
|
||||
&tx_buffer,
|
||||
db_fulllength*ru->nb_rx,
|
||||
1,
|
||||
IF4p5_PULCALIB)) < 0) {
|
||||
perror("ETHERNET write for IF4p5_PULCALIB\n");
|
||||
}
|
||||
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 0 );
|
||||
}
|
||||
slotoffsetF += fp->ofdm_symbol_size;
|
||||
blockoffsetF += fp->ofdm_symbol_size;
|
||||
}
|
||||
} else if ((packet_type == IF4p5_PULFFT)||
|
||||
(packet_type == IF4p5_PULTICK)){
|
||||
db_fulllength = 12*fp->N_RB_UL;
|
||||
@@ -388,6 +439,35 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
|
||||
data_block+=db_fulllength;
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
|
||||
} else if (*packet_type == IF4p5_PULCALIB) {
|
||||
db_fulllength/=ru->nb_rx;
|
||||
db_halflength/=ru->nb_rx;
|
||||
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF4_SYMBOL, *symbol_number );
|
||||
if (ru->idx==0) LOG_D(PHY,"UL_IF4p5: RU %d : frame %d, subframe %d, symbol %d\n",ru->idx,*frame,*subframe,*symbol_number);
|
||||
|
||||
|
||||
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size);
|
||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 );
|
||||
for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) {
|
||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||
i = (uint16_t*) &rxdataF[antenna_id][blockoffsetF+element_id];
|
||||
*i = alaw2lin_if4p5[ (data_block[element_id] & 0xff) ];
|
||||
*(i+1) = alaw2lin_if4p5[ (data_block[element_id]>>8) ];
|
||||
|
||||
i = (uint16_t*) &rxdataF[antenna_id][slotoffsetF+element_id];
|
||||
*i = alaw2lin_if4p5[ (data_block[element_id+db_halflength] & 0xff) ];
|
||||
*(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));
|
||||
}
|
||||
LOG_D(PHY,"PULCALIB_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)));
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
|
||||
} else if (*packet_type >= IF4p5_PRACH &&
|
||||
*packet_type <= IF4p5_PRACH + 4) {
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#define IF4p5_PRACH_BR_CE2 0x0024
|
||||
#define IF4p5_PRACH_BR_CE3 0x0025
|
||||
#define IF4p5_PULTICK 0x0026
|
||||
#define IF4p5_PULCALIB 0x0027
|
||||
|
||||
struct IF4p5_header {
|
||||
/// Type
|
||||
|
||||
@@ -157,7 +157,19 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
(2*frame_parms->nb_prefix_samples)+
|
||||
frame_parms->nb_prefix_samples0],
|
||||
(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
// undo 7.5 kHz offset for symbol 10 (for calibration)
|
||||
if (slot == 3){
|
||||
memcpy((void*)&rxdata_7_5kHz[aa][(10*frame_parms->ofdm_symbol_size)+
|
||||
(8*frame_parms->nb_prefix_samples)+
|
||||
2*frame_parms->nb_prefix_samples0],
|
||||
(void*)&rxdata[aa][slot_offset+ru->N_TA_offset+
|
||||
(3*frame_parms->ofdm_symbol_size)+
|
||||
(2*frame_parms->nb_prefix_samples)+
|
||||
frame_parms->nb_prefix_samples0],
|
||||
(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,6 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length)
|
||||
register int32x4_t tmpE;
|
||||
int32x2_t tmpE2;
|
||||
int16x4_t *in = (int16x4_t *)input;
|
||||
|
||||
tmpE = vdupq_n_s32(0);
|
||||
|
||||
for (i=0; i<length>>1; i++) {
|
||||
|
||||
@@ -311,9 +311,13 @@ typedef enum {
|
||||
} rru_cmd_t;
|
||||
|
||||
typedef struct RU_t_s{
|
||||
/// tag of this ru
|
||||
uint32_t tag;
|
||||
/// number of RRUs
|
||||
uint32_t p;
|
||||
/// index of this ru
|
||||
uint32_t idx;
|
||||
/// Pointer to configuration file
|
||||
/// Pointer to configuration file
|
||||
char *rf_config_file;
|
||||
/// southbound interface
|
||||
RU_if_south_t if_south;
|
||||
@@ -345,6 +349,8 @@ typedef struct RU_t_s{
|
||||
int wait_cnt;
|
||||
/// counter to delay start of slave RUs until stable synchronization
|
||||
int wait_check;
|
||||
/// counter to count missed synch events during synchronization of RU
|
||||
int missed_synch_events;
|
||||
/// Total gain of receive chain
|
||||
uint32_t rx_total_gain_dB;
|
||||
/// number of bands that this device can support
|
||||
@@ -533,7 +539,10 @@ typedef struct RRU_capabilities_s {
|
||||
} RRU_capabilities_t;
|
||||
|
||||
typedef struct RRU_config_s {
|
||||
|
||||
/// tag of an RU
|
||||
uint32_t tag;
|
||||
/// number of slave RRUs
|
||||
uint32_t p;
|
||||
/// Fronthaul format
|
||||
RU_if_south_t FH_fmt;
|
||||
/// number of EUTRA bands (<=4) configured in RRU
|
||||
@@ -680,7 +689,7 @@ typedef struct {
|
||||
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_magb;
|
||||
/// measured RX power based on DRS
|
||||
int ulsch_power[2];
|
||||
int ulsch_power[4];
|
||||
/// \brief llr values.
|
||||
/// - first index: ? [0..1179743] (hard coded)
|
||||
int16_t *llr;
|
||||
|
||||
@@ -175,6 +175,7 @@
|
||||
#define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns
|
||||
|
||||
#define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports
|
||||
#define NB_PUSCH_ANT_PORTS 4 // total number of eNB pusch antenna ports
|
||||
|
||||
#ifdef EXMIMO
|
||||
#define TARGET_RX_POWER 55 // Target digital power for the AGC
|
||||
|
||||
@@ -166,7 +166,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
{
|
||||
if ((eNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0+eNB->prach_DTX_threshold)) {
|
||||
LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
eNB->Mod_id,
|
||||
eNB->CC_id,
|
||||
frame,
|
||||
|
||||
@@ -100,9 +100,9 @@ void feptx0(RU_t *ru,int slot) {
|
||||
*/
|
||||
int num_symb = 7;
|
||||
|
||||
if (subframe_select(fp,subframe) == SF_S) num_symb=fp->dl_symbols_in_S_subframe;
|
||||
//if (subframe_select(fp,subframe) == SF_S) num_symb=fp->dl_symbols_in_S_subframe+1;
|
||||
|
||||
if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) {
|
||||
if (ru->generate_dmrs_sync == 1 && subframe == 1 && aa==0) {
|
||||
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
|
||||
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
|
||||
|
||||
@@ -225,7 +225,9 @@ void feptx_ofdm_2thread(RU_t *ru) {
|
||||
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
if (subframe_select(fp,subframe)==SF_DL) {
|
||||
//The 2nd check is to force the RRUs to send DMRS at symbol 10-subframe 1-slot 1 (for calibration)
|
||||
if (subframe_select(fp,subframe)==SF_DL || ((subframe_select(fp,subframe)==SF_DL || subframe==1))) {
|
||||
//if (subframe_select(fp,subframe)==SF_DL) {
|
||||
// If this is not an S-subframe
|
||||
if (pthread_mutex_timedlock(&proc->mutex_feptx,&wait) != 0) {
|
||||
printf("[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)\n", proc->instance_cnt_feptx);
|
||||
@@ -628,7 +630,7 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
int check_sync_pos;
|
||||
int check_sync_pos,Ns,l;
|
||||
|
||||
struct timespec wait;
|
||||
if (proc->subframe_rx==1){
|
||||
@@ -681,7 +683,42 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
printf("delay in fep wait on condition in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
|
||||
}
|
||||
|
||||
if (proc->subframe_rx==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/) {
|
||||
if (proc->subframe_rx==1 && ru->is_slave==0) {
|
||||
|
||||
Ns = 1;
|
||||
l = 10;
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
calibration->rxdataF_ext,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
Ns,// Ns = slot number
|
||||
fp);
|
||||
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
calibration->rxdataF_ext,
|
||||
fp->N_RB_DL,
|
||||
proc->frame_rx,
|
||||
proc->subframe_rx,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
l,
|
||||
0,
|
||||
0);
|
||||
|
||||
T(T_CALIBRATION_CHANNEL_ESTIMATES, T_INT(ru->idx), T_INT(proc->frame_rx), T_INT(proc->subframe_rx),
|
||||
T_INT(l),T_BUFFER(&calibration->drs_ch_estimates[0][l*12*fp->N_RB_UL],
|
||||
12*fp->N_RB_UL*sizeof(int32_t)));
|
||||
}
|
||||
|
||||
|
||||
if (proc->subframe_rx==1 && ru->is_slave==1) {
|
||||
|
||||
Ns = 0;
|
||||
l = 3;
|
||||
|
||||
//LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
@@ -689,15 +726,9 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
3/(fp->symbols_per_tti/2),// Ns = slot number
|
||||
Ns,// Ns = slot number
|
||||
fp);
|
||||
|
||||
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
|
||||
proc,
|
||||
ru->idx,
|
||||
3%(fp->symbols_per_tti/2),
|
||||
3/(fp->symbols_per_tti/2));
|
||||
*/
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
@@ -708,7 +739,7 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
0,//u = 0..29
|
||||
0,//v = 0,1
|
||||
/*eNB->ulsch[ru->idx]->cyclicShift,cyclic_shift,0..7*/0,
|
||||
3,//l,
|
||||
l,//l
|
||||
0,//interpolate,
|
||||
0 /*eNB->ulsch[ru->idx]->rnti rnti or ru->ulsch[eNB_id]->rnti*/);
|
||||
|
||||
@@ -716,11 +747,29 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
|
||||
check_sync_pos = lte_est_timing_advance_pusch((PHY_VARS_eNB *)NULL,
|
||||
ru->idx);
|
||||
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
if ((check_sync_pos >= 0 && check_sync_pos<8) || (check_sync_pos < 0 && check_sync_pos>-8)) {
|
||||
LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
|
||||
ru->wait_check++;
|
||||
}
|
||||
else {
|
||||
ru->missed_synch_events++;
|
||||
LOG_I(PHY,"!!!!!!!!!!!! check_sync_pos %d, frame %d, cnt %d, missed %d\n",check_sync_pos,proc->frame_rx,ru->wait_check,ru->missed_synch_events);
|
||||
}
|
||||
|
||||
if (ru->missed_synch_events > 2) {
|
||||
ru->in_synch = 0;
|
||||
if (ru->stop_rf) {
|
||||
ru->stop_rf(ru);
|
||||
ru->state = RU_SYNC;
|
||||
ru->cmd = EMPTY;
|
||||
LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);
|
||||
} else AssertFatal(1==0,"ru->stop_rf doesn't exist\n");
|
||||
}
|
||||
|
||||
|
||||
if (ru->wait_check==20) {
|
||||
ru->state = RU_RUN;
|
||||
@@ -730,7 +779,7 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
|
||||
LOG_I(PHY,"Sending RRU_sync_ok to RAU\n");
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU %d\n",ru->idx);
|
||||
//LOG_I(PHY,"~~~~~~~~~ RU_RUN\n");
|
||||
LOG_D(PHY,"~~~~~~~~~ RU_RUN\n");
|
||||
/*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
|
||||
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
|
||||
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
|
||||
@@ -742,10 +791,45 @@ void ru_fep_full_2thread(RU_t *ru) {
|
||||
// check for synchronization error
|
||||
if (check_sync_pos >= 8 || check_sync_pos<=-8) {
|
||||
LOG_E(PHY,"~~~~~~~~~~~~~~ check_sync_pos %d, frame %d ---> LOST SYNC-EXIT\n", check_sync_pos, proc->frame_rx);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);
|
||||
}
|
||||
/*T(T_CALIBRATION_CHANNEL_ESTIMATES, T_INT(ru->idx), T_INT(proc->frame_rx), T_INT(proc->subframe_rx),
|
||||
T_INT(l),T_BUFFER(&calibration->drs_ch_estimates[0][l*12*fp->N_RB_UL],
|
||||
12*fp->N_RB_UL*sizeof(int32_t)));
|
||||
*/
|
||||
/*
|
||||
Ns = 1;
|
||||
l = 10;
|
||||
|
||||
LOG_D(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
calibration->rxdataF_ext,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
Ns,// Ns = slot number
|
||||
fp);
|
||||
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
calibration->rxdataF_ext,
|
||||
fp->N_RB_DL, //N_rb_alloc,
|
||||
proc->frame_rx,
|
||||
proc->subframe_rx,
|
||||
0,//u = 0..29
|
||||
0,//v = 0,1
|
||||
0,
|
||||
l,//l
|
||||
0,//interpolate,
|
||||
0 );
|
||||
|
||||
T(T_CALIBRATION_CHANNEL_ESTIMATES, T_INT(ru->idx), T_INT(proc->frame_rx), T_INT(proc->subframe_rx),
|
||||
T_INT(l),T_BUFFER(&calibration->drs_ch_estimates[0][l*12*fp->N_RB_UL],
|
||||
12*fp->N_RB_UL*sizeof(int32_t)));
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
AssertFatal(1==0,"Should not get here\n");
|
||||
|
||||
@@ -215,7 +215,9 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
} else if (flags == IF4p5_PULFFT) {
|
||||
packet_size = RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF4p5_PULTICK) {
|
||||
packet_size = RAW_IF4p5_PULTICK_SIZE_BYTES;
|
||||
packet_size = RAW_IF4p5_PULTICK_SIZE_BYTES;
|
||||
} else if (flags == IF4p5_PULCALIB) {
|
||||
packet_size = RAW_IF4p5_PULCALIB_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF5_MOBIPASS) {
|
||||
packet_size = RAW_IF5_MOBIPASS_SIZE_BYTES;
|
||||
} else {
|
||||
|
||||
@@ -235,7 +235,9 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
|
||||
} else if (flags == IF4p5_PULFFT) {
|
||||
packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
|
||||
} else if (flags == IF4p5_PULTICK) {
|
||||
packet_size = UDP_IF4p5_PULTICK_SIZE_BYTES;
|
||||
packet_size = UDP_IF4p5_PULTICK_SIZE_BYTES;
|
||||
} else if (flags == IF4p5_PULCALIB) {
|
||||
packet_size = UDP_IF4p5_PULCALIB_SIZE_BYTES(nblocks);
|
||||
} else if ((flags >= IF4p5_PRACH)&&
|
||||
(flags <= (IF4p5_PRACH+4))) {
|
||||
packet_size = UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + (nsamps<<1);
|
||||
|
||||
@@ -75,10 +75,12 @@
|
||||
#define RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define RAW_IF4p5_PULTICK_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t)
|
||||
#define RAW_IF4p5_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
|
||||
#define RAW_IF4p5_PULCALIB_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
#define UDP_IF4p5_PULTICK_SIZE_BYTES (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t)
|
||||
#define UDP_IF4p5_PRACH_SIZE_BYTES (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
|
||||
#define UDP_IF4p5_PULCALIB_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
|
||||
|
||||
// Mobipass packet sizes
|
||||
#define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280
|
||||
|
||||
@@ -139,6 +139,7 @@ static struct {
|
||||
} sync_phy_proc;
|
||||
|
||||
extern double cpuf;
|
||||
extern char ru_states[6][9];
|
||||
|
||||
|
||||
void init_eNB(int,int);
|
||||
@@ -154,6 +155,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
|
||||
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
extern int check_sync(RU_t *ru, RU_t *ru_master, int subframe);
|
||||
|
||||
//#define TICK_TO_US(ts) (ts.diff)
|
||||
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
|
||||
@@ -580,9 +582,71 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int ret;
|
||||
int i;
|
||||
struct timespec t;
|
||||
|
||||
LOG_D(PHY,"ENTERED wakeup_rxtx, %d.%d\n",ru_proc->frame_rx,ru_proc->subframe_rx);
|
||||
|
||||
|
||||
////----------------------------------------------------------------------
|
||||
|
||||
|
||||
AssertFatal(0==pthread_mutex_lock(&proc->mutex_RU),"");
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->proc.t[ru->proc.subframe_rx]);
|
||||
|
||||
if (proc->RU_mask[ru->proc.subframe_rx] == 0){
|
||||
proc->t[ru->proc.subframe_rx] = ru->proc.t[ru->proc.subframe_rx];
|
||||
LOG_D(PHY,"RU %d starting timer for frame %d subframe %d\n",ru->idx, ru->proc.frame_rx,ru->proc.subframe_rx);
|
||||
}
|
||||
|
||||
for (i=0;i<eNB->num_RU;i++) {
|
||||
if (eNB->RU_list[i]->wait_cnt==1 && ru->proc.subframe_rx!=9)
|
||||
eNB->RU_list[i]->wait_cnt=0;
|
||||
LOG_D(PHY,"RU %d has frame %d and subframe %d, state %s\n",eNB->RU_list[i]->idx,eNB->RU_list[i]->proc.frame_rx, eNB->RU_list[i]->proc.subframe_rx, ru_states[eNB->RU_list[i]->state]);
|
||||
if (ru == eNB->RU_list[i] && eNB->RU_list[i]->wait_cnt == 0) {
|
||||
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
|
||||
}else if (/*eNB->RU_list[i]->state == RU_SYNC || */
|
||||
(eNB->RU_list[i]->is_slave==1 && eNB->RU_list[i]->wait_cnt>0 && ru!=eNB->RU_list[i] && ru->is_slave==0)){
|
||||
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_MASK_RU, proc->RU_mask[ru->proc.subframe_rx]);
|
||||
if (ru->is_slave == 0 && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<i)) == 1) && eNB->RU_list[i]->state == RU_RUN) { // This is master & the RRU has already been received
|
||||
if (check_sync(eNB->RU_list[i],eNB->RU_list[0],ru->proc.subframe_rx) == 0)
|
||||
LOG_E(PHY,"RU %d is not SYNC, subframe %d, time %f this is master\n", eNB->RU_list[i]->idx, ru->proc.subframe_rx, fabs(eNB->RU_list[i]->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec));
|
||||
}else if (ru->is_slave == 1 && ru->state == RU_RUN && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<0)) == 1)){ // master already received. TODO: we assume that RU0 is master.
|
||||
if (check_sync(ru,eNB->RU_list[0],ru->proc.subframe_rx) == 0)
|
||||
LOG_E(PHY,"RU %d is not SYNC time, subframe %d, time %f\n", ru->idx, ru->proc.subframe_rx, fabs(ru->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec));
|
||||
}
|
||||
}
|
||||
|
||||
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) { // all RUs have provided their information so continue on and wakeup eNB top
|
||||
LOG_D(PHY,"ru_mask is %d \n ", proc->RU_mask[ru->proc.subframe_rx]);
|
||||
LOG_D(PHY,"the number of RU is %d, the current ru is RU %d \n ", (1<<eNB->num_RU)-1, ru->idx);
|
||||
LOG_D(PHY,"ru->proc.subframe_rx is %d \n", ru->proc.subframe_rx);
|
||||
LOG_D(PHY,"Reseting mask frame %d, subframe %d, this is RU %d\n",ru->proc.frame_rx, ru->proc.subframe_rx, ru->idx);
|
||||
proc->RU_mask[ru->proc.subframe_rx] = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_MASK_RU, proc->RU_mask[ru->proc.subframe_rx]);
|
||||
clock_gettime(CLOCK_MONOTONIC,&t);
|
||||
//stop_meas(&proc->ru_arrival_time);
|
||||
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
|
||||
|
||||
|
||||
// unlock RUs that are waiting for eNB processing to be completed
|
||||
LOG_D(PHY,"RU %d wakeup eNB top for subframe %d\n", ru->idx,ru->proc.subframe_rx);
|
||||
}
|
||||
else{ // not all RUs have provided their information
|
||||
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
|
||||
return 0;
|
||||
}
|
||||
|
||||
////----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// wake up TX for subframe n+sl_ahead
|
||||
// lock the TX mutex and make sure the thread is ready
|
||||
AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex)) == 0,"mutex_lock returns %d\n", ret);
|
||||
@@ -622,6 +686,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"mutex_unlock return %d\n",ret);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU+ru->idx, 0 );
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -635,15 +700,12 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU_PRACH))==0,"mutex_lock return %d\n",ret);
|
||||
for (i=0; i<eNB->num_RU; i++) {
|
||||
if (ru == eNB->RU_list[i]) {
|
||||
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU);
|
||||
|
||||
if ((proc->RU_mask_prach&(1<<i)) > 0)
|
||||
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH) from RU %d (num_RU %d, mask %x) has not been served yet!\n",
|
||||
eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach);
|
||||
|
||||
proc->RU_mask_prach |= (1<<i);
|
||||
}
|
||||
if (ru == eNB->RU_list[i] && eNB->RU_list[i]->wait_cnt == 0) {
|
||||
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU);
|
||||
proc->RU_mask_prach |= (1<<i);
|
||||
} else if (eNB->RU_list[i]->state == RU_SYNC || eNB->RU_list[i]->wait_cnt > 0) {
|
||||
proc->RU_mask_prach |= (1<<i);
|
||||
}
|
||||
}
|
||||
|
||||
if (proc->RU_mask_prach != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||
@@ -880,7 +942,7 @@ void init_eNB_proc(int inst) {
|
||||
proc->CC_id = CC_id;
|
||||
proc->first_rx =1;
|
||||
proc->first_tx =1;
|
||||
proc->RU_mask_tx = (1<<eNB->num_RU)-1;
|
||||
proc->RU_mask_tx = 0; // (1<<eNB->num_RU)-1;
|
||||
memset((void*)proc->RU_mask,0,10*sizeof(proc->RU_mask[0]));
|
||||
proc->RU_mask_prach =0;
|
||||
pthread_mutex_init( &eNB->UL_INFO_mutex, NULL);
|
||||
|
||||
@@ -122,6 +122,7 @@ extern void phy_free_RU(RU_t *);
|
||||
|
||||
void stop_RU(int nb_ru);
|
||||
void do_ru_synch(RU_t *ru);
|
||||
int check_sync(RU_t *ru, RU_t *ru_master, int subframe);
|
||||
|
||||
void reset_proc(RU_t *ru);
|
||||
int connect_rau(RU_t *ru);
|
||||
@@ -201,24 +202,39 @@ void fh_if5_south_in(RU_t *ru,int *frame, int *subframe) {
|
||||
void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
int f,sf;
|
||||
int f,sf,Ns,l,u;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
uint16_t packet_type;
|
||||
uint32_t symbol_number=0;
|
||||
uint32_t symbol_mask_full;
|
||||
int pultick_received=0;
|
||||
|
||||
if (ru->is_slave==1 && ru->wait_cnt!=0) RC.collect = 0;
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,*subframe)==SF_S))
|
||||
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
|
||||
else
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,*subframe)==SF_S)) {
|
||||
if (*subframe == 1) {
|
||||
symbol_mask_full = (1<<11)-1;
|
||||
} else {
|
||||
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
|
||||
}
|
||||
} else {
|
||||
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
|
||||
}
|
||||
|
||||
LOG_D(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d, ru %d, mask %x\n",ru->idx,*frame,*subframe,ru->idx,proc->symbol_mask[*subframe]);
|
||||
if (proc->symbol_mask[*subframe] == symbol_mask_full) proc->symbol_mask[*subframe] = 0;
|
||||
AssertFatal(proc->symbol_mask[*subframe]==0 || proc->symbol_mask[*subframe]==symbol_mask_full,"rx_fh_if4p5: proc->symbol_mask[%d] = %x\n",*subframe,proc->symbol_mask[*subframe]);
|
||||
|
||||
if (proc->symbol_mask[*subframe]==0) { // this is normal case, if not true then we received a PULTICK before the previous subframe was finished
|
||||
do {
|
||||
recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number);
|
||||
LOG_D(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d, f %d, sf %d\n",ru->idx,*frame,*subframe,f,sf);
|
||||
if (oai_exit == 1 || ru->cmd== STOP_RU) break;
|
||||
if (packet_type == IF4p5_PULFFT) proc->symbol_mask[sf] = proc->symbol_mask[sf] | (1<<symbol_number);
|
||||
else if (packet_type == IF4p5_PULCALIB) {
|
||||
proc->symbol_mask[sf] = (2<<symbol_number)-1;
|
||||
LOG_D(PHY,"symbol_mask[%d] %d\n",sf,proc->symbol_mask[sf]);
|
||||
}
|
||||
else if (packet_type == IF4p5_PULTICK) {
|
||||
proc->symbol_mask[sf] = symbol_mask_full;
|
||||
pultick_received++;
|
||||
@@ -230,8 +246,8 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
|
||||
} else if (packet_type == IF4p5_PRACH) {
|
||||
// nothing in RU for RAU
|
||||
}
|
||||
LOG_D(PHY,"rx_fh_if4p5: subframe %d symbol mask %x\n",*subframe,proc->symbol_mask[*subframe]);
|
||||
} while(proc->symbol_mask[*subframe] != symbol_mask_full);
|
||||
LOG_D(PHY,"rx_fh_if4p5 for RU %d: subframe %d, sf %d, symbol mask %x\n",ru->idx,*subframe,sf,proc->symbol_mask[sf]);
|
||||
} while(proc->symbol_mask[sf] != symbol_mask_full);
|
||||
}
|
||||
else {
|
||||
f = *frame;
|
||||
@@ -277,6 +293,96 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN_RU+ru->idx,f);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU+ru->idx,sf);
|
||||
|
||||
if (ru->is_slave==1 && ru->wait_cnt==0) RC.collect = 1;
|
||||
|
||||
if (ru->wait_cnt==0 && packet_type == IF4p5_PULCALIB && RC.collect==1) {
|
||||
|
||||
T(T_RAU_INPUT_SIGNAL, T_INT(ru->idx), T_INT(f), T_INT(sf),
|
||||
T_BUFFER(&ru->common.rxdataF[0][0],
|
||||
fp->symbols_per_tti*fp->ofdm_symbol_size*sizeof(int32_t)));
|
||||
|
||||
// Estimate calibration channel estimates:
|
||||
Ns = (ru->is_slave==0 ? 1 : 1);
|
||||
l = (ru->is_slave==0 ? 10 : 10);
|
||||
u = (ru->is_slave==0 ? 0 : 0);
|
||||
ru->frame_parms.nb_antennas_rx = ru->nb_rx;
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
calibration->rxdataF_ext,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
Ns,
|
||||
fp);
|
||||
|
||||
// OR should I call just: lte_ul_channel_estimation();
|
||||
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
|
||||
proc,
|
||||
ru->idx,
|
||||
3%(fp->symbols_per_tti/2),
|
||||
Ns);
|
||||
*/
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
calibration->rxdataF_ext,
|
||||
fp->N_RB_DL,
|
||||
f,
|
||||
sf,
|
||||
u,
|
||||
0,
|
||||
0,
|
||||
l,
|
||||
0,
|
||||
0);
|
||||
|
||||
T(T_CALIBRATION_CHANNEL_ESTIMATES, T_INT(ru->idx), T_INT(f), T_INT(sf),
|
||||
T_INT(l),T_BUFFER(&calibration->drs_ch_estimates[0][l*12*fp->N_RB_UL],
|
||||
12*fp->N_RB_UL*sizeof(int32_t)));
|
||||
|
||||
T(T_RAU_INPUT_DMRS, T_INT(ru->idx), T_INT(f), T_INT(sf),
|
||||
T_BUFFER(&calibration->rxdataF_ext[0][l*12*fp->N_RB_UL],
|
||||
12*fp->N_RB_UL*sizeof(int32_t)));
|
||||
|
||||
T(T_CALIBRATION_CHANNEL_ESTIMATES_TIME, T_INT(ru->idx), T_INT(f), T_INT(sf),
|
||||
T_BUFFER(calibration->drs_ch_estimates_time[0],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t)));
|
||||
|
||||
}
|
||||
|
||||
/* if (ru->wait_cnt==0 && packet_type == IF4p5_PULCALIB && RC.collect==1 && ru->is_slave==1) {
|
||||
Ns = 0;
|
||||
l = 3;
|
||||
u = 0;
|
||||
ru->frame_parms.nb_antennas_rx = ru->nb_rx;
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
calibration->rxdataF_ext,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
Ns,
|
||||
fp);
|
||||
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
calibration->rxdataF_ext,
|
||||
fp->N_RB_DL,
|
||||
f,
|
||||
sf,
|
||||
u,
|
||||
0,
|
||||
0,
|
||||
l,
|
||||
0,
|
||||
0);
|
||||
|
||||
T(T_CALIBRATION_CHANNEL_ESTIMATES, T_INT(ru->idx), T_INT(f), T_INT(sf),
|
||||
T_INT(l),T_BUFFER(&calibration->drs_ch_estimates[0][l*12*fp->N_RB_UL],
|
||||
12*fp->N_RB_UL*sizeof(int32_t)));
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
proc->symbol_mask[sf] = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
||||
LOG_D(PHY,"RU %d: fh_if4p5_south_in returning ...\n",ru->idx);
|
||||
@@ -437,10 +543,13 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
|
||||
proc->first_tx = 0;
|
||||
symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1;
|
||||
} else {
|
||||
AssertFatal(frame_tx == *frame,
|
||||
/* AssertFatal(frame_tx == *frame,
|
||||
"frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
||||
AssertFatal(subframe_tx == *subframe,
|
||||
"In frame_tx %d : subframe_tx %d is not what we expect %d\n",frame_tx,subframe_tx,*subframe);
|
||||
*/
|
||||
*frame = frame_tx;
|
||||
*subframe = subframe_tx;
|
||||
}
|
||||
|
||||
if (packet_type == IF4p5_PDLFFT) {
|
||||
@@ -496,7 +605,17 @@ void fh_if4p5_north_out(RU_t *ru) {
|
||||
LOG_D(PHY,"fh_if4p5_north_out: Sending IF4p5_PULFFT SFN.SF %d.%d\n",proc->frame_rx,proc->subframe_rx);
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) {
|
||||
/// **** in TDD during DL send_IF4 of ULTICK to RCC **** ///
|
||||
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK);
|
||||
if (subframe_select(fp,subframe)==SF_S && subframe==1 /*&& ru->state==RU_RUN*/) {
|
||||
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULCALIB);
|
||||
LOG_D(PHY,"~~~~~~******* Sending PULCALIB frame %d, subframe %d\n",proc->frame_rx,proc->subframe_rx);
|
||||
T(T_RAU_INPUT_DMRS, T_INT(ru->idx), T_INT(proc->frame_rx), T_INT(proc->subframe_rx),
|
||||
T_BUFFER(&ru->common.rxdataF[0][proc->subframe_rx*fp->symbols_per_tti*fp->ofdm_symbol_size],
|
||||
fp->symbols_per_tti*fp->ofdm_symbol_size*sizeof(int32_t)));
|
||||
} else {
|
||||
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK);
|
||||
LOG_D(PHY,"~~~~~~******* Sending PULTICK frame %d, subframe %d\n",proc->frame_rx,proc->subframe_rx);
|
||||
}
|
||||
LOG_D(PHY,"fh_if4p5_north_out: Sending IF4p5_PULCALIB SFN.SF %d.%d\n",proc->frame_rx,proc->subframe_rx);
|
||||
ru->north_out_cnt++;
|
||||
return;
|
||||
}
|
||||
@@ -688,8 +807,8 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
|
||||
void tx_rf(RU_t *ru) {
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
void *txp[ru->nb_tx];
|
||||
unsigned int txs;
|
||||
void *txp[ru->nb_tx],*txp1[ru->nb_tx];
|
||||
unsigned int txs,txs1;
|
||||
int i;
|
||||
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx),
|
||||
T_INT(0), T_BUFFER(&ru->common.txdata[0][proc->subframe_tx * fp->samples_per_tti], fp->samples_per_tti * 4));
|
||||
@@ -700,30 +819,37 @@ void tx_rf(RU_t *ru) {
|
||||
|
||||
if ((SF_type == SF_DL) ||
|
||||
(SF_type == SF_S)) {
|
||||
int siglen=fp->samples_per_tti,flags=1;
|
||||
|
||||
if (SF_type == SF_S) {
|
||||
int txsymb = fp->dl_symbols_in_S_subframe+(ru->is_slave==0 ? 1 : 0);
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
/* end_of_burst_delay is used to stop TX only "after a while".
|
||||
* If we stop right after effective signal, with USRP B210 and
|
||||
* B200mini, we observe a high EVM on the S subframe (on the
|
||||
* PSS).
|
||||
* A value of 400 (for 30.72MHz) solves this issue. This is
|
||||
* the default.
|
||||
*/
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0)
|
||||
+ (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples)
|
||||
+ ru->end_of_burst_delay;
|
||||
flags=3; // end of burst
|
||||
}
|
||||
int siglen=fp->samples_per_tti,flags=1;
|
||||
int siglen2=fp->samples_per_tti+fp->nb_prefix_samples;
|
||||
int sigoff2=2*fp->nb_prefix_samples0+8*fp->nb_prefix_samples+10*fp->ofdm_symbol_size;
|
||||
|
||||
if (fp->frame_type == TDD &&
|
||||
SF_type == SF_DL &&
|
||||
prevSF_type == SF_UL) {
|
||||
flags = 2; // start of burst
|
||||
sf_extension = ru->sf_extension;
|
||||
}
|
||||
if (SF_type == SF_S) {
|
||||
int txsymb = fp->dl_symbols_in_S_subframe+(ru->is_slave==0 ? 1 : -1);
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
|
||||
/* end_of_burst_delay is used to stop TX only "after a while".
|
||||
* If we stop right after effective signal, with USRP B210 and
|
||||
* B200mini, we observe a high EVM on the S subframe (on the
|
||||
* PSS).
|
||||
* A value of 400 (for 30.72MHz) solves this issue. This is
|
||||
* the default.
|
||||
*/
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0)
|
||||
+ (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples)
|
||||
+ ru->end_of_burst_delay;
|
||||
if (ru->state==RU_RUN && proc->frame_tx%ru->p==ru->tag) {
|
||||
siglen2 = fp->ofdm_symbol_size + fp->nb_prefix_samples + ru->end_of_burst_delay; // length of symbol 10
|
||||
}
|
||||
flags=3; // end of burst
|
||||
}
|
||||
|
||||
if (fp->frame_type == TDD &&
|
||||
SF_type == SF_DL &&
|
||||
prevSF_type == SF_UL) {
|
||||
flags = 2; // start of burst
|
||||
sf_extension = ru->sf_extension;
|
||||
}
|
||||
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifdef __AVX2__
|
||||
@@ -735,8 +861,10 @@ void tx_rf(RU_t *ru) {
|
||||
sf_extension = (sf_extension)&0xfffffffc;
|
||||
#endif
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++)
|
||||
txp[i] = (void *)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_tti)-sf_extension];
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
txp[i] = (void *)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_tti)-sf_extension];
|
||||
txp1[i] = (void*)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_tti)+(sigoff2)-sf_extension]; // pointer to 1st sample of 10th symbol
|
||||
}
|
||||
|
||||
/* add fail safe for late command */
|
||||
if(late_control!=STATE_BURST_NORMAL) { //stop burst
|
||||
@@ -781,6 +909,20 @@ void tx_rf(RU_t *ru) {
|
||||
siglen+sf_extension,
|
||||
ru->nb_tx,
|
||||
flags);
|
||||
if (ru->state==RU_RUN && proc->frame_tx%ru->p==ru->tag && proc->subframe_tx==1) {
|
||||
txs1 = ru->rfdevice.trx_write_func(&ru->rfdevice,
|
||||
proc->timestamp_tx+(ru->ts_offset+sigoff2)-ru->openair0_cfg.tx_sample_advance-sf_extension,
|
||||
txp1,
|
||||
siglen2+sf_extension,
|
||||
ru->nb_tx,
|
||||
flags);
|
||||
//LOG_M("txdata.m","txdata",&ru->common.txdata[0][0], fp->samples_per_tti*10,1,1); // save 1 frame
|
||||
//exit(-1);
|
||||
int se1 = dB_fixed(signal_energy(txp1[0],siglen2+sf_extension));
|
||||
LOG_D(PHY,"******** frame %d subframe %d RRU sends DMRS of energy10 %d, energy3 %d\n",proc->frame_tx,proc->subframe_tx,se1,dB_fixed(signal_energy(txp[0],siglen+sf_extension)));
|
||||
LOG_D(PHY,"txs1 %d, siglen2 %d, sf_extension %d\n",txs1,siglen2,sf_extension);
|
||||
}
|
||||
|
||||
ru->south_out_cnt++;
|
||||
LOG_D(PHY,"south_out_cnt %d\n",ru->south_out_cnt);
|
||||
int se = dB_fixed(signal_energy(txp[0],siglen+sf_extension));
|
||||
@@ -789,7 +931,13 @@ void tx_rf(RU_t *ru) {
|
||||
(long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
|
||||
// AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %d/%d)\n",txs, siglen);
|
||||
if (ru->state==RU_RUN && proc->frame_tx%ru->p==ru->tag && proc->subframe_tx==1) {
|
||||
if( (txs1!=siglen2+sf_extension) && (late_control==STATE_BURST_NORMAL) ){ /* add fail safe for late command */
|
||||
late_control=STATE_BURST_TERMINATE;
|
||||
LOG_E(PHY,"TX : Timeout (sent %d/%d) state =%d\n",txs1, siglen2,late_control);
|
||||
}
|
||||
}
|
||||
|
||||
if( (txs != siglen+sf_extension) && (late_control==STATE_BURST_NORMAL) ) { /* add fail safe for late command */
|
||||
late_control=STATE_BURST_TERMINATE;
|
||||
LOG_E(PHY,"TX : Timeout (sent %d/%d) state =%d\n",txs, siglen,late_control);
|
||||
@@ -1095,9 +1243,6 @@ void wakeup_L1s(RU_t *ru) {
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list;
|
||||
LOG_D(PHY,"wakeup_L1s (num %d) for RU %d (%d.%d)\n",ru->num_eNB,ru->idx, ru->proc.frame_rx,ru->proc.subframe_rx);
|
||||
|
||||
PHY_VARS_eNB *eNB=eNB_list[0];
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
struct timespec t;
|
||||
LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
|
||||
|
||||
// call eNB function directly
|
||||
@@ -1107,95 +1252,26 @@ void wakeup_L1s(RU_t *ru) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.frame_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.subframe_rx);
|
||||
|
||||
AssertFatal(0==pthread_mutex_lock(&proc->mutex_RU),"");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU+ru->idx, 1 );
|
||||
|
||||
//printf("wakeup_L1s: Frame %d, Subframe %d: RU %d done (wait_cnt %d),RU_mask[%d] %x\n",
|
||||
// ru->proc.frame_rx,ru->proc.subframe_rx,ru->idx,ru->wait_cnt,ru->proc.subframe_rx,proc->RU_mask[ru->proc.subframe_rx]);
|
||||
// VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.frame_rx);
|
||||
// VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.subframe_rx);
|
||||
clock_gettime(CLOCK_MONOTONIC,&ru->proc.t[ru->proc.subframe_rx]);
|
||||
|
||||
if (proc->RU_mask[ru->proc.subframe_rx] == 0){
|
||||
//clock_gettime(CLOCK_MONOTONIC,&proc->t[ru->proc.subframe_rx]);
|
||||
proc->t[ru->proc.subframe_rx] = ru->proc.t[ru->proc.subframe_rx];
|
||||
//start_meas(&proc->ru_arrival_time);
|
||||
LOG_D(PHY,"RU %d starting timer for frame %d subframe %d\n",ru->idx, ru->proc.frame_rx,ru->proc.subframe_rx);
|
||||
}
|
||||
|
||||
for (i=0;i<eNB->num_RU;i++) {
|
||||
if (eNB->RU_list[i]->wait_cnt==1 && ru->proc.subframe_rx!=9) eNB->RU_list[i]->wait_cnt=0;
|
||||
LOG_D(PHY,"RU %d has frame %d and subframe %d, state %s\n",eNB->RU_list[i]->idx,eNB->RU_list[i]->proc.frame_rx, eNB->RU_list[i]->proc.subframe_rx, ru_states[eNB->RU_list[i]->state]);
|
||||
if (ru == eNB->RU_list[i] && eNB->RU_list[i]->wait_cnt == 0) {
|
||||
// AssertFatal((proc->RU_mask&(1<<i)) == 0, "eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n",eNB->Mod_id,ru->proc.frame_rx,ru->proc.subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask);
|
||||
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
|
||||
}else if (/*eNB->RU_list[i]->state == RU_SYNC || */
|
||||
(eNB->RU_list[i]->is_slave==1 && eNB->RU_list[i]->wait_cnt>0 && ru!=eNB->RU_list[i] && ru->is_slave==0)){
|
||||
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
|
||||
}
|
||||
//printf("RU %d, RU_mask[%d] %d, i %d, frame %d, slave %d, ru->cnt %d, i->cnt %d\n",ru->idx,ru->proc.subframe_rx,proc->RU_mask[ru->proc.subframe_rx],i,ru->proc.frame_rx,ru->is_slave,ru->wait_cnt,eNB->RU_list[i]->wait_cnt);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_MASK_RU, proc->RU_mask[ru->proc.subframe_rx]);
|
||||
if (ru->is_slave == 0 && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<i)) == 1) && eNB->RU_list[i]->state == RU_RUN) { // This is master & the RRU has already been received
|
||||
if (check_sync(eNB->RU_list[i],eNB->RU_list[0],ru->proc.subframe_rx) == 0)
|
||||
LOG_E(PHY,"RU %d is not SYNC, subframe %d, time %f this is master\n", eNB->RU_list[i]->idx, ru->proc.subframe_rx, fabs(eNB->RU_list[i]->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec));
|
||||
}else if (ru->is_slave == 1 && ru->state == RU_RUN && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<0)) == 1)){ // master already received. TODO: we assume that RU0 is master.
|
||||
if (check_sync(ru,eNB->RU_list[0],ru->proc.subframe_rx) == 0)
|
||||
LOG_E(PHY,"RU %d is not SYNC time, subframe %d, time %f\n", ru->idx, ru->proc.subframe_rx, fabs(ru->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec));
|
||||
}
|
||||
}
|
||||
//clock_gettime(CLOCK_MONOTONIC,&t);
|
||||
//LOG_I(PHY,"RU mask is now %x, time is %lu\n",proc->RU_mask[ru->proc.subframe_rx], t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec);
|
||||
|
||||
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) { // all RUs have provided their information so continue on and wakeup eNB top
|
||||
LOG_D(PHY,"ru_mask is %d \n ", proc->RU_mask[ru->proc.subframe_rx]);
|
||||
LOG_D(PHY,"the number of RU is %d, the current ru is RU %d \n ", (1<<eNB->num_RU)-1, ru->idx);
|
||||
LOG_D(PHY,"ru->proc.subframe_rx is %d \n", ru->proc.subframe_rx);
|
||||
LOG_D(PHY,"Reseting mask frame %d, subframe %d, this is RU %d\n",ru->proc.frame_rx, ru->proc.subframe_rx, ru->idx);
|
||||
proc->RU_mask[ru->proc.subframe_rx] = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_MASK_RU, proc->RU_mask[ru->proc.subframe_rx]);
|
||||
clock_gettime(CLOCK_MONOTONIC,&t);
|
||||
//stop_meas(&proc->ru_arrival_time);
|
||||
/* AssertFatal(t.tv_nsec < proc->t[ru->proc.subframe_rx].tv_nsec+5000000,
|
||||
"Time difference for subframe %d (Frame %d) => %lu > 5ms, this is RU %d\n",
|
||||
ru->proc.subframe_rx, ru->proc.frame_rx, t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec, ru->idx);
|
||||
*/
|
||||
// VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.frame_rx);
|
||||
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.subframe_rx);
|
||||
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU+ru->idx, 0 );
|
||||
|
||||
// unlock RUs that are waiting for eNB processing to be completed
|
||||
LOG_D(PHY,"RU %d wakeup eNB top for subframe %d\n", ru->idx,ru->proc.subframe_rx);
|
||||
if (ru->wait_cnt == 0) {
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD)
|
||||
ru->eNB_top(eNB_list[0],proc->frame_rx,proc->subframe_rx,string,ru);
|
||||
else {
|
||||
for (i=0;i<ru->num_eNB;i++) {
|
||||
eNB_list[i]->proc.ru_proc = &ru->proc;
|
||||
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
|
||||
{
|
||||
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
|
||||
}
|
||||
}
|
||||
// unlock RUs that are waiting for eNB processing to be completed
|
||||
LOG_D(PHY,"RU %d wakeup eNB top for subframe %d\n", ru->idx,ru->proc.subframe_rx);
|
||||
if (ru->wait_cnt == 0) {
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD)
|
||||
ru->eNB_top(eNB_list[0],eNB_list[0]->proc.frame_rx,eNB_list[0]->proc.subframe_rx,string,ru);
|
||||
else {
|
||||
for (i=0;i<ru->num_eNB;i++) {
|
||||
eNB_list[i]->proc.ru_proc = &ru->proc;
|
||||
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
|
||||
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
|
||||
}
|
||||
}
|
||||
/*
|
||||
AssertFatal(0==pthread_mutex_lock(&ruproc->mutex_eNBs),"");
|
||||
LOG_D(PHY,"RU %d sending signal to unlock waiting ru_threads\n", ru->idx);
|
||||
AssertFatal(0==pthread_cond_broadcast(&ruproc->cond_eNBs),"");
|
||||
if (ruproc->instance_cnt_eNBs==-1) ruproc->instance_cnt_eNBs++;
|
||||
AssertFatal(0==pthread_mutex_unlock(&ruproc->mutex_eNBs),"");
|
||||
*/
|
||||
}
|
||||
else{ // not all RUs have provided their information
|
||||
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
|
||||
}
|
||||
else{ // RU is not ready
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU+ru->idx, 0 );
|
||||
}
|
||||
// pthread_mutex_unlock(&proc->mutex_RU);
|
||||
// LOG_D(PHY,"wakeup eNB top for for subframe %d\n", ru->proc.subframe_rx);
|
||||
// ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
|
||||
|
||||
ru->proc.emulate_rf_busy = 0;
|
||||
ru->proc.emulate_rf_busy = 0;
|
||||
|
||||
}
|
||||
inline int wakeup_prach_ru(RU_t *ru) {
|
||||
@@ -1508,7 +1584,7 @@ void *ru_thread_tx( void *param ) {
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&eNB_proc->mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
|
||||
for (int j=0; j<eNB->num_RU; j++) {
|
||||
if (ru == eNB->RU_list[j]) {
|
||||
if (ru == eNB->RU_list[j] && eNB->RU_list[j]->wait_cnt == 0) {
|
||||
if ((eNB_proc->RU_mask_tx&(1<<j)) > 0)
|
||||
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU tx %d (num_RU %d,mask %x) has not been served yet!\n",
|
||||
eNB->Mod_id,eNB_proc->frame_rx,eNB_proc->subframe_rx,ru->idx,eNB->num_RU,eNB_proc->RU_mask_tx);
|
||||
@@ -1661,7 +1737,7 @@ void *ru_thread( void *param ) {
|
||||
proc->instance_cnt_asynch_rxtx=0;
|
||||
pthread_cond_signal(&proc->cond_asynch_rxtx);
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_asynch_rxtx))==0,"mutex_unlock returns %d\n",ret);
|
||||
} else LOG_I(PHY,"RU %d no asynch_south interface\n",ru->idx);
|
||||
} else LOG_D(PHY,"RU %d no asynch_south interface\n",ru->idx);
|
||||
|
||||
// if this is a slave RRU, try to synchronize on the DL frequency
|
||||
if ((ru->is_slave == 1) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru);
|
||||
@@ -1866,21 +1942,22 @@ void *ru_thread_synch(void *arg) {
|
||||
// if we're not in synch, then run initial synch
|
||||
if (ru->in_synch == 0) {
|
||||
// run intial synch like UE
|
||||
LOG_I(PHY,"Running initial synchronization\n");
|
||||
LOG_D(PHY,"Running initial synchronization\n");
|
||||
ru->rx_offset = ru_sync_time(ru,
|
||||
&peak_val,
|
||||
&avg);
|
||||
LOG_I(PHY,"RU synch cnt %d: %d, val %llu (%d dB,%d dB)\n",cnt,ru->rx_offset,(unsigned long long)peak_val,dB_fixed64(peak_val),dB_fixed64(avg));
|
||||
cnt++;
|
||||
if (/*ru->rx_offset >= 0*/dB_fixed(peak_val)>=85 && cnt>10) {
|
||||
//if (/*ru->rx_offset >= 0*/dB_fixed(peak_val)>=85 && cnt>10) {
|
||||
if (ru->rx_offset >= 0 && avg>0 && dB_fixed(peak_val/avg)>=15 && cnt>10) {
|
||||
LOG_I(PHY,"Estimated peak_val %d dB, avg %d => timing offset %llu\n",dB_fixed(peak_val),dB_fixed(avg),(unsigned long long int)ru->rx_offset);
|
||||
ru->in_synch = 1;
|
||||
/*
|
||||
LOG_M("ru_sync_rx.m","rurx",&ru->common.rxdata[0][0],LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti,1,1);
|
||||
LOG_M("ru_sync_corr.m","sync_corr",ru->dmrs_corr,LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti,1,6);
|
||||
LOG_M("ru_dmrs.m","rudmrs",&ru->dmrssync[0],fp->ofdm_symbol_size,1,1);
|
||||
*/
|
||||
//exit(-1);
|
||||
exit(-1);
|
||||
*/
|
||||
} // sync_pos > 0
|
||||
else //AssertFatal(cnt<1000,"Cannot find synch reference\n");
|
||||
{
|
||||
@@ -2628,7 +2705,7 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti
|
||||
// NOTE: multiple CC_id are not handled here yet!
|
||||
ru->openair0_cfg.clock_source = clock_source;
|
||||
ru->openair0_cfg.time_source = time_source;
|
||||
// ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0;
|
||||
ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 1;
|
||||
if (ru->generate_dmrs_sync == 1) {
|
||||
generate_ul_ref_sigs();
|
||||
ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.ofdm_symbol_size*2*sizeof(int16_t));
|
||||
@@ -2919,6 +2996,8 @@ void RCconfig_RU(void) {
|
||||
RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
|
||||
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
|
||||
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
|
||||
RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
|
||||
for (i=0;i<RC.ru[j]->num_bands;i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
|
||||
} //strcmp(local_rf, "yes") == 0
|
||||
else {
|
||||
|
||||
@@ -126,7 +126,9 @@ int send_config(RU_t *ru, RRU_CONFIG_msg_t rru_config_msg){
|
||||
rru_config_msg.type = RRU_config;
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
|
||||
|
||||
LOG_I(PHY,"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d\n",ru->idx,
|
||||
LOG_I(PHY,"Sending Configuration to RRU %d (RRU p %d,RRU tag %d,num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d\n",ru->idx,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->p,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
|
||||
@@ -234,7 +236,9 @@ int attach_rru(RU_t *ru) {
|
||||
|
||||
rru_config_msg.type = RRU_config;
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
|
||||
LOG_I(PHY,"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",ru->idx,
|
||||
LOG_I(PHY,"Sending Configuration to RRU %d (RRU p %d,RRU tag %d,num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",ru->idx,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->p,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
|
||||
@@ -327,7 +331,9 @@ int connect_rau(RU_t *ru) {
|
||||
LOG_I(PHY,"Waiting for configuration from RAU\n");
|
||||
}
|
||||
else {
|
||||
LOG_I(PHY,"Configuration received from RAU (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
|
||||
LOG_I(PHY,"Configuration received from RAU (RRU p %d,RRU tag %d,num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->p,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
|
||||
@@ -425,6 +431,8 @@ void configure_ru(int idx,
|
||||
config->N_RB_DL[0] = ru->frame_parms.N_RB_DL;
|
||||
config->N_RB_UL[0] = ru->frame_parms.N_RB_UL;
|
||||
config->threequarter_fs[0] = ru->frame_parms.threequarter_fs;
|
||||
config->tag = idx;
|
||||
config->p = RC.nb_RU;
|
||||
if (ru->if_south==REMOTE_IF4p5) {
|
||||
config->prach_FreqOffset[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
|
||||
config->prach_ConfigIndex[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
@@ -451,6 +459,8 @@ void configure_rru(int idx,
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RU_t *ru = RC.ru[idx];
|
||||
|
||||
ru->tag = config->tag;
|
||||
ru->p = config->p;
|
||||
ru->frame_parms.eutra_band = config->band_list[0];
|
||||
ru->frame_parms.dl_CarrierFreq = config->tx_freq[0];
|
||||
ru->frame_parms.ul_CarrierFreq = config->rx_freq[0];
|
||||
@@ -568,7 +578,9 @@ void* ru_thread_control( void* param ) {
|
||||
|
||||
case RRU_config: // RRU
|
||||
if (ru->if_south == LOCAL_RF){
|
||||
LOG_I(PHY,"Configuration received from RAU (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
|
||||
LOG_I(PHY,"Configuration received from RAU (p %d, tag %d, num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->p,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
|
||||
|
||||
Reference in New Issue
Block a user