Cleanly pass pusch_vars to nr_pusch_channel_estimation()
Pass pointer to data. This necessitates to move delay from NR_gNB_ULSCH_t (ULSCH data, including transport channels etc) to NR_gNB_PUSCH (lower-PHY PUSCH data): 1. This allows to pass a single pointer to nr_pusch_channel_estimation() 2. To me, delay estimation seems to be a lower-PHY calculation, so it fits better anyway. Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
@@ -452,7 +452,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
int nl,
|
||||
unsigned short p,
|
||||
unsigned char symbol,
|
||||
int ul_id,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int beam_nb,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
@@ -534,7 +534,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
int nest_count = 0;
|
||||
uint64_t noise_amp2 = 0;
|
||||
delay_t *delay = &gNB->ulsch[ul_id].delay;
|
||||
delay_t *delay = &pusch_vars->delay;
|
||||
memset(delay, 0, sizeof(*delay));
|
||||
|
||||
int nb_antennas_rx = fp->nb_antennas_rx;
|
||||
@@ -579,7 +579,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
rdata->delay = &delay_arr[rdata->aarx];
|
||||
rdata->beam_nb = beam_nb;
|
||||
rdata->frame_parms = fp;
|
||||
rdata->pusch_vars = &gNB->pusch_vars[ul_id];
|
||||
rdata->pusch_vars = pusch_vars;
|
||||
rdata->chest_freq = gNB->chest_freq;
|
||||
rdata->rxdataF = gNB->common_vars.rxdataF;
|
||||
rdata->scope = gNB->scopeData;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
\param Ns slot number (0..19)
|
||||
\param p
|
||||
\param symbol symbol within slot
|
||||
\param ul_id
|
||||
\param pusch_vars lower-phy PUSCH info
|
||||
\param bwp_start_subcarrier first allocated subcarrier
|
||||
\param pusch_pdu
|
||||
\param max_ch maximum value of estimated channel
|
||||
@@ -29,7 +29,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
int nl,
|
||||
unsigned short p,
|
||||
unsigned char symbol,
|
||||
int ul_id,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int beam_nb,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
|
||||
@@ -1159,7 +1159,7 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, uint8_t ulsch_id, uint32_t frame, uint8_t
|
||||
nl,
|
||||
get_dmrs_port(nl, rel15_ul->dmrs_ports),
|
||||
symbol,
|
||||
ulsch_id,
|
||||
pusch_vars,
|
||||
beam_nb,
|
||||
bwp_start_subcarrier,
|
||||
rel15_ul,
|
||||
|
||||
@@ -187,7 +187,6 @@ typedef struct {
|
||||
bool active;
|
||||
/// Flag to indicate that the UL configuration has been handled. Used to remove a stale ULSCH when frame wraps around
|
||||
uint8_t handled;
|
||||
delay_t delay;
|
||||
} NR_gNB_ULSCH_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -275,6 +274,8 @@ typedef struct {
|
||||
int llr_offset[14];
|
||||
/// flag to indicate DTX on reception
|
||||
int DTX;
|
||||
/// delay estimation
|
||||
delay_t delay;
|
||||
} NR_gNB_PUSCH;
|
||||
|
||||
/// Context data structure for RX/TX portion of slot processing
|
||||
|
||||
@@ -542,7 +542,7 @@ static void nr_fill_indication(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu;
|
||||
|
||||
// Get estimated timing advance for MAC
|
||||
const int sync_pos = gNB->ulsch[ULSCH_id].delay.est_delay;
|
||||
const int sync_pos = pusch->delay.est_delay;
|
||||
|
||||
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
|
||||
uint16_t bw_scaling = 16 * gNB->frame_parms.ofdm_symbol_size / 2048;
|
||||
|
||||
@@ -1208,6 +1208,7 @@ int main(int argc, char *argv[])
|
||||
uint8_t round = 0;
|
||||
crc_status = 1;
|
||||
errors_decoding = 0;
|
||||
NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[UE_id];
|
||||
|
||||
while (round < max_rounds && crc_status && !stop) {
|
||||
|
||||
@@ -1594,7 +1595,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[UE_id];
|
||||
if (n_trials == 1 && round == 0) {
|
||||
__attribute__((unused)) int off = ((nb_rb & 1) == 1) ? 4 : 0;
|
||||
|
||||
@@ -1742,9 +1742,9 @@ int main(int argc, char *argv[])
|
||||
if (!crc_status)
|
||||
effRate += ((double)TBS) / (double)round;
|
||||
|
||||
sum_pusch_delay += ulsch_gNB->delay.est_delay;
|
||||
min_pusch_delay = min(ulsch_gNB->delay.est_delay, min_pusch_delay);
|
||||
max_pusch_delay = max(ulsch_gNB->delay.est_delay, max_pusch_delay);
|
||||
sum_pusch_delay += pusch_vars->delay.est_delay;
|
||||
min_pusch_delay = min(pusch_vars->delay.est_delay, min_pusch_delay);
|
||||
max_pusch_delay = max(pusch_vars->delay.est_delay, max_pusch_delay);
|
||||
delay_pusch_est_count++;
|
||||
|
||||
if (do_SRS == 1) {
|
||||
|
||||
Reference in New Issue
Block a user