Commit 451937d8 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/develop-SRS-in-ulsim' into integration_2022_wk02

parents 675ebb1f a7db9280
......@@ -82,7 +82,7 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports);
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
int get_nb_periods_per_frame(uint8_t tdd_period);
int get_supported_band_index(int scs, int band, int n_rbs);
long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS);
long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS);
void get_samplerate_and_bw(int mu,
int n_rb,
int8_t threequarter_fs,
......
......@@ -1691,7 +1691,7 @@ typedef struct {
uint16_t num_ue_srs_ports; // Nu: Number of sampled UE SRS ports. Value: 07
uint16_t prg_size; // Size in RBs of a precoding resource block group (PRG) – to which the same digital beamforming gets applied. Value: 1->272
uint16_t num_prgs; // Number of PRGs Np to be reported for this SRS PDU. Value: 0-> 272
uint8_t channel_matrix[272*512*8*4]; // Array of (numPRGs*Nu*Ng) entries of the type denoted by iqRepresentation H{PRG pI} [ueAntenna uI, gNB antenna gI] = array[uI*Ng*Np + gI*Np + pI]; uI: 0…Nu-1 (UE antenna index); gI: 0…Ng-1 (gNB antenna index); pI: 0…Np-1 (PRG index)
uint8_t channel_matrix[272*2*8*4]; // Array of (numPRGs*Nu*Ng) entries of the type denoted by iqRepresentation H{PRG pI} [ueAntenna uI, gNB antenna gI] = array[uI*Ng*Np + gI*Np + pI]; uI: 0…Nu-1 (UE antenna index); gI: 0…Ng-1 (gNB antenna index); pI: 0…Np-1 (PRG index)
} nfapi_nr_srs_normalized_channel_iq_matrix_t;
// Beamforming report
......@@ -1702,7 +1702,7 @@ typedef struct {
typedef struct {
uint16_t num_prgs; // Number of PRBs to be reported for this SRS PDU. Value: 0 -> 272.
nfapi_nr_srs_reported_symbol_prgs_t *prg_list;
nfapi_nr_srs_reported_symbol_prgs_t prg_list[272];
} nfapi_nr_srs_reported_symbol_t;
typedef struct {
......@@ -1710,7 +1710,7 @@ typedef struct {
uint8_t num_symbols; // Number of symbols for SRS. Value: 1 -> 4. If a PHY does not report for individual symbols then this parameter should be set to 1.
uint8_t wide_band_snr; // SNR value in dB measured within configured SRS bandwidth on each symbol. Value: 0 -> 255 representing -64 dB to 63 dB with a step size 0.5 dB. 0xff will be set if this field is invalid.
uint8_t num_reported_symbols; // Number of symbols reported in this message. This allows PHY to report individual symbols or aggregated symbols where this field will be set to 1. Value: 1 -> 4.
nfapi_nr_srs_reported_symbol_t *prgs;
nfapi_nr_srs_reported_symbol_t prgs;
} nfapi_nr_srs_beamforming_report_t;
// SRS indication
......@@ -1728,7 +1728,7 @@ typedef struct {
int16_t timing_advance_offset_nsec; // Timing advance measured for the UE between the reference uplink time and the observed arrival time for the UE. Value: -16800 … +16800 nanoseconds. 0xffff should be set if this field is invalid.
uint8_t srs_usage; // 0 – beamManagement; 1 – codebook; 2 – nonCodebook; 3 – antennaSwitching; 4 – 255: reserved; Note: This field matches the SRS usage field of the SRS PDU to which this report is linked.
uint8_t report_type; // The type of report included in or pointed to by Report TLV depends on the SRS usage: Beam management (1: Beamforming report); Codebook (1: Normalized Channel I/Q Matrix); nonCodebook (1: Normalized Channel I/Q Matrix); antennaSwitch (1: Channel SVD Representation); all (0: null report)
nfapi_srs_report_tlv_t *report_tlv;
nfapi_srs_report_tlv_t report_tlv;
} nfapi_nr_srs_indication_pdu_t;
typedef struct {
......
......@@ -3162,7 +3162,7 @@ int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t
return 0;
}
if(!pack_nr_srs_reported_symbol(nr_srs_beamforming_report->prgs, &pWritePackedMessage, end)) {
if (!pack_nr_srs_reported_symbol(&nr_srs_beamforming_report->prgs, &pWritePackedMessage, end)) {
return 0;
}
......@@ -3199,7 +3199,7 @@ static uint8_t pack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value,
return 0;
}
if(!pack_nr_srs_report_tlv(value->report_tlv,ppWritePackedMsg, end)) {
if (!pack_nr_srs_report_tlv(&value->report_tlv, ppWritePackedMsg, end)) {
return 0;
}
......@@ -5920,10 +5920,6 @@ static uint8_t unpack_nr_srs_reported_symbol(nfapi_nr_srs_reported_symbol_t *prg
return 0;
}
if(!prgs->prg_list) {
prgs->prg_list = (nfapi_nr_srs_reported_symbol_prgs_t*) calloc(1, prgs->num_prgs*sizeof(nfapi_nr_srs_reported_symbol_prgs_t));
}
for(int i = 0; i < prgs->num_prgs; i++) {
if (!pull8(ppReadPackedMsg, &prgs->prg_list[i].rb_snr, end)) {
return 0;
......@@ -5948,11 +5944,7 @@ int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen,
return -1;
}
if(!nr_srs_beamforming_report->prgs) {
nr_srs_beamforming_report->prgs = (nfapi_nr_srs_reported_symbol_t*) calloc(1, sizeof(nfapi_nr_srs_reported_symbol_t));
}
if(!unpack_nr_srs_reported_symbol(nr_srs_beamforming_report->prgs, &pReadPackedMessage, end)) {
if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->prgs, &pReadPackedMessage, end)) {
return -1;
}
......@@ -5986,7 +5978,7 @@ static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *valu
return 0;
}
if(!unpack_nr_srs_report_tlv(value->report_tlv, ppReadPackedMsg, end)) {
if (!unpack_nr_srs_report_tlv(&value->report_tlv, ppReadPackedMsg, end)) {
return 0;
}
......
......@@ -742,6 +742,14 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t ulsch_rbs_extraction_stats;
time_stats_t ulsch_mrc_stats;
time_stats_t ulsch_llr_stats;
time_stats_t rx_srs_stats;
time_stats_t generate_srs_stats;
time_stats_t get_srs_signal_stats;
time_stats_t srs_channel_estimation_stats;
time_stats_t srs_timing_advance_stats;
time_stats_t srs_report_tlv_stats;
time_stats_t srs_beam_report_stats;
time_stats_t srs_iq_matrix_stats;
/*
time_stats_t rx_dft_stats;
......
......@@ -206,6 +206,7 @@ typedef struct {
uint8_t k_0_p[MAX_NUM_NR_SRS_AP][MAX_NUM_NR_SRS_SYMBOLS];
uint8_t srs_generated_signal_bits;
int32_t **srs_generated_signal;
nfapi_nr_srs_pdu_t srs_pdu;
} nr_srs_info_t;
typedef struct {
......
This diff is collapsed.
This diff is collapsed.
......@@ -1014,8 +1014,8 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo
srs_config_pdu->rnti = mac->crnti;
srs_config_pdu->handle = 0;
srs_config_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE);;
srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE);;
srs_config_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE);
srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE);
srs_config_pdu->subcarrier_spacing = ubwp.subcarrierSpacing;
srs_config_pdu->cyclic_prefix = 0;
srs_config_pdu->num_ant_ports = srs_resource->nrofSRS_Ports;
......
......@@ -446,7 +446,7 @@ void handle_nr_ul_harq(const int CC_idP,
void handle_nr_srs_measurements(const module_id_t module_id,
const frame_t frame,
const sub_frame_t slot,
const nfapi_nr_srs_indication_pdu_t *srs_ind);
nfapi_nr_srs_indication_pdu_t *srs_ind);
int16_t ssb_index_from_prach(module_id_t module_idP,
frame_t frameP,
......
......@@ -231,15 +231,15 @@ void handle_nr_srs(NR_UL_IND_t *UL_info) {
const frame_t frame = UL_info->srs_ind.sfn;
const sub_frame_t slot = UL_info->srs_ind.slot;
const int num_srs = UL_info->srs_ind.number_of_pdus;
const nfapi_nr_srs_indication_pdu_t *srs_list = UL_info->srs_ind.pdu_list;
nfapi_nr_srs_indication_pdu_t *srs_list = UL_info->srs_ind.pdu_list;
for (int i = 0; i < num_srs; i++) {
const nfapi_nr_srs_indication_pdu_t *srs_ind = &srs_list[i];
nfapi_nr_srs_indication_pdu_t *srs_ind = &srs_list[i];
LOG_D(NR_PHY, "(%d.%d) UL_info->srs_ind.pdu_list[%d].rnti: 0x%04x\n", frame, slot, i, srs_ind->rnti);
handle_nr_srs_measurements(module_id,
frame,
slot,
&srs_list[i]);
srs_ind);
}
UL_info->srs_ind.number_of_pdus = 0;
......
......@@ -375,7 +375,7 @@ void config_csiim(int do_csirs, int dl_antenna_ports, int curr_bwp,
}
// TODO: Implement to b_SRS = 1 and b_SRS = 2
long rrc_get_max_nr_csrs(const uint8_t max_rbs, const long b_SRS) {
long rrc_get_max_nr_csrs(const int max_rbs, const long b_SRS) {
if(b_SRS>0) {
LOG_E(NR_RRC,"rrc_get_max_nr_csrs(): Not implemented yet for b_SRS>0\n");
......
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