Removed common txFifo for multiple threads
This commit is contained in:
+8
-17
@@ -324,7 +324,6 @@ void processSlotRX(void *arg) {
|
||||
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 tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
|
||||
bool isTxRunning = true;
|
||||
uint8_t gNB_id = 0;
|
||||
|
||||
if (rx_slot_type == NR_DOWNLINK_SLOT || rx_slot_type == NR_MIXED_SLOT){
|
||||
@@ -340,7 +339,7 @@ void processSlotRX(void *arg) {
|
||||
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL );
|
||||
#else
|
||||
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);
|
||||
#endif
|
||||
|
||||
@@ -352,15 +351,9 @@ void processSlotRX(void *arg) {
|
||||
}
|
||||
|
||||
// Wait for PUSCH processing to finish
|
||||
while (isTxRunning) {
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = pullTpool(UE->txFifo,&(get_nrUE_params()->Tpool));
|
||||
if (res->key == proc->nr_slot_tx) {
|
||||
isTxRunning = false;
|
||||
res->key = TX_JOB_ID;
|
||||
}
|
||||
pushNotifiedFIFO(UE->txFifo, res);
|
||||
}
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = pullTpool(&rxtxD->txFifo,&(get_nrUE_params()->Tpool));
|
||||
delNotifiedFIFO_elt(res);
|
||||
|
||||
} else {
|
||||
processSlotTX(rxtxD);
|
||||
@@ -514,10 +507,6 @@ void *UE_thread(void *arg) {
|
||||
notifiedFIFO_t freeBlocks;
|
||||
initNotifiedFIFO_nothreadSafe(&freeBlocks);
|
||||
|
||||
notifiedFIFO_t txFifo;
|
||||
UE->txFifo = &txFifo;
|
||||
initNotifiedFIFO(&txFifo);
|
||||
|
||||
int nbSlotProcessing=0;
|
||||
int thread_idx=0;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
@@ -528,8 +517,10 @@ void *UE_thread(void *arg) {
|
||||
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
|
||||
pushNotifiedFIFO_nothreadSafe(&freeBlocks, 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));
|
||||
notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), RX_JOB_ID,&nf,processSlotRX);
|
||||
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(newElt);
|
||||
initNotifiedFIFO(&curMsg->txFifo);
|
||||
pushNotifiedFIFO_nothreadSafe(&freeBlocks, newElt);
|
||||
}
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -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_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
|
||||
#endif
|
||||
notifiedFIFO_t *txFifo;
|
||||
|
||||
int dl_stats[5];
|
||||
|
||||
@@ -1085,6 +1084,7 @@ typedef struct {
|
||||
typedef struct nr_rxtx_thread_data_s {
|
||||
UE_nr_rxtx_proc_t proc;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
notifiedFIFO_t txFifo;
|
||||
} nr_rxtx_thread_data_t;
|
||||
|
||||
#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
|
||||
@param proc Pointer to proc information
|
||||
@param gNB_id Local id of eNB on which to act
|
||||
@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,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
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);
|
||||
|
||||
void processSlotTX(void *arg);
|
||||
|
||||
#ifdef UE_SLOT_PARALLELISATION
|
||||
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
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
uint8_t dlsch_parallel
|
||||
uint8_t dlsch_parallel,
|
||||
notifiedFIFO_t *txFifo
|
||||
)
|
||||
{
|
||||
int frame_rx = proc->frame_rx;
|
||||
@@ -1759,13 +1760,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
#endif //NR_PDCCH_SCHED
|
||||
|
||||
// Start PUSCH processing here. It runs in parallel with PDSCH processing
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = pullTpool(ue->txFifo,&(get_nrUE_params()->Tpool));
|
||||
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(res);
|
||||
notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), proc->nr_slot_tx,txFifo,processSlotTX);
|
||||
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(newElt);
|
||||
curMsg->proc = *proc;
|
||||
curMsg->UE = ue;
|
||||
res->key = proc->nr_slot_tx;
|
||||
pushTpool(&(get_nrUE_params()->Tpool), res);
|
||||
pushTpool(&(get_nrUE_params()->Tpool), newElt);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->generic_stat);
|
||||
|
||||
@@ -1121,7 +1121,8 @@ int main(int argc, char **argv)
|
||||
phy_procedures_nrUE_RX(UE,
|
||||
&UE_proc,
|
||||
0,
|
||||
dlsch_threads);
|
||||
dlsch_threads,
|
||||
NULL);
|
||||
|
||||
//printf("dlsim round %d ends\n",round);
|
||||
round++;
|
||||
|
||||
Reference in New Issue
Block a user