Commit beb0c4d8 authored by francescomani's avatar francescomani

implementation of if_freq option at OAI UE

parent de553cd1
...@@ -147,14 +147,6 @@ static void UE_synch(void *arg) { ...@@ -147,14 +147,6 @@ static void UE_synch(void *arg) {
if (UE->UE_scan == 0) { if (UE->UE_scan == 0) {
#ifdef FR2_TEST
// Overwrite DL frequency (for FR2 testing)
if (downlink_frequency[0][0]!=0){
UE->frame_parms.dl_CarrierFreq = downlink_frequency[0][0];
UE->frame_parms.ul_CarrierFreq = downlink_frequency[0][0];
}
#endif
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) { for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n", LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n",
...@@ -220,7 +212,7 @@ static void UE_synch(void *arg) { ...@@ -220,7 +212,7 @@ static void UE_synch(void *arg) {
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
uint64_t dl_carrier, ul_carrier; uint64_t dl_carrier, ul_carrier;
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier); nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier);
if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) { if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) {
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
......
...@@ -366,7 +366,7 @@ void init_openair0(void) { ...@@ -366,7 +366,7 @@ void init_openair0(void) {
openair0_cfg[card].rx_num_channels, openair0_cfg[card].rx_num_channels,
duplex_mode[openair0_cfg[card].duplex_mode]); duplex_mode[openair0_cfg[card].duplex_mode]);
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier); nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier);
nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off); nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off);
nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off); nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off);
...@@ -423,7 +423,7 @@ int main( int argc, char **argv ) { ...@@ -423,7 +423,7 @@ int main( int argc, char **argv ) {
get_options (); //Command-line options specific for NRUE get_options (); //Command-line options specific for NRUE
get_common_options(SOFTMODEM_5GUE_BIT ); get_common_options(SOFTMODEM_5GUE_BIT);
init_tpools(nrUE_params.nr_dlsch_parallel); init_tpools(nrUE_params.nr_dlsch_parallel);
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP); CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
#if T_TRACER #if T_TRACER
...@@ -493,14 +493,6 @@ int main( int argc, char **argv ) { ...@@ -493,14 +493,6 @@ int main( int argc, char **argv ) {
init_timeshift_rotation(&UE[CC_id]->frame_parms); init_timeshift_rotation(&UE[CC_id]->frame_parms);
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag); init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
#ifdef FR2_TEST
// Overwrite DL frequency (for FR2 testing)
if (downlink_frequency[0][0]!=0){
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
if (frame_parms[CC_id]->frame_type == TDD)
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
}
#endif
} }
init_openair0(); init_openair0();
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
#define CONFIG_HLP_IF_FREQ "IF frequency for RF, if needed"
#define CONFIG_HLP_IF_FREQ_OFF "UL IF frequency offset for RF, if needed"
#define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n" #define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n"
#define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n" #define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n"
/***************************************************************************************************************************************/ /***************************************************************************************************************************************/
...@@ -62,6 +63,8 @@ ...@@ -62,6 +63,8 @@
{"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \ {"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \
{"s" , CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \ {"s" , CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, u64ptr:&(UE->if_freq), defuintval:0, TYPE_UINT64,0}, \
{"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, iptr:&(UE->if_freq_off), defuintval:0, TYPE_INT, 0}, \
{"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \ {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \ {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \
} }
......
...@@ -1466,7 +1466,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -1466,7 +1466,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
@param dl_Carrier Pointer to DL carrier to be set @param dl_Carrier Pointer to DL carrier to be set
@param ul_Carrier Pointer to UL carrier to be set @param ul_Carrier Pointer to UL carrier to be set
*/ */
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue,
uint64_t *dl_Carrier, uint64_t *dl_Carrier,
uint64_t *ul_Carrier); uint64_t *ul_Carrier);
......
...@@ -33,19 +33,17 @@ ...@@ -33,19 +33,17 @@
#include "nr_transport_proto_ue.h" #include "nr_transport_proto_ue.h"
#include "executables/softmodem-common.h" #include "executables/softmodem-common.h"
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){ void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier){
if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || !downlink_frequency[0][0]) { NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
if (ue->if_freq!=0) {
*dl_carrier = ue->if_freq;
*ul_carrier = *dl_carrier + ue->if_freq_off;
}
else{
*dl_carrier = fp->dl_CarrierFreq; *dl_carrier = fp->dl_CarrierFreq;
} else { *ul_carrier = fp->ul_CarrierFreq;
*dl_carrier = downlink_frequency[0][0];
} }
if (uplink_frequency_offset[0][0])
*ul_carrier = *dl_carrier + uplink_frequency_offset[0][0];
else
*ul_carrier = *dl_carrier + fp->ul_CarrierFreq - fp->dl_CarrierFreq;
} }
......
...@@ -767,6 +767,10 @@ typedef struct { ...@@ -767,6 +767,10 @@ typedef struct {
int UE_scan_carrier; int UE_scan_carrier;
/// \brief Indicator that UE should enable estimation and compensation of frequency offset /// \brief Indicator that UE should enable estimation and compensation of frequency offset
int UE_fo_compensation; int UE_fo_compensation;
/// IF frequency for RF
uint64_t if_freq;
/// UL IF frequency offset for RF
int if_freq_off;
/// \brief Indicator that UE is synchronized to a gNB /// \brief Indicator that UE is synchronized to a gNB
int is_synchronized; int is_synchronized;
/// \brief Indicator that UE lost frame synchronization /// \brief Indicator that UE lost frame synchronization
......
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