Commit 5067a2de authored by Raymond Knopp's avatar Raymond Knopp

initial changes for MsgQ use without threadPool for L1_rx_thread and L1_tx_thread

parent 87e7bfce
......@@ -140,6 +140,18 @@ void tx_func(void *param) {
stop_meas(&info->gNB->phy_proc_tx);
}
void *L1_rx_thread(void *arg) {
PHY_VARS_gNB *gNB = (PHY_VARS_gNB*)arg;
while (oai_exit == 0) {
notifiedFIFO_elt_t *res = pullNotifiedFIFO(&gNB->resp_L1);
processingData_L1_t *info = (processingData_L1_t *)NotifiedFifoData(res);
rx_func(info);
delNotifiedFIFO_elt(res);
}
}
void rx_func(void *param) {
processingData_L1_t *info = (processingData_L1_t *) param;
PHY_VARS_gNB *gNB = info->gNB;
......@@ -479,14 +491,19 @@ void init_gNB_Tpool(int inst) {
// L1 RX result FIFO
initNotifiedFIFO(&gNB->resp_L1);
#ifndef USE_MSGQ
notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(processingData_L1_t), 0, &gNB->resp_L1, rx_func);
pushNotifiedFIFO(&gNB->resp_L1, msg); // to unblock the process in the beginning
#endif
// L1 TX result FIFO
initNotifiedFIFO(&gNB->L1_tx_free);
initNotifiedFIFO(&gNB->L1_tx_filled);
initNotifiedFIFO(&gNB->L1_tx_out);
#ifdef USE_MSGQ
threadCreate(&gNB->L1_rx_thread, L1_rx_thread, (void *)gNB, "L1_rx_thread",
gNB->L1_rx_thread_core, OAI_PRIORITY_RT_MAX);
#endif
if (get_softmodem_params()->reorder_thread_disable) {
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t), 0, &gNB->L1_tx_out, tx_func);
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
......
......@@ -60,6 +60,8 @@ unsigned short config_frames[4] = {2,9,11,13};
#endif
#define USE_MSGQ 1
/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */
static int DEFBANDS[] = {7};
static int DEFENBS[] = {0};
......@@ -1281,9 +1283,13 @@ void *ru_thread( void *param ) {
} // end if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
// At this point, all information for subframe has been received on FH interface
#ifndef USE_MSGQ
res = pullTpool(&gNB->resp_L1, &gNB->threadPool);
if (res == NULL)
break; // Tpool has been stopped
#else
res=newNotifiedFIFO_elt(sizeof(processingData_L1_t),0, &gNB->resp_L1,NULL);
#endif
syncMsg = (processingData_L1_t *)NotifiedFifoData(res);
syncMsg->gNB = gNB;
syncMsg->frame_rx = proc->frame_rx;
......@@ -1292,7 +1298,11 @@ void *ru_thread( void *param ) {
syncMsg->slot_tx = proc->tti_tx;
syncMsg->timestamp_tx = proc->timestamp_tx;
res->key = proc->tti_rx;
#ifndef USE_MSGQ
pushTpool(&gNB->threadPool, res);
#else
pushNotifiedFIFO(&gNB->resp_L1, res);
#endif
}
printf( "Exiting ru_thread \n");
......
......@@ -766,6 +766,10 @@ typedef struct PHY_VARS_gNB_s {
notifiedFIFO_t L1_tx_out;
notifiedFIFO_t resp_RU_tx;
tpool_t threadPool;
pthread_t L1_rx_thread;
int L1_rx_thread_core;
pthread_t thread_L1_tx;
int L1_tx_thread_core;
int nbDecode;
int number_of_nr_dlsch_max;
int number_of_nr_ulsch_max;
......
......@@ -54,6 +54,9 @@
#define CONFIG_STRING_L1_SRS_DTX_THRESHOLD "srs_dtx_threshold"
#define CONFIG_STRING_L1_MAX_LDPC_ITERATIONS "max_ldpc_iterations"
#define CONFIG_STRING_L1_TX_AMP_BACKOFF_dB "tx_amp_backoff_dB"
#define CONFIG_STRING_L1_RX_THREAD_CORE "L1_rx_thread_core"
#define CONFIG_STRING_L1_TX_THREAD_CORE "L1_tx_thread_core"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* L1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
......@@ -76,6 +79,8 @@
{CONFIG_STRING_L1_SRS_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_MAX_LDPC_ITERATIONS, NULL, 0, uptr:NULL, defintval:5, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_TX_AMP_BACKOFF_dB, NULL, 0, uptr:NULL, defintval:36, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_RX_THREAD_CORE, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_TX_THREAD_CORE, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \
}
#define L1_CC_IDX 0
#define L1_TRANSPORT_N_PREFERENCE_IDX 1
......@@ -94,6 +99,8 @@
#define L1_SRS_DTX_THRESHOLD 14
#define L1_MAX_LDPC_ITERATIONS 15
#define L1_TX_AMP_BACKOFF_dB 15
#define L1_RX_THREAD_CORE 16
#define L1_TX_THREAD_CORE 17
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif
......@@ -762,6 +762,8 @@ void RCconfig_NR_L1(void)
RC.gNB[j]->srs_thres = *(L1_ParamList.paramarray[j][L1_SRS_DTX_THRESHOLD].uptr);
RC.gNB[j]->max_ldpc_iterations = *(L1_ParamList.paramarray[j][L1_MAX_LDPC_ITERATIONS].uptr);
RC.gNB[j]->TX_AMP = (int16_t)(32767.0/pow(10.0,.05*(double)(*L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr)));
RC.gNB[j]->L1_rx_thread_core = *(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr);
RC.gNB[j]->L1_tx_thread_core = *(L1_ParamList.paramarray[j][L1_TX_THREAD_CORE].iptr);
LOG_I(PHY,"TX_AMP = %d (-%d dBFS)\n",RC.gNB[j]->TX_AMP,*L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr);
if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
// sf_ahead = 2; // Need 4 subframe gap between RX and TX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment