Commit 139cdc0d authored by Raymond Knopp's avatar Raymond Knopp Committed by Robert Schmidt

Add new parameter tx_amp_backoff_dB to L1 section of configuration file

Provides the backoff from full-scale output at the L1 entity
(frequency-domain samples). Default is, 36 dBFS, which is the correct
value when using the OAI RU entity. For O-RAN RU, this value should be
set according to the O-RU manufacturer requirements. For example 12
would corresponding to 14-bit input level (6 dB/bit).

Applies the TX amp backoff to PBCH, PDCCH and CSI
parent 1268b27c
...@@ -554,7 +554,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -554,7 +554,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
AssertFatal(pdcch_dmrs!=NULL, "NR init: pdcch_dmrs malloc failed\n"); AssertFatal(pdcch_dmrs!=NULL, "NR init: pdcch_dmrs malloc failed\n");
gNB->bad_pucch = 0; gNB->bad_pucch = 0;
if (gNB->TX_AMP == 0)
gNB->TX_AMP = AMP;
// ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK) // ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK)
int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1; int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1;
......
...@@ -60,7 +60,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ...@@ -60,7 +60,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
PHY_VARS_gNB *gNB = msgTx->gNB; PHY_VARS_gNB *gNB = msgTx->gNB;
NR_gNB_DLSCH_t *dlsch; NR_gNB_DLSCH_t *dlsch;
c16_t** txdataF = gNB->common_vars.txdataF; c16_t** txdataF = gNB->common_vars.txdataF;
int16_t amp = AMP; int16_t amp = gNB->TX_AMP;
int xOverhead = 0; int xOverhead = 0;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
time_stats_t *dlsch_encoding_stats=&gNB->dlsch_encoding_stats; time_stats_t *dlsch_encoding_stats=&gNB->dlsch_encoding_stats;
......
...@@ -644,6 +644,8 @@ typedef struct PHY_VARS_gNB_s { ...@@ -644,6 +644,8 @@ typedef struct PHY_VARS_gNB_s {
/// CSI variables /// CSI variables
nr_csi_info_t *nr_csi_info; nr_csi_info_t *nr_csi_info;
// reference amplitude for TX
int16_t TX_AMP;
// PUCCH0 Look-up table for cyclic-shifts // PUCCH0 Look-up table for cyclic-shifts
NR_gNB_PUCCH0_LUT_t pucch0_lut; NR_gNB_PUCCH0_LUT_t pucch0_lut;
......
...@@ -81,13 +81,23 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ ...@@ -81,13 +81,23 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier, prb_offset, sc_offset); LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier, prb_offset, sc_offset);
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pss(&txdataF[0][txdataF_offset], gNB->TX_AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_sss(&txdataF[0][txdataF_offset], gNB->TX_AMP, ssb_start_symbol, cfg, fp);
if (fp->Lmax == 4) if (fp->Lmax == 4)
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index & 7],
&txdataF[0][txdataF_offset],
gNB->TX_AMP,
ssb_start_symbol,
cfg,
fp);
else else
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index & 7],
&txdataF[0][txdataF_offset],
gNB->TX_AMP,
ssb_start_symbol,
cfg,
fp);
if (T_ACTIVE(T_GNB_PHY_MIB)) { if (T_ACTIVE(T_GNB_PHY_MIB)) {
unsigned char bch[3]; unsigned char bch[3];
...@@ -107,9 +117,12 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ ...@@ -107,9 +117,12 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
nr_generate_pbch(&ssb_pdu, nr_generate_pbch(&ssb_pdu,
gNB->nr_pbch_interleaver, gNB->nr_pbch_interleaver,
&txdataF[0][txdataF_offset], &txdataF[0][txdataF_offset],
AMP, gNB->TX_AMP,
ssb_start_symbol, ssb_start_symbol,
n_hf, frame, cfg, fp); n_hf,
frame,
cfg,
fp);
} }
...@@ -170,9 +183,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, ...@@ -170,9 +183,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1);
nr_generate_dci_top(msgTx, slot, nr_generate_dci_top(msgTx, slot, (int32_t *)&gNB->common_vars.txdataF[0][txdataF_offset], gNB->TX_AMP, fp);
(int32_t *)&gNB->common_vars.txdataF[0][txdataF_offset],
AMP, fp);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,0);
} }
...@@ -189,7 +200,20 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, ...@@ -189,7 +200,20 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
if (csirs->active == 1) { if (csirs->active == 1) {
LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot); LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot);
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params = &csirs->csirs_pdu.csi_rs_pdu_rel15; nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params = &csirs->csirs_pdu.csi_rs_pdu_rel15;
nr_generate_csi_rs(&gNB->frame_parms, (int32_t **)gNB->common_vars.txdataF, AMP, gNB->nr_csi_info, csi_params, slot, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); nr_generate_csi_rs(&gNB->frame_parms,
(int32_t **)gNB->common_vars.txdataF,
gNB->TX_AMP,
gNB->nr_csi_info,
csi_params,
slot,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
csirs->active = 0; csirs->active = 0;
} }
} }
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#define CONFIG_STRING_L1_RX_THREAD_CORE "L1_rx_thread_core" #define CONFIG_STRING_L1_RX_THREAD_CORE "L1_rx_thread_core"
#define CONFIG_STRING_L1_TX_THREAD_CORE "L1_tx_thread_core" #define CONFIG_STRING_L1_TX_THREAD_CORE "L1_tx_thread_core"
#define HLP_TP_SIZ "thread_pool_size paramter removed, please use --thread-pool" #define HLP_TP_SIZ "thread_pool_size paramter removed, please use --thread-pool"
#define CONFIG_STRING_L1_TX_AMP_BACKOFF_dB "tx_amp_backoff_dB"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* L1 configuration parameters */ /* L1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
...@@ -80,6 +81,7 @@ ...@@ -80,6 +81,7 @@
{CONFIG_STRING_L1_MAX_LDPC_ITERATIONS, NULL, 0, .uptr=NULL, .defintval=5, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_MAX_LDPC_ITERATIONS, NULL, 0, .uptr=NULL, .defintval=5, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_RX_THREAD_CORE, NULL, 0, .uptr=NULL, .defintval=-1, 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}, \ {CONFIG_STRING_L1_TX_THREAD_CORE, NULL, 0, .uptr=NULL, .defintval=-1, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_TX_AMP_BACKOFF_dB, NULL, 0, .uptr=NULL, .defintval=36, TYPE_UINT, 0}, \
} }
// clang-format on // clang-format on
#define L1_CC_IDX 0 #define L1_CC_IDX 0
...@@ -100,6 +102,7 @@ ...@@ -100,6 +102,7 @@
#define L1_MAX_LDPC_ITERATIONS 15 #define L1_MAX_LDPC_ITERATIONS 15
#define L1_RX_THREAD_CORE 16 #define L1_RX_THREAD_CORE 16
#define L1_TX_THREAD_CORE 17 #define L1_TX_THREAD_CORE 17
#define L1_TX_AMP_BACKOFF_dB 18
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif #endif
...@@ -773,6 +773,9 @@ void RCconfig_NR_L1(void) ...@@ -773,6 +773,9 @@ void RCconfig_NR_L1(void)
RC.gNB[j]->L1_rx_thread_core = *(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr); 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); RC.gNB[j]->L1_tx_thread_core = *(L1_ParamList.paramarray[j][L1_TX_THREAD_CORE].iptr);
LOG_I(PHY,"L1_RX_THREAD_CORE %d (%d)\n",*(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr),L1_RX_THREAD_CORE); LOG_I(PHY,"L1_RX_THREAD_CORE %d (%d)\n",*(L1_ParamList.paramarray[j][L1_RX_THREAD_CORE].iptr),L1_RX_THREAD_CORE);
RC.gNB[j]->TX_AMP = (int16_t)(32767.0 / pow(10.0, .05 * (double)(*L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr)));
LOG_I(PHY, "TX_AMP = %d (-%d dBFS)\n", RC.gNB[j]->TX_AMP, *L1_ParamList.paramarray[j][L1_TX_AMP_BACKOFF_dB].uptr);
AssertFatal(RC.gNB[j]->TX_AMP > 300, "TX_AMP is too small, must be larger than 300 (is %d)\n", RC.gNB[j]->TX_AMP);
if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { 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 // sf_ahead = 2; // Need 4 subframe gap between RX and TX
} else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { } else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
......
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