Merge branch 'develop' into rfsimu_config
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include <libbladeRF.h>
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "log.h"
|
||||
#include "LOG/log.h"
|
||||
|
||||
/** @addtogroup _BLADERF_PHY_RF_INTERFACE_
|
||||
* @{
|
||||
|
||||
@@ -105,7 +105,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
|
||||
if ( IS_SOFTMODEM_BASICSIM ) {
|
||||
libname=OAI_BASICSIM_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else if ( IS_SOFTMODEM_RFSIM ) {
|
||||
} else if ( IS_SOFTMODEM_RFSIM && flag == RAU_LOCAL_RADIO_HEAD) {
|
||||
libname=OAI_RFSIM_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else if (flag == RAU_LOCAL_RADIO_HEAD) {
|
||||
|
||||
@@ -65,8 +65,8 @@ pthread_mutex_t Sockmutex;
|
||||
|
||||
typedef struct buffer_s {
|
||||
int conn_sock;
|
||||
bool alreadyRead;
|
||||
uint64_t lastReceivedTS;
|
||||
openair0_timestamp lastReceivedTS;
|
||||
openair0_timestamp lastWroteTS;
|
||||
bool headerMode;
|
||||
samplesBlockHeader_t th;
|
||||
char *transferPtr;
|
||||
@@ -78,7 +78,7 @@ typedef struct buffer_s {
|
||||
|
||||
typedef struct {
|
||||
int listen_sock, epollfd;
|
||||
uint64_t nextTimestamp;
|
||||
openair0_timestamp nextTimestamp;
|
||||
uint64_t typeStamp;
|
||||
char *ip;
|
||||
uint16_t port;
|
||||
@@ -123,9 +123,9 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
|
||||
// Fixme: how to convert a noise in Watt into a 12 bits value out of the RF ADC ?
|
||||
// the parameter "-s" is declared as SNR, but the input power is not well defined
|
||||
// −132.24 dBm is a LTE subcarrier noise, that was used in origin code (15KHz BW thermal noise)
|
||||
const double rxGain= 132.24 - snr_dB;
|
||||
const double rxGain= 132.24 - snr_dB;
|
||||
// sqrt(4*noise_figure_watt) is the thermal noise factor (volts)
|
||||
// fixme: the last constant is pure trial results to make decent noise
|
||||
// fixme: the last constant is pure trial results to make decent noise
|
||||
const double noise_per_sample = sqrt(4*noise_figure_watt) * pow(10,rxGain/20) *10;
|
||||
// Fixme: we don't fill the offset length samples at begining ?
|
||||
// anyway, in today code, channel_offset=0
|
||||
@@ -154,9 +154,6 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
|
||||
}
|
||||
|
||||
out_ptr->r += round(rx_tmp.x*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0));
|
||||
printf("in: %d, out %d= %f*%f + %f*%f\n",
|
||||
input_sig[((TS+i)*nbTx)%CirSize].r, out_ptr->r , rx_tmp.x,
|
||||
pathLossLinear, noise_per_sample,gaussdouble(0.0,1.0));
|
||||
out_ptr->i += round(rx_tmp.y*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0));
|
||||
out_ptr++;
|
||||
}
|
||||
@@ -175,8 +172,8 @@ void allocCirBuf(rfsimulator_state_t *bridge, int sock) {
|
||||
AssertFatal ( (ptr->circularBuf=(sample_t *) malloc(sampleToByte(CirSize,1))) != NULL, "");
|
||||
ptr->circularBufEnd=((char *)ptr->circularBuf)+sampleToByte(CirSize,1);
|
||||
ptr->conn_sock=sock;
|
||||
ptr->alreadyRead=false;
|
||||
ptr->lastReceivedTS=0;
|
||||
ptr->lastWroteTS=0;
|
||||
ptr->headerMode=true;
|
||||
ptr->transferPtr=(char *)&ptr->th;
|
||||
ptr->remainToTransfer=sizeof(samplesBlockHeader_t);
|
||||
@@ -379,21 +376,22 @@ sin_addr:
|
||||
|
||||
setblocking(sock, notBlocking);
|
||||
allocCirBuf(t, sock);
|
||||
t->buf[sock].alreadyRead=true; // UE will start blocking on read
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t lastW=-1;
|
||||
int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, void **samplesVoid, int nsamps, int nbAnt, int flags) {
|
||||
rfsimulator_state_t *t = device->priv;
|
||||
LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp);
|
||||
|
||||
for (int i=0; i<FD_SETSIZE; i++) {
|
||||
buffer_t *ptr=&t->buf[i];
|
||||
|
||||
if (ptr->conn_sock >= 0 ) {
|
||||
for (int i=0; i<FD_SETSIZE; i++) {
|
||||
buffer_t *b=&t->buf[i];
|
||||
|
||||
if (b->conn_sock >= 0 ) {
|
||||
if ( abs((double)b->lastWroteTS-timestamp) > (double)CirSize)
|
||||
LOG_E(HW,"Tx/Rx shift too large Tx:%lu, Rx:%lu\n", b->lastWroteTS, b->lastReceivedTS);
|
||||
samplesBlockHeader_t header= {t->typeStamp, nsamps, nbAnt, timestamp};
|
||||
fullwrite(ptr->conn_sock,&header, sizeof(header), t);
|
||||
fullwrite(b->conn_sock,&header, sizeof(header), t);
|
||||
sample_t tmpSamples[nsamps][nbAnt];
|
||||
|
||||
for(int a=0; a<nbAnt; a++) {
|
||||
@@ -403,17 +401,17 @@ int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, voi
|
||||
tmpSamples[s][a]=in[s];
|
||||
}
|
||||
|
||||
if (ptr->conn_sock >= 0 )
|
||||
fullwrite(ptr->conn_sock, (void *)tmpSamples, sampleToByte(nsamps,nbAnt), t);
|
||||
if (b->conn_sock >= 0 ) {
|
||||
fullwrite(b->conn_sock, (void *)tmpSamples, sampleToByte(nsamps,nbAnt), t);
|
||||
b->lastWroteTS=timestamp+nsamps;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastW=timestamp;
|
||||
LOG_D(HW,"sent %d samples at time: %ld->%ld, energy in first antenna: %d\n",
|
||||
nsamps, timestamp, timestamp+nsamps, signal_energy(samplesVoid[0], nsamps) );
|
||||
// Let's verify we don't have incoming data
|
||||
// This is mandatory when the opposite side don't transmit
|
||||
// This is mandatory when the opposite side don't transmit
|
||||
flushInput(t, 0);
|
||||
pthread_mutex_unlock(&Sockmutex);
|
||||
return nsamps;
|
||||
@@ -485,7 +483,6 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
|
||||
AssertFatal( (t->typeStamp == UE_MAGICDL_FDD && b->th.magic==ENB_MAGICDL_FDD) ||
|
||||
(t->typeStamp == ENB_MAGICDL_FDD && b->th.magic==UE_MAGICDL_FDD), "Socket Error in protocol");
|
||||
b->headerMode=false;
|
||||
b->alreadyRead=true;
|
||||
|
||||
if ( b->lastReceivedTS != b->th.timestamp) {
|
||||
int nbAnt= b->th.nbAnt;
|
||||
@@ -501,8 +498,8 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
|
||||
}
|
||||
|
||||
b->lastReceivedTS=b->th.timestamp;
|
||||
AssertFatal(lastW == -1 || ( abs((double)lastW-b->lastReceivedTS) < (double)CirSize),
|
||||
"Tx/Rx shift too large Tx:%lu, Rx:%lu\n", lastW, b->lastReceivedTS);
|
||||
AssertFatal(b->lastWroteTS == 0 || ( abs((double)b->lastWroteTS-b->lastReceivedTS) < (double)CirSize),
|
||||
"Tx/Rx shift too large Tx:%lu, Rx:%lu\n", b->lastWroteTS, b->lastReceivedTS);
|
||||
b->transferPtr=(char *)&b->circularBuf[b->lastReceivedTS%CirSize];
|
||||
b->remainToTransfer=sampleToByte(b->th.size, b->th.nbAnt);
|
||||
}
|
||||
@@ -561,15 +558,33 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
|
||||
return nsamps;
|
||||
}
|
||||
} else {
|
||||
|
||||
bool have_to_wait;
|
||||
|
||||
do {
|
||||
have_to_wait=false;
|
||||
|
||||
for ( int sock=0; sock<FD_SETSIZE; sock++) {
|
||||
if ( t->buf[sock].circularBuf && t->buf[sock].alreadyRead )
|
||||
if ( t->buf[sock].lastReceivedTS == 0 ||
|
||||
(t->nextTimestamp+nsamps) > t->buf[sock].lastReceivedTS ) {
|
||||
buffer_t *b=&t->buf[sock];
|
||||
if ( b->circularBuf) {
|
||||
LOG_D(HW,"sock: %d, lastWroteTS: %lu, lastRecvTS: %lu, TS must be avail: %lu\n",
|
||||
sock, b->lastWroteTS,
|
||||
b->lastReceivedTS,
|
||||
t->nextTimestamp+nsamps);
|
||||
if ( b->lastReceivedTS > b->lastWroteTS ) {
|
||||
// The caller momdem (NB, UE, ...) must send Tx in advance, so we fill TX if Rx is in advance
|
||||
// This occurs for example when UE is in sync mode: it doesn't transmit
|
||||
// with USRP, it seems ok: if "tx stream" is off, we may consider it actually cuts the Tx power
|
||||
struct complex16 v={0};
|
||||
void *samplesVoid[b->th.nbAnt];
|
||||
for ( int i=0; i <b->th.nbAnt; i++)
|
||||
samplesVoid[i]=(void*)&v;
|
||||
rfsimulator_write(device, b->lastReceivedTS, samplesVoid, 1, b->th.nbAnt, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if ( b->circularBuf )
|
||||
if ( t->nextTimestamp+nsamps > b->lastReceivedTS ) {
|
||||
have_to_wait=true;
|
||||
break;
|
||||
}
|
||||
@@ -592,7 +607,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
|
||||
for (int sock=0; sock<FD_SETSIZE; sock++) {
|
||||
buffer_t *ptr=&t->buf[sock];
|
||||
|
||||
if ( ptr->circularBuf && ptr->alreadyRead ) {
|
||||
if ( ptr->circularBuf ) {
|
||||
bool reGenerateChannel=false;
|
||||
|
||||
//fixme: when do we regenerate
|
||||
|
||||
@@ -12,13 +12,16 @@
|
||||
// This problem will be fixed in the future.
|
||||
# ifndef UESIM_EXPANSION
|
||||
# define NUMBER_OF_UE_MAX 16
|
||||
# define NUMBER_OF_UCI_VARS_MAX 56
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 3
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 256
|
||||
# define NUMBER_OF_UCI_VARS_MAX 256
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# endif
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 256
|
||||
# define NUMBER_OF_UCI_VARS_MAX 256
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# endif
|
||||
#else
|
||||
@@ -32,13 +35,16 @@ and the other are using MAX_MOBILES_PER_ENB in for-loop.
|
||||
*/
|
||||
# ifndef UESIM_EXPANSION
|
||||
# define NUMBER_OF_UE_MAX 16
|
||||
# define NUMBER_OF_UCI_VARS_MAX 56
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 3
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 256
|
||||
# define NUMBER_OF_UCI_VARS_MAX 256
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# endif
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 256
|
||||
# define NUMBER_OF_UCI_VARS_MAX 256
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# endif
|
||||
# if defined(STANDALONE) && STANDALONE==1
|
||||
|
||||
+29
-25
@@ -189,14 +189,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs ||
|
||||
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs ||
|
||||
eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles ||
|
||||
eNB->UL_INFO.cqi_ind.number_of_cqis
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis
|
||||
) {
|
||||
LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d preambles:%05d:%d cqis:%d] RX:%04d%d TX:%04d%d num_pdcch_symbols:%d\n",
|
||||
NFAPI_SFNSF2DEC(eNB->UL_INFO.rx_ind.sfn_sf), eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus,
|
||||
NFAPI_SFNSF2DEC(eNB->UL_INFO.harq_ind.sfn_sf), eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,
|
||||
NFAPI_SFNSF2DEC(eNB->UL_INFO.crc_ind.sfn_sf), eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
|
||||
NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf), eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
|
||||
eNB->UL_INFO.cqi_ind.number_of_cqis,
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis,
|
||||
proc->frame_rx, proc->subframe_rx,
|
||||
proc->frame_tx, proc->subframe_tx, eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols);
|
||||
}
|
||||
@@ -218,9 +218,11 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx);
|
||||
#endif
|
||||
}
|
||||
|
||||
release_UE_in_freeList(eNB->Mod_id);
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_PNF) {
|
||||
release_UE_in_freeList(eNB->Mod_id);
|
||||
} else {
|
||||
release_rnti_of_phy(eNB->Mod_id);
|
||||
}
|
||||
// UE-specific RX processing for subframe n
|
||||
if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) {
|
||||
phy_procedures_eNB_uespec_RX(eNB, proc);
|
||||
@@ -429,13 +431,12 @@ static void *L1_thread( void *param ) {
|
||||
}
|
||||
|
||||
LOG_D(PHY,"L1 RX %d.%d done\n",proc->frame_rx,proc->subframe_rx);
|
||||
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx,proc->timestamp_tx);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(eNB,proc,proc->frame_tx,proc->subframe_tx,proc->timestamp_tx);
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx,proc->timestamp_tx);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) {
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
wakeup_txfh(eNB,proc,proc->frame_tx,proc->subframe_tx,proc->timestamp_tx);
|
||||
}
|
||||
}
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
@@ -635,15 +636,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
|
||||
@@ -929,7 +927,9 @@ void init_eNB_proc(int inst) {
|
||||
|
||||
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
|
||||
|
||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
pthread_create( &L1_proc->pthread, attr0, L1_thread, proc );
|
||||
} else if ((get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
pthread_create( &L1_proc->pthread, attr0, L1_thread, proc );
|
||||
pthread_create( &L1_proc_tx->pthread, attr1, L1_thread_tx, proc);
|
||||
} else if (NFAPI_MODE==NFAPI_MODE_VNF) { // this is neccesary in VNF or L2 FAPI simulator.
|
||||
@@ -940,10 +940,12 @@ void init_eNB_proc(int inst) {
|
||||
pthread_create( &L1_proc_tx->pthread, attr1, L1_thread, L1_proc_tx);
|
||||
}
|
||||
|
||||
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
#endif
|
||||
}
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
@@ -1104,6 +1106,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
LOG_I(PHY, "Initialise transport\n");
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||
|
||||
@@ -1146,6 +1149,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
LOG_D(PHY,"eNB %d.%d : RA %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_ra);
|
||||
eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
||||
LOG_D(PHY,"eNB %d.%d : MCH %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_MCH);
|
||||
}
|
||||
eNB->rx_total_gain_dB=130;
|
||||
|
||||
for(i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||
@@ -1283,8 +1287,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
|
||||
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
|
||||
eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
|
||||
eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list = eNB->cqi_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
||||
eNB->prach_energy_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *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_PULTICK) {
|
||||
@@ -230,8 +231,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;
|
||||
@@ -437,10 +438,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) {
|
||||
@@ -1661,7 +1665,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);
|
||||
@@ -1872,7 +1876,8 @@ void *ru_thread_synch(void *arg) {
|
||||
&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;
|
||||
/*
|
||||
@@ -2628,7 +2633,11 @@ 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 : 0;
|
||||
if ((ru->is_slave == 0) && (ru->ota_sync_enable == 1))
|
||||
ru->generate_dmrs_sync = 1;
|
||||
else
|
||||
ru->generate_dmrs_sync = 0;
|
||||
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));
|
||||
@@ -2915,10 +2924,15 @@ void RCconfig_RU(void) {
|
||||
printf("RU %d is_slave=%s\n",j,*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr));
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) RC.ru[j]->is_slave=1;
|
||||
else RC.ru[j]->is_slave=0;
|
||||
printf("RU %d ota_sync_enabled=%s\n",j,*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr));
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr), "yes") == 0) RC.ru[j]->ota_sync_enable=1;
|
||||
else RC.ru[j]->ota_sync_enable=0;
|
||||
}
|
||||
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 {
|
||||
|
||||
@@ -62,6 +62,7 @@ void get_common_options(void) {
|
||||
uint32_t nonbiot;
|
||||
uint32_t rfsim;
|
||||
uint32_t basicsim;
|
||||
char *logmem_filename = NULL;
|
||||
uint32_t do_forms;
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
|
||||
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
|
||||
@@ -83,6 +84,13 @@ void get_common_options(void) {
|
||||
load_module_shlib("telnetsrv",NULL,0,NULL);
|
||||
}
|
||||
|
||||
if (logmem_filename != NULL && strlen(logmem_filename) > 0) {
|
||||
log_mem_filename = &logmem_filename[0];
|
||||
log_mem_flag = 1;
|
||||
printf("Enabling OPT for log save at memory %s\n",log_mem_filename);
|
||||
logInit_log_mem();
|
||||
}
|
||||
|
||||
if (noS1) {
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
if (s != NULL) {
|
||||
printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
|
||||
}
|
||||
|
||||
close_log_mem();
|
||||
oai_exit = 1;
|
||||
|
||||
if (RC.ru == NULL)
|
||||
@@ -524,6 +524,7 @@ int main( int argc, char **argv ) {
|
||||
int i;
|
||||
int CC_id = 0;
|
||||
int ru_id;
|
||||
int node_type = ngran_eNB;
|
||||
|
||||
if ( load_configmodule(argc,argv,0) == NULL) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
@@ -604,12 +605,13 @@ int main( int argc, char **argv ) {
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
}
|
||||
node_type = RC.rrc[0]->node_type;
|
||||
} else {
|
||||
printf("RC.nb_inst = 0, Initializing L1\n");
|
||||
RCconfig_L1();
|
||||
}
|
||||
|
||||
if (RC.nb_inst > 0 && NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
if (RC.nb_inst > 0 && NODE_IS_CU(node_type)) {
|
||||
protocol_ctxt_t ctxt;
|
||||
ctxt.module_id = 0 ;
|
||||
ctxt.instance = 0;
|
||||
@@ -621,7 +623,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
/* start threads if only L1 or not a CU */
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(node_type) || NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
// init UE_PF_PO and mutex lock
|
||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
|
||||
@@ -720,7 +722,7 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
|
||||
// stop threads
|
||||
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(node_type)) {
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
end_forms();
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@
|
||||
{"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \
|
||||
{"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
|
||||
{"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \
|
||||
{"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
}
|
||||
#define CMDLINE_ONLINELOG_IDX 0
|
||||
#define CMDLINE_GLOGLEVEL_IDX 1
|
||||
@@ -236,6 +237,7 @@
|
||||
{ .s2= { config_check_intrange, {0,4}}}, \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
}
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
|
||||
@@ -1053,9 +1053,9 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
|
||||
UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0;
|
||||
UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = (nfapi_sr_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_sr_indication_pdu_t));
|
||||
UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0;
|
||||
UL_INFO->cqi_ind.cqi_pdu_list = (nfapi_cqi_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_cqi_indication_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_raw_pdu_list = (nfapi_cqi_indication_raw_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_cqi_indication_raw_pdu_t));
|
||||
UL_INFO->cqi_ind.number_of_cqis = 0;
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = (nfapi_cqi_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_cqi_indication_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = (nfapi_cqi_indication_raw_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_cqi_indication_raw_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0;
|
||||
|
||||
if (pthread_mutex_lock(&phy_stub_ticking->mutex_single_thread) != 0) {
|
||||
LOG_E( MAC, "[SCHED][UE] error locking mutex for ue_thread_id %d (mutex_single_thread)\n",ue_thread_id);
|
||||
@@ -1262,10 +1262,10 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
|
||||
free(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list);
|
||||
UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = NULL;
|
||||
//}
|
||||
free(UL_INFO->cqi_ind.cqi_pdu_list);
|
||||
UL_INFO->cqi_ind.cqi_pdu_list = NULL;
|
||||
free(UL_INFO->cqi_ind.cqi_raw_pdu_list);
|
||||
UL_INFO->cqi_ind.cqi_raw_pdu_list = NULL;
|
||||
free(UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list);
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = NULL;
|
||||
free(UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list);
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = NULL;
|
||||
free(UL_INFO);
|
||||
UL_INFO = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user