move command line sample offset and 3/4 sampling option at top level, as it is common option for 4G,5G xNB and UE

This commit is contained in:
Laurent THOMAS
2024-03-04 10:07:07 +01:00
parent bedc5bea4c
commit 7466297568
31 changed files with 102 additions and 150 deletions
+2 -1
View File
@@ -19,6 +19,7 @@
* contact@openairinterface.org
*/
#include "executables/softmodem-common.h"
#include "executables/nr-softmodem-common.h"
#include "common/utils/nr/nr_common.h"
#include "common/ran_context.h"
@@ -540,7 +541,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset);
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
LOG_A(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
Mod_id,
gNB_config->cell_config.phy_cell_id.value,
+2 -6
View File
@@ -81,13 +81,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
int i, prach_len;
uint16_t first_nonzero_root_idx=0;
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
prach_start = (ue->rx_offset + subframe * ue->frame_parms.samples_per_tti - ue->N_TA_offset);
#ifdef PRACH_DEBUG
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
prach_start,
ue->rx_offset,
ue->hw_timing_advance,
ue->N_TA_offset);
LOG_I(PHY, "[UE %d] prach_start %d, rx_offset %d, N_TA_offset %d\n", ue->Mod_id, prach_start, ue->rx_offset, ue->N_TA_offset);
#endif
if (prach_start<0)
@@ -207,8 +207,8 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB,
unsigned short rx_power_avg_dB;
unsigned short rx_power_tot_dB;
double rx_gain = openair0_cfg[0].rx_gain[0];
double rx_gain_offset = openair0_cfg[0].rx_gain_offset[0];
double rx_gain = gNB->RU_list[0]->rfdevice.openair0_cfg->rx_gain[0];
double rx_gain_offset = gNB->RU_list[0]->rfdevice.openair0_cfg->rx_gain_offset[0];
PHY_MEASUREMENTS_gNB *meas = &gNB->measurements;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
int ch_offset = fp->ofdm_symbol_size * symbol;
-3
View File
@@ -637,8 +637,6 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
///
uint32_t total_system_throughput;
///
int hw_timing_advance;
///
time_stats_t phy_proc;
time_stats_t phy_proc_tx;
time_stats_t phy_proc_rx;
@@ -873,7 +871,6 @@ typedef struct {
int rx_offset; /// Timing offset
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
int timing_advance; ///timing advance signalled from eNB
int hw_timing_advance;
int N_TA_offset; ///timing offset used in TDD
/// Flag to tell if UE is secondary user (cognitive mode)
unsigned char is_secondary_ue;
+1 -2
View File
@@ -721,8 +721,7 @@ typedef struct {
int rx_offset; /// Timing offset
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
int time_sync_cell;
int timing_advance; ///timing advance signalled from eNB
int hw_timing_advance;
int timing_advance; /// timing advance signalled from eNB
int N_TA_offset; ///timing offset used in TDD
/// Flag to tell if UE is secondary user (cognitive mode)
unsigned char is_secondary_ue;
-2
View File
@@ -713,8 +713,6 @@ typedef struct PHY_VARS_eNB_s {
uint32_t total_transmitted_bits;
uint32_t total_system_throughput;
int hw_timing_advance;
time_stats_t phy_proc_tx;
time_stats_t phy_proc_rx;
time_stats_t rx_prach;
+1 -1
View File
@@ -175,7 +175,7 @@ struct NR_DL_FRAME_PARMS {
/// subcarrier spacing (15,30,60,120)
uint32_t subcarrier_spacing;
/// 3/4 sampling
uint8_t threequarter_fs;
int threequarter_fs;
/// Size of FFT
uint16_t ofdm_symbol_size;
/// Number of prefix samples in all but first symbol of slot
+1 -12
View File
@@ -1151,8 +1151,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue,
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
ulsch_start = ue->rx_offset + subframe_tx * frame_parms->samples_per_tti
- ue->hw_timing_advance - ue->timing_advance - ue->N_TA_offset + 5;
ulsch_start = ue->rx_offset + subframe_tx * frame_parms->samples_per_tti - ue->timing_advance - ue->N_TA_offset + 5;
if(ulsch_start < 0)
ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
@@ -1210,16 +1209,6 @@ void ulsch_common_procedures(PHY_VARS_UE *ue,
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
}
/*
only for debug
LOG_I(PHY,"ul-signal [subframe: %d, ulsch_start %d, TA: %d, rxOffset: %d, timing_advance: %d, hw_timing_advance: %d]\n",subframe_tx, ulsch_start, ue->N_TA_offset, ue->rx_offset, ue->timing_advance, ue->hw_timing_advance);
if( (crash == 1) && (subframe_tx == 0) )
{
LOG_E(PHY,"***** DUMP TX Signal [ulsch_start %d] *****\n",ulsch_start);
LOG_M("txBuff.m","txSignal",&ue->common_vars.txdata[aa][ulsch_start],frame_parms->samples_per_tti,1,1);
}
*/
} //nb_antennas_tx
if ( LOG_DEBUGFLAG(UE_TIMING)) {