Commit a0d80091 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Address review comments

parent 49d60500
......@@ -614,8 +614,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) {
gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
gNB->nr_srs_info[id]->srs_generated_signal = (int32_t**)malloc16_clear(MAX_NUM_NR_SRS_AP*sizeof(int32_t*));
for(i=0; i<MAX_NUM_NR_SRS_AP;i++) {
gNB->nr_srs_info[id]->srs_generated_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
for(int ap=0; ap<MAX_NUM_NR_SRS_AP; ap++) {
gNB->nr_srs_info[id]->srs_generated_signal[ap] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
}
......
......@@ -984,10 +984,10 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
const uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*NR_NB_SC_PER_RB;
uint8_t N_ap = 1<<srs_pdu->num_ant_ports;
uint8_t K_TC = 2<<srs_pdu->comb_size;
uint16_t m_SRS_b = srs_bandwidth_config[srs_pdu->config_index][srs_pdu->bandwidth_index][0];
uint16_t M_sc_b_SRS = m_SRS_b * NR_NB_SC_PER_RB/K_TC;
const uint8_t N_ap = 1<<srs_pdu->num_ant_ports;
const uint8_t K_TC = 2<<srs_pdu->comb_size;
const uint16_t m_SRS_b = srs_bandwidth_config[srs_pdu->config_index][srs_pdu->bandwidth_index][0];
const uint16_t M_sc_b_SRS = m_SRS_b * NR_NB_SC_PER_RB/K_TC;
uint8_t fd_cdm = N_ap;
if (N_ap == 4 && ((K_TC == 2 && srs_pdu->cyclic_shift >= 4) || (K_TC == 4 && srs_pdu->cyclic_shift >= 6))) {
fd_cdm = 2;
......
......@@ -315,19 +315,19 @@ int nr_find_pucch(uint16_t rnti,
NR_gNB_SRS_t *new_gNB_srs(void);
void free_gNB_srs(NR_gNB_SRS_t *srs);
int nr_find_srs(uint16_t rnti,
int frame,
int slot,
int nr_find_srs(rnti_t rnti,
frame_t frame,
slot_t slot,
PHY_VARS_gNB *gNB);
void nr_fill_srs(PHY_VARS_gNB *gNB,
int frame,
int slot,
frame_t frame,
slot_t slot,
nfapi_nr_srs_pdu_t *srs_pdu);
int nr_get_srs_signal(PHY_VARS_gNB *gNB,
int frame,
int slot,
frame_t frame,
slot_t slot,
nfapi_nr_srs_pdu_t *srs_pdu,
nr_srs_info_t *nr_srs_info,
int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)]);
......
......@@ -56,9 +56,9 @@ void free_gNB_srs(NR_gNB_SRS_t *srs)
free_and_zero(srs);
}
int nr_find_srs(uint16_t rnti,
int frame,
int slot,
int nr_find_srs(rnti_t rnti,
frame_t frame,
slot_t slot,
PHY_VARS_gNB *gNB) {
AssertFatal(gNB!=NULL,"gNB is null\n");
......@@ -80,8 +80,8 @@ int nr_find_srs(uint16_t rnti,
}
void nr_fill_srs(PHY_VARS_gNB *gNB,
int frame,
int slot,
frame_t frame,
slot_t slot,
nfapi_nr_srs_pdu_t *srs_pdu) {
int id = nr_find_srs(srs_pdu->rnti,frame,slot,gNB);
......@@ -96,8 +96,8 @@ void nr_fill_srs(PHY_VARS_gNB *gNB,
}
int nr_get_srs_signal(PHY_VARS_gNB *gNB,
int frame,
int slot,
frame_t frame,
slot_t slot,
nfapi_nr_srs_pdu_t *srs_pdu,
nr_srs_info_t *nr_srs_info,
int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)]) {
......@@ -107,17 +107,17 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
#endif
int32_t **rxdataF = gNB->common_vars.rxdataF;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
uint16_t n_symbols = (slot&3)*frame_parms->symbols_per_slot; // number of symbols until this slot
uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot
uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size;
uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*NR_NB_SC_PER_RB;
const uint16_t n_symbols = (slot&3)*frame_parms->symbols_per_slot; // number of symbols until this slot
const uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot
const uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size;
const uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*NR_NB_SC_PER_RB;
uint8_t N_ap = 1<<srs_pdu->num_ant_ports;
uint8_t N_symb_SRS = 1<<srs_pdu->num_symbols;
uint8_t K_TC = 2<<srs_pdu->comb_size;
uint16_t M_sc_b_SRS = srs_bandwidth_config[srs_pdu->config_index][srs_pdu->bandwidth_index][0] * NR_NB_SC_PER_RB/K_TC;
const uint8_t N_ap = 1<<srs_pdu->num_ant_ports;
const uint8_t N_symb_SRS = 1<<srs_pdu->num_symbols;
const uint8_t K_TC = 2<<srs_pdu->comb_size;
const uint16_t M_sc_b_SRS = srs_bandwidth_config[srs_pdu->config_index][srs_pdu->bandwidth_index][0] * NR_NB_SC_PER_RB/K_TC;
int32_t *rx_signal;
bool no_srs_signal = true;
......
......@@ -91,8 +91,8 @@ uint16_t sequence_number_hopping(int slot_number,
return v;
}
uint16_t compute_F_b(int frame_number,
int slot_number,
uint16_t compute_F_b(frame_t frame_number,
slot_t slot_number,
uint16_t slots_per_frame,
uint8_t N_symb_SRS,
uint8_t B_SRS,
......@@ -101,7 +101,7 @@ uint16_t compute_F_b(int frame_number,
uint8_t R,
uint16_t T_offset,
uint16_t T_SRS,
uint8_t resource_type,
resourceType_t resource_type,
uint8_t l_line,
uint8_t b) {
......@@ -133,8 +133,8 @@ uint16_t compute_F_b(int frame_number,
return F_b;
}
uint16_t compute_n_b(int frame_number,
int slot_number,
uint16_t compute_n_b(frame_t frame_number,
slot_t slot_number,
uint16_t slots_per_frame,
uint8_t N_symb_SRS,
uint8_t B_SRS,
......@@ -144,7 +144,7 @@ uint16_t compute_n_b(int frame_number,
uint8_t R,
uint16_t T_offset,
uint16_t T_SRS,
uint8_t resource_type,
resourceType_t resource_type,
uint8_t l_line,
uint8_t b) {
......@@ -189,8 +189,8 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
uint16_t symbol_offset,
nr_srs_info_t *nr_srs_info,
int16_t amp,
int frame_number,
int slot_number) {
frame_t frame_number,
slot_t slot_number) {
#ifdef SRS_DEBUG
LOG_I(NR_PHY,"Calling %s function\n", __FUNCTION__);
......
......@@ -156,8 +156,8 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
uint16_t symbol_offset,
nr_srs_info_t *nr_srs_info,
int16_t amp,
int frame_number,
int slot_number);
frame_t frame_number,
slot_t slot_number);
/** \brief This function checks for periodic srs if srs should be transmitted in this slot
* @param p_SRS_Resource pointer to active resource
......
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