Commit b2d2f92c authored by Laurent THOMAS's avatar Laurent THOMAS

gNBthread flow update

parent b0caabc3
...@@ -4,7 +4,7 @@ flowchart TB ...@@ -4,7 +4,7 @@ flowchart TB
feprx --> half-slot --> end_feprx feprx --> half-slot --> end_feprx
feprx --> second-thread -- block_end_feprx --> end_feprx>feprx] feprx --> second-thread -- block_end_feprx --> end_feprx>feprx]
end_feprx --> rx_nr_prach_ru end_feprx --> rx_nr_prach_ru
rx_nr_prach_ru -- block_queue --> resp_L1>resp L1] rx_nr_prach_ru -- block_queue_singleton --> resp_L1>resp L1]
resp_L1 -- async launch --> rx_func resp_L1 -- async launch --> rx_func
resp_L1 -- immediate return --> RFin resp_L1 -- immediate return --> RFin
...@@ -29,24 +29,35 @@ rx_func_implem[rx_func] ...@@ -29,24 +29,35 @@ rx_func_implem[rx_func]
handle_nr_rach handle_nr_rach
--> handle_nr_uci --> handle_nr_uci
--> handle_nr_ulsch --> handle_nr_ulsch
--> gNB_dlsch_ulsch_scheduler subgraph gNB_dlsch_ulsch_scheduler
--> NR_Schedule_response run_pdcp
--> nr_rrc_trigger
--> schedule_xxxx
end
handle_nr_ulsch --> gNB_dlsch_ulsch_scheduler
subgraph NR_Schedule_response
L1_tx_free3>L1_tx_free]
--> handle_dl_fapi
--> sendTxFilled((L1_tx_filled))
--> handle_ul_nfapi
end
gNB_dlsch_ulsch_scheduler --> NR_Schedule_response
end end
rx_func_implem --> rxfuncbeg rx_func_implem --> rxfuncbeg
rxfuncbeg --> phy_procedures_gNB_uespec_RX rxfuncbeg --> phy_procedures_gNB_uespec_RX
phy_procedures_gNB_uespec_RX --> NR_UL_indication phy_procedures_gNB_uespec_RX --> NR_UL_indication
-- block_queue --> L1_tx_free2>L1 tx free] -- block_queue_block_PNF_monolithic --> L1_tx_free2>L1 tx filled]
-- async launch --> tx_func -- async launch --> tx_func
L1_tx_free2 -- send_msg --> rsp((resp_L1)) L1_tx_free2 -- send_msg --> rsp((resp_L1))
end end
rx_func --> rxfunc rx_func --> rxfunc
subgraph tx subgraph tx_func
direction LR direction LR
subgraph tx_func2 subgraph phy_procedures_gNB_TX
phy_procedures_gNB_TX dcitop[nr_generate dci top]
--> dcitop[nr_generate dci top]
--> nr_generate_csi_rs --> nr_generate_csi_rs
--> apply_nr_rotation --> apply_nr_rotation
-- send_msg --> end_tx_func((L1_tx_out)) -- send_msg --> end_tx_func((L1_tx_out))
...@@ -59,6 +70,6 @@ subgraph tx ...@@ -59,6 +70,6 @@ subgraph tx
ru_tx_func --> feptx_prec ru_tx_func --> feptx_prec
--> feptx_ofdm --> feptx_ofdm
end end
tx_func2 --> tx_reorder_thread
end end
``` ```
...@@ -303,8 +303,8 @@ void rx_func(void *param) { ...@@ -303,8 +303,8 @@ void rx_func(void *param) {
} }
static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) {
int stroff = 0; int stroff = 0;
stroff += print_meas_log(gNB->phy_proc_tx_0, "L1 Tx processing thread 0", NULL, NULL, output); stroff += print_meas_log(gNB->phy_proc_tx[0], "L1 Tx processing thread 0", NULL, NULL, output);
stroff += print_meas_log(gNB->phy_proc_tx_1, "L1 Tx processing thread 1", NULL, NULL, output+stroff); stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff);
stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff);
stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff);
stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff);
...@@ -339,8 +339,8 @@ void *nrL1_stats_thread(void *param) { ...@@ -339,8 +339,8 @@ void *nrL1_stats_thread(void *param) {
fd=fopen("nrL1_stats.log","w"); fd=fopen("nrL1_stats.log","w");
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
reset_meas(gNB->phy_proc_tx_0); reset_meas(gNB->phy_proc_tx[0]);
reset_meas(gNB->phy_proc_tx_1); reset_meas(gNB->phy_proc_tx[1]);
reset_meas(&gNB->dlsch_encoding_stats); reset_meas(&gNB->dlsch_encoding_stats);
reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->phy_proc_rx);
reset_meas(&gNB->ul_indication_stats); reset_meas(&gNB->ul_indication_stats);
...@@ -444,22 +444,17 @@ void init_gNB_Tpool(int inst) { ...@@ -444,22 +444,17 @@ void init_gNB_Tpool(int inst) {
initNotifiedFIFO(gNB->L1_tx_free); initNotifiedFIFO(gNB->L1_tx_free);
initNotifiedFIFO(gNB->L1_tx_filled); initNotifiedFIFO(gNB->L1_tx_filled);
initNotifiedFIFO(gNB->L1_tx_out); initNotifiedFIFO(gNB->L1_tx_out);
// we create 2 threads for L1 tx processing // we create 2 threads for L1 tx processing
for (int i=0; i < 2; i++) {
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); 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); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
init_DLSCH_struct(gNB, msgDataTx); init_DLSCH_struct(gNB, msgDataTx);
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
reset_meas(&msgDataTx->phy_proc_tx); reset_meas(&msgDataTx->phy_proc_tx);
gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; gNB->phy_proc_tx[i] = &msgDataTx->phy_proc_tx;
pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning
msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func);
msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
init_DLSCH_struct(gNB, msgDataTx);
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
reset_meas(&msgDataTx->phy_proc_tx);
gNB->phy_proc_tx_1 = &msgDataTx->phy_proc_tx;
pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning
}
threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW); threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX); threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX);
......
...@@ -346,8 +346,8 @@ typedef struct { ...@@ -346,8 +346,8 @@ typedef struct {
} fapi_nr_ul_config_request_pdu_t; } fapi_nr_ul_config_request_pdu_t;
typedef struct { typedef struct {
uint16_t sfn; //uint16_t sfn;
uint16_t slot; //uint16_t slot;
uint8_t number_pdus; uint8_t number_pdus;
fapi_nr_ul_config_request_pdu_t ul_config_list[FAPI_NR_UL_CONFIG_LIST_NUM]; fapi_nr_ul_config_request_pdu_t ul_config_list[FAPI_NR_UL_CONFIG_LIST_NUM];
pthread_mutex_t mutex_ul_config; pthread_mutex_t mutex_ul_config;
......
...@@ -860,8 +860,7 @@ typedef struct PHY_VARS_gNB_s { ...@@ -860,8 +860,7 @@ typedef struct PHY_VARS_gNB_s {
/* /*
time_stats_t phy_proc; time_stats_t phy_proc;
*/ */
time_stats_t *phy_proc_tx_0; time_stats_t *phy_proc_tx[2];
time_stats_t *phy_proc_tx_1;
time_stats_t phy_proc_rx; time_stats_t phy_proc_rx;
time_stats_t rx_prach; time_stats_t rx_prach;
/* /*
......
...@@ -235,8 +235,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -235,8 +235,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
} }
if (scheduled_response->tx_request) if (scheduled_response->tx_request)
scheduled_response->tx_request->number_of_pdus = 0; scheduled_response->tx_request->number_of_pdus = 0;
ul_config->sfn = 0; //ul_config->sfn = 0;
ul_config->slot = 0; //ul_config->slot = 0;
ul_config->number_pdus = 0; ul_config->number_pdus = 0;
memset(ul_config->ul_config_list, 0, sizeof(ul_config->ul_config_list)); memset(ul_config->ul_config_list, 0, sizeof(ul_config->ul_config_list));
pthread_mutex_unlock(&ul_config->mutex_ul_config); pthread_mutex_unlock(&ul_config->mutex_ul_config);
......
...@@ -978,7 +978,7 @@ int main(int argc, char **argv) ...@@ -978,7 +978,7 @@ int main(int argc, char **argv)
msgDataTx->frame = frame; msgDataTx->frame = frame;
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
reset_meas(&msgDataTx->phy_proc_tx); reset_meas(&msgDataTx->phy_proc_tx);
gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx;
pushTpool(gNB->threadPool,msgL1Tx); pushTpool(gNB->threadPool,msgL1Tx);
for (SNR = snr0; SNR < snr1; SNR += .2) { for (SNR = snr0; SNR < snr1; SNR += .2) {
...@@ -1294,7 +1294,7 @@ int main(int argc, char **argv) ...@@ -1294,7 +1294,7 @@ int main(int argc, char **argv)
msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3,
msgDataTx->dlsch[0][0]->harq_process.K, msgDataTx->dlsch[0][0]->harq_process.K,
msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10));
printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx");
printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time");
printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time");
printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time"); printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time");
......
...@@ -670,7 +670,7 @@ int main(int argc, char **argv) ...@@ -670,7 +670,7 @@ int main(int argc, char **argv)
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,NULL); notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,NULL);
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
msgDataTx->slot = -1; msgDataTx->slot = -1;
gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx;
pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning
//gNB_config = &gNB->gNB_config; //gNB_config = &gNB->gNB_config;
......
...@@ -61,11 +61,11 @@ static ssb_list_info_t ssb_list; ...@@ -61,11 +61,11 @@ static ssb_list_info_t ssb_list;
void fill_ul_config(fapi_nr_ul_config_request_t *ul_config, frame_t frame_tx, int slot_tx, uint8_t pdu_type){ void fill_ul_config(fapi_nr_ul_config_request_t *ul_config, frame_t frame_tx, int slot_tx, uint8_t pdu_type){
ul_config->ul_config_list[ul_config->number_pdus].pdu_type = pdu_type; ul_config->ul_config_list[ul_config->number_pdus].pdu_type = pdu_type;
ul_config->slot = slot_tx; //ul_config->slot = slot_tx;
ul_config->sfn = frame_tx; //ul_config->sfn = frame_tx;
ul_config->number_pdus++; ul_config->number_pdus++;
LOG_D(NR_MAC, "In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n", __FUNCTION__, ul_config->sfn, ul_config->slot, ul_config->number_pdus); LOG_D(NR_MAC, "In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus);
} }
...@@ -947,15 +947,15 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -947,15 +947,15 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
// AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus) // AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus)
if (ul_config){ if (ul_config){
pthread_mutex_lock(&ul_config->mutex_ul_config); pthread_mutex_lock(&ul_config->mutex_ul_config);
if ((ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && ul_config->number_pdus > 0){ if (/*(ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && */ ul_config->number_pdus > 0){
LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus, ul_config->sfn, ul_config->slot); LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus);
uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES]; uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES];
nr_scheduled_response_t scheduled_response; nr_scheduled_response_t scheduled_response;
fapi_nr_tx_request_t tx_req; fapi_nr_tx_request_t tx_req;
tx_req.slot = slot_tx; //tx_req.slot = slot_tx;
tx_req.sfn = frame_tx; //tx_req.sfn = frame_tx;
tx_req.number_of_pdus = 0; tx_req.number_of_pdus = 0;
for (int j = 0; j < ul_config->number_pdus; j++) { for (int j = 0; j < ul_config->number_pdus; j++) {
......
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