Remove SNR parameter
The structure in which was snr will be a "SRS job" in a follow-up commit, so the snr parameter cannot be stored in there (and it is also not necessary to do so, as it can be local to the function handling nr_srs_rx_procedures()). Correctly read SRS SNR through FAPI message in nr_ulsim. Switch to SRS BEAMMANAGEMENT as only this message returns the actual SNR (unlike CODEBOOK). Add asserts to check what is returned is valid data in the sense of the test. Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
@@ -568,6 +568,7 @@ int main(int argc, char *argv[])
|
||||
int srs_est;
|
||||
c16_t srs_estimated_channel_freq[n_rx][N_ap][ofdm_symbol_size * N_symb_SRS] __attribute__((aligned(32)));
|
||||
|
||||
int8_t snr;
|
||||
nr_srs_rx_procedures(gNB,
|
||||
frame,
|
||||
slot,
|
||||
@@ -577,12 +578,13 @@ int main(int argc, char *argv[])
|
||||
ofdm_symbol_size,
|
||||
srs,
|
||||
&srs_est,
|
||||
&snr,
|
||||
srs_estimated_channel_freq,
|
||||
snr_per_rb,
|
||||
&timing_advance_offset,
|
||||
timing_advance_offset_nsec);
|
||||
|
||||
sum_srs_snr += pow(10, (double)gNB->srs->snr / 10.0);
|
||||
sum_srs_snr += pow(10, (double)snr / 10.0);
|
||||
|
||||
int16_t delay_ns = delay * 1e9 / (fp->samples_per_frame * 100);
|
||||
for (int ant_idx = 0; ant_idx < n_rx; ant_idx++) {
|
||||
|
||||
@@ -1308,7 +1308,7 @@ int main(int argc, char *argv[])
|
||||
srs_pdu->resource_type = NR_SRS_Resource__resourceType_PR_periodic;
|
||||
srs_pdu->t_srs = 1;
|
||||
srs_pdu->srs_parameters_v4.srs_bandwidth_size = m_SRS[srs_pdu->config_index];
|
||||
srs_pdu->srs_parameters_v4.usage = 1 << NR_SRS_ResourceSet__usage_codebook;
|
||||
srs_pdu->srs_parameters_v4.usage = 1 << NFAPI_NR_SRS_BEAMMANAGEMENT; // to get SNR
|
||||
srs_pdu->srs_parameters_v4.report_type[0] = 1;
|
||||
srs_pdu->srs_parameters_v4.iq_representation = 1;
|
||||
srs_pdu->srs_parameters_v4.prg_size = 1;
|
||||
@@ -1748,7 +1748,14 @@ int main(int argc, char *argv[])
|
||||
delay_pusch_est_count++;
|
||||
|
||||
if (do_SRS == 1) {
|
||||
sum_srs_snr += gNB->srs->snr;
|
||||
DevAssert(UL_INFO.srs_ind.number_of_pdus == 1); // there must be SRS indication
|
||||
const nfapi_nr_srs_indication_pdu_t *srs_ind = &UL_INFO.srs_ind.pdu_list[0];
|
||||
DevAssert(srs_ind->srs_usage == NFAPI_NR_SRS_BEAMMANAGEMENT);
|
||||
nfapi_nr_srs_beamforming_report_t bf_rep;
|
||||
unpack_nr_srs_beamforming_report((void *)srs_ind->report_tlv.value, srs_ind->report_tlv.length, &bf_rep, sizeof(bf_rep));
|
||||
DevAssert(bf_rep.wide_band_snr != 0xff);
|
||||
int8_t snr = (bf_rep.wide_band_snr >> 1) - 64;
|
||||
sum_srs_snr += snr;
|
||||
srs_snr_count++;
|
||||
}
|
||||
} // trial loop
|
||||
|
||||
Reference in New Issue
Block a user