From e5d317a4d2ab65b05a77b58eafe744a4434a1e57 Mon Sep 17 00:00:00 2001 From: matzakos Date: Wed, 19 Aug 2020 16:56:04 +0200 Subject: [PATCH] Change DURATION_RX_TO_TX to 6 slots instead of 4 at nrUE - Ensure that tx slot processing is done by the time trx_write_func() gets called --- executables/nr-ue.c | 21 +++++-------------- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 4 ++-- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 6 +++--- openair1/PHY/impl_defs_top.h | 2 +- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2bc2b380c8..2c6e03ac2b 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -123,7 +123,7 @@ extern double cpuf; #ifndef NO_RAT_NR #define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */ #else - #define DURATION_RX_TO_TX (4) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */ + #define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */ #endif #define FRAME_PERIOD 100000000ULL @@ -736,7 +736,7 @@ void *UE_thread(void *arg) { for (int i=0; iframe_parms.nb_antennas_tx; i++) txp[i] = (void *)&UE->common_vars.txdata[i][UE->frame_parms.get_samples_slot_timestamp( - ((curMsg->proc.nr_tti_rx + DURATION_RX_TO_TX)%nb_slot_frame),&UE->frame_parms,0)]; + ((curMsg->proc.nr_tti_rx + DURATION_RX_TO_TX -2)%nb_slot_frame),&UE->frame_parms,0)]; int readBlockSize, writeBlockSize; @@ -758,16 +758,16 @@ void *UE_thread(void *arg) { readBlockSize, UE->frame_parms.nb_antennas_rx),""); - /* AssertFatal( writeBlockSize == + AssertFatal( writeBlockSize == UE->rfdevice.trx_write_func(&UE->rfdevice, timestamp+ UE->frame_parms.get_samples_slot_timestamp(slot_nr, - &UE->frame_parms,DURATION_RX_TO_TX) - firstSymSamp - + &UE->frame_parms,DURATION_RX_TO_TX -2) - firstSymSamp - openair0_cfg[0].tx_sample_advance, txp, writeBlockSize, UE->frame_parms.nb_antennas_tx, - 1),""); */ + 1),""); if( slot_nr==(nb_slot_frame-1)) { // read in first symbol of next frame and adjust for timing drift @@ -830,17 +830,6 @@ void *UE_thread(void *arg) { pushNotifiedFIFO_nothreadSafe(&freeBlocks,res); } - AssertFatal( writeBlockSize == - UE->rfdevice.trx_write_func(&UE->rfdevice, - timestamp+ - UE->frame_parms.get_samples_slot_timestamp(slot_nr, - &UE->frame_parms,DURATION_RX_TO_TX) - firstSymSamp - - openair0_cfg[0].tx_sample_advance, - txp, - writeBlockSize, - UE->frame_parms.nb_antennas_tx, - 1),""); - } // while !oai_exit return NULL; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index e00975eee1..8ca3071e06 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -714,11 +714,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, } #ifdef DEBUG_ULSCH_DECODING - LOG_I(PHY, "Decoder output (payload): \n"); + LOG_I(PHY, "Decoder output (payload) at SFN/SF: %d/%d \n", frame, nr_tti_rx); for (i = 0; i < harq_process->TBS ; i++) { //harq_process_ul_ue->a[i] = (unsigned char) rand(); //printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]); - printf("%02x",harq_process->b[i]); + printf("%02x ",harq_process->b[i]); } #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index bde9ae03f1..ee957965cd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1064,7 +1064,7 @@ void nr_pusch_codeword_scrambling(uint8_t *in, void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, unsigned char harq_pid, - uint8_t frame, + uint32_t frame, uint8_t slot, uint8_t thread_id, int gNB_id); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 93acda23f8..e054615fbe 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -93,7 +93,7 @@ void nr_pusch_codeword_scrambling(uint8_t *in, void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, unsigned char harq_pid, - uint8_t frame, + uint32_t frame, uint8_t slot, uint8_t thread_id, int gNB_id) { @@ -206,9 +206,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, } } #ifdef DEBUG_MAC_PDU - LOG_I(PHY, "Printing MAC PDU to be encoded, TBS is: %d \n", TBS/8); + LOG_I(PHY, "Printing MAC PDU to be encoded, TBS is: %d at SFN/SF: %d/%d \n", TBS/8, frame, slot); for (i = 0; i < TBS / 8; i++) { - printf("%02x",harq_process_ul_ue->a[i]); + printf("%02x ",harq_process_ul_ue->a[i]); } printf("\n"); #endif diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index a4607d3106..6c3d97838d 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -265,7 +265,7 @@ #define NB_NUMEROLOGIES_NR (5) #define TDD_CONFIG_NB_FRAMES (2) #define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */ -#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (4) /* FFS_NR_TODO it defines ue capability which is the number of slots */ +#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (6) /* FFS_NR_TODO it defines ue capability which is the number of slots */ /* - between reception of pdsch and tarnsmission of its acknowlegment */ /* - between reception of un uplink grant and its related transmission */