Merge remote-tracking branch 'origin/NR_UE_UL_time_alignment' into integration_2024_w39
This commit is contained in:
@@ -499,47 +499,21 @@ void clean_UE_harq(PHY_VARS_NR_UE *UE)
|
||||
}
|
||||
|
||||
|
||||
void init_N_TA_offset(PHY_VARS_NR_UE *ue){
|
||||
|
||||
void init_N_TA_offset(PHY_VARS_NR_UE *ue)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
|
||||
// No timing offset for Sidelink, refer to 3GPP 38.211 Section 8.5
|
||||
if (fp->frame_type == FDD || ue->sl_mode == 2) {
|
||||
if (ue->sl_mode == 2)
|
||||
ue->N_TA_offset = 0;
|
||||
} else {
|
||||
int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
else
|
||||
ue->N_TA_offset = set_default_nta_offset(fp->freq_range, fp->samples_per_subframe);
|
||||
ue->ta_frame = -1;
|
||||
ue->ta_slot = -1;
|
||||
|
||||
double factor = 1.0;
|
||||
switch (fp->numerology_index) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n");
|
||||
factor = fp->samples_per_subframe / 30720.0;
|
||||
break;
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n");
|
||||
factor = fp->samples_per_subframe / 30720.0;
|
||||
break;
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0, "scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n");
|
||||
factor = fp->samples_per_subframe / 61440.0;
|
||||
break;
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 240kHz only for FR2\n");
|
||||
factor = fp->samples_per_subframe / 61440.0;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid scs_common!\n");
|
||||
}
|
||||
|
||||
ue->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
ue->ta_frame = -1;
|
||||
ue->ta_slot = -1;
|
||||
|
||||
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d, mu %d)\n", ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index);
|
||||
}
|
||||
LOG_I(PHY,
|
||||
"UE %d Setting N_TA_offset to %d samples (UL Freq %lu, N_RB %d, mu %d)\n",
|
||||
ue->Mod_id, ue->N_TA_offset, fp->ul_CarrierFreq, fp->N_RB_DL, fp->numerology_index);
|
||||
}
|
||||
|
||||
void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
|
||||
|
||||
@@ -316,7 +316,7 @@ void nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *
|
||||
fp->get_samples_slot_timestamp = &get_samples_slot_timestamp;
|
||||
fp->get_slot_from_timestamp = &get_slot_from_timestamp;
|
||||
fp->samples_per_frame = 10 * fp->samples_per_subframe;
|
||||
fp->freq_range = (fp->dl_CarrierFreq < 6e9)? FR1 : FR2;
|
||||
fp->freq_range = (fp->dl_CarrierFreq < 6e9) ? FR1 : FR2;
|
||||
|
||||
fp->Ncp = Ncp;
|
||||
|
||||
@@ -400,7 +400,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fp->get_samples_per_slot = &get_samples_per_slot;
|
||||
fp->get_samples_slot_timestamp = &get_samples_slot_timestamp;
|
||||
fp->samples_per_frame = 10 * fp->samples_per_subframe;
|
||||
fp->freq_range = (fp->dl_CarrierFreq < 6e9)? FR1 : FR2;
|
||||
fp->freq_range = (fp->dl_CarrierFreq < 6e9) ? FR1 : FR2;
|
||||
|
||||
uint8_t sco = 0;
|
||||
if (((fp->freq_range == FR1) && (config->ssb_table.ssb_subcarrier_offset < 24)) ||
|
||||
|
||||
@@ -224,42 +224,6 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
stop_meas(&ru->precoding_stats);
|
||||
}
|
||||
|
||||
|
||||
void nr_fep_full(RU_t *ru, int slot) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
int l, aa;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
// if ((fp->frame_type == TDD) &&
|
||||
// (subframe_select(fp,proc->tti_rx) != NR_UPLINK_SLOT)) return;
|
||||
|
||||
LOG_D(PHY,"In fep_full for slot = %d\n", proc->tti_rx);
|
||||
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
|
||||
// remove_7_5_kHz(ru,proc->tti_rx<<1);
|
||||
// remove_7_5_kHz(ru,1+(proc->tti_rx<<1));
|
||||
int offset = (proc->tti_rx % RU_RX_SLOT_DEPTH) * (fp->symbols_per_slot * fp->ofdm_symbol_size);
|
||||
for (l = 0; l < fp->symbols_per_slot; l++) {
|
||||
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(fp,
|
||||
ru->common.rxdata[aa],
|
||||
&ru->common.rxdataF[aa][offset],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
ru->N_TA_offset);
|
||||
}
|
||||
}
|
||||
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// core routine for FEP TX, called from threads in RU TX thread-pool
|
||||
void nr_feptx(void *arg) {
|
||||
|
||||
@@ -363,8 +327,8 @@ void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
|
||||
}
|
||||
|
||||
// core RX FEP routine, called by threads in RU thread-pool
|
||||
void nr_fep(void* arg) {
|
||||
|
||||
void nr_fep(void* arg)
|
||||
{
|
||||
feprx_cmd_t *feprx_cmd = (feprx_cmd_t *)arg;
|
||||
|
||||
RU_t *ru = feprx_cmd->ru;
|
||||
|
||||
@@ -40,10 +40,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
|
||||
void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
|
||||
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa);
|
||||
|
||||
void fep_full(RU_t *ru,int slot);
|
||||
void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
|
||||
void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx);
|
||||
void nr_fep_full(RU_t *ru, int slot);
|
||||
void nr_fep_tp(RU_t *ru, int slot);
|
||||
void nr_feptx_tp(RU_t *ru, int frame_tx, int slot);
|
||||
void feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
|
||||
|
||||
@@ -328,7 +328,6 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
|
||||
|
||||
static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_command_pdu)
|
||||
{
|
||||
|
||||
/* Time Alignment procedure
|
||||
// - UE processing capability 1
|
||||
// - Setting the TA update to be applied after the reception of the TA command
|
||||
@@ -369,7 +368,7 @@ static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_
|
||||
/* Time alignment procedure */
|
||||
// N_t_1 + N_t_2 + N_TA_max must be in msec
|
||||
const double t_subframe = 1.0; // subframe duration of 1 msec
|
||||
const int ul_tx_timing_adjustment = 1 + (int)ceil(slots_per_subframe*(N_t_1 + N_t_2 + N_TA_max + 0.5)/t_subframe);
|
||||
const int ul_tx_timing_adjustment = 1 + (int)ceil(slots_per_subframe * (N_t_1 + N_t_2 + N_TA_max + 0.5) / t_subframe);
|
||||
|
||||
if (ta_command_pdu->is_rar) {
|
||||
ue->ta_slot = ta_command_pdu->ta_slot;
|
||||
@@ -383,8 +382,19 @@ static void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_
|
||||
ue->ta_frame = ta_command_pdu->ta_frame;
|
||||
ue->ta_command = ta_command_pdu->ta_command;
|
||||
}
|
||||
LOG_D(PHY,"TA command received in Frame.Slot %d.%d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n",
|
||||
|
||||
LOG_D(PHY,
|
||||
"TA command received in %d.%d Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n",
|
||||
ta_command_pdu->ta_frame, ta_command_pdu->ta_slot, ue->ta_frame, ue->ta_slot);
|
||||
|
||||
if (ta_command_pdu->ta_offset != -1) {
|
||||
// ta_offset_samples : ta_offset = samples_per_subframe : (Δf_max x N_f / 1000)
|
||||
// As described in Section 4.3.1 in 38.211
|
||||
int ta_offset_samples = (ta_command_pdu->ta_offset * samples_per_subframe) / (4096 * 480);
|
||||
ue->N_TA_offset = ta_offset_samples;
|
||||
LOG_D(PHY, "Received N_TA offset %d from upper layers. Corresponds to %d samples.\n",
|
||||
ta_command_pdu->ta_offset, ta_offset_samples);
|
||||
}
|
||||
}
|
||||
|
||||
static void nr_ue_scheduled_response_dl(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
Reference in New Issue
Block a user