Commit 3aa5c2af authored by Sakthivel Velumani's avatar Sakthivel Velumani

Removed common txFifo for multiple threads

parent 0e4694c9
...@@ -324,7 +324,6 @@ void processSlotRX(void *arg) { ...@@ -324,7 +324,6 @@ void processSlotRX(void *arg) {
fapi_nr_config_request_t *cfg = &UE->nrUE_config; fapi_nr_config_request_t *cfg = &UE->nrUE_config;
int rx_slot_type = nr_ue_slot_select(cfg, proc->frame_rx, proc->nr_slot_rx); int rx_slot_type = nr_ue_slot_select(cfg, proc->frame_rx, proc->nr_slot_rx);
int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx); int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
bool isTxRunning = true;
uint8_t gNB_id = 0; uint8_t gNB_id = 0;
if (rx_slot_type == NR_DOWNLINK_SLOT || rx_slot_type == NR_MIXED_SLOT){ if (rx_slot_type == NR_DOWNLINK_SLOT || rx_slot_type == NR_MIXED_SLOT){
...@@ -340,7 +339,7 @@ void processSlotRX(void *arg) { ...@@ -340,7 +339,7 @@ void processSlotRX(void *arg) {
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL ); phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL );
#else #else
uint64_t a=rdtsc(); uint64_t a=rdtsc();
phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel); phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel, &rxtxD->txFifo);
LOG_D(PHY, "In %s: slot %d, time %lu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc()-a)/3500); LOG_D(PHY, "In %s: slot %d, time %lu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc()-a)/3500);
#endif #endif
...@@ -352,15 +351,9 @@ void processSlotRX(void *arg) { ...@@ -352,15 +351,9 @@ void processSlotRX(void *arg) {
} }
// Wait for PUSCH processing to finish // Wait for PUSCH processing to finish
while (isTxRunning) { notifiedFIFO_elt_t *res;
notifiedFIFO_elt_t *res; res = pullTpool(&rxtxD->txFifo,&(get_nrUE_params()->Tpool));
res = pullTpool(UE->txFifo,&(get_nrUE_params()->Tpool)); delNotifiedFIFO_elt(res);
if (res->key == proc->nr_slot_tx) {
isTxRunning = false;
res->key = TX_JOB_ID;
}
pushNotifiedFIFO(UE->txFifo, res);
}
} else { } else {
processSlotTX(rxtxD); processSlotTX(rxtxD);
...@@ -514,10 +507,6 @@ void *UE_thread(void *arg) { ...@@ -514,10 +507,6 @@ void *UE_thread(void *arg) {
notifiedFIFO_t freeBlocks; notifiedFIFO_t freeBlocks;
initNotifiedFIFO_nothreadSafe(&freeBlocks); initNotifiedFIFO_nothreadSafe(&freeBlocks);
notifiedFIFO_t txFifo;
UE->txFifo = &txFifo;
initNotifiedFIFO(&txFifo);
int nbSlotProcessing=0; int nbSlotProcessing=0;
int thread_idx=0; int thread_idx=0;
NR_UE_MAC_INST_t *mac = get_mac_inst(0); NR_UE_MAC_INST_t *mac = get_mac_inst(0);
...@@ -528,8 +517,10 @@ void *UE_thread(void *arg) { ...@@ -528,8 +517,10 @@ void *UE_thread(void *arg) {
int absolute_slot=0, decoded_frame_rx=INT_MAX, trashed_frames=0; int absolute_slot=0, decoded_frame_rx=INT_MAX, trashed_frames=0;
for (int i=0; i<NR_RX_NB_TH+1; i++) {// NR_RX_NB_TH working + 1 we are making to be pushed for (int i=0; i<NR_RX_NB_TH+1; i++) {// NR_RX_NB_TH working + 1 we are making to be pushed
pushNotifiedFIFO_nothreadSafe(&freeBlocks, newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), RX_JOB_ID,&nf,processSlotRX)); notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), RX_JOB_ID,&nf,processSlotRX);
pushNotifiedFIFO(&txFifo, newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), TX_JOB_ID,&txFifo,processSlotTX)); nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(newElt);
initNotifiedFIFO(&curMsg->txFifo);
pushNotifiedFIFO_nothreadSafe(&freeBlocks, newElt);
} }
while (!oai_exit) { while (!oai_exit) {
......
...@@ -1073,7 +1073,6 @@ typedef struct { ...@@ -1073,7 +1073,6 @@ typedef struct {
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX]; SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX]; SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
#endif #endif
notifiedFIFO_t *txFifo;
int dl_stats[5]; int dl_stats[5];
...@@ -1085,6 +1084,7 @@ typedef struct { ...@@ -1085,6 +1084,7 @@ typedef struct {
typedef struct nr_rxtx_thread_data_s { typedef struct nr_rxtx_thread_data_s {
UE_nr_rxtx_proc_t proc; UE_nr_rxtx_proc_t proc;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
notifiedFIFO_t txFifo;
} nr_rxtx_thread_data_t; } nr_rxtx_thread_data_t;
#include "SIMULATION/ETH_TRANSPORT/defs.h" #include "SIMULATION/ETH_TRANSPORT/defs.h"
......
...@@ -115,14 +115,17 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -115,14 +115,17 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
@param proc Pointer to proc information @param proc Pointer to proc information
@param gNB_id Local id of eNB on which to act @param gNB_id Local id of eNB on which to act
@param dlsch_parallel use multithreaded dlsch processing @param dlsch_parallel use multithreaded dlsch processing
@param txFifo Result fifo if PDSCH is run in parallel
*/ */
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id, uint8_t gNB_id,
uint8_t dlsch_parallel); uint8_t dlsch_parallel,
notifiedFIFO_t *txFifo);
int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id, uint8_t abstraction_flag, uint8_t do_pdcch_flag, relaying_type_t r_type); int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id, uint8_t abstraction_flag, uint8_t do_pdcch_flag, relaying_type_t r_type);
void processSlotTX(void *arg);
#ifdef UE_SLOT_PARALLELISATION #ifdef UE_SLOT_PARALLELISATION
void *UE_thread_slot1_dl_processing(void *arg); void *UE_thread_slot1_dl_processing(void *arg);
......
...@@ -1600,7 +1600,8 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL ...@@ -1600,7 +1600,8 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id, uint8_t gNB_id,
uint8_t dlsch_parallel uint8_t dlsch_parallel,
notifiedFIFO_t *txFifo
) )
{ {
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
...@@ -1759,13 +1760,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1759,13 +1760,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
#endif //NR_PDCCH_SCHED #endif //NR_PDCCH_SCHED
// Start PUSCH processing here. It runs in parallel with PDSCH processing // Start PUSCH processing here. It runs in parallel with PDSCH processing
notifiedFIFO_elt_t *res; notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), proc->nr_slot_tx,txFifo,processSlotTX);
res = pullTpool(ue->txFifo,&(get_nrUE_params()->Tpool)); nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(newElt);
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(res);
curMsg->proc = *proc; curMsg->proc = *proc;
curMsg->UE = ue; curMsg->UE = ue;
res->key = proc->nr_slot_tx; pushTpool(&(get_nrUE_params()->Tpool), newElt);
pushTpool(&(get_nrUE_params()->Tpool), res);
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->generic_stat); start_meas(&ue->generic_stat);
......
...@@ -1121,7 +1121,8 @@ int main(int argc, char **argv) ...@@ -1121,7 +1121,8 @@ int main(int argc, char **argv)
phy_procedures_nrUE_RX(UE, phy_procedures_nrUE_RX(UE,
&UE_proc, &UE_proc,
0, 0,
dlsch_threads); dlsch_threads,
NULL);
//printf("dlsim round %d ends\n",round); //printf("dlsim round %d ends\n",round);
round++; round++;
......
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