Commit 60952780 authored by Ahmed Hussein's avatar Ahmed Hussein

Separating "is_ptrs_subcarrier" from "is_ptrs_symbol"

parent 040b58bf
......@@ -139,11 +139,14 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
* NAME : is_ptrs_subcarrier
*
* PARAMETERS : k subcarrier index
* K_ptrs the parameter K_ptrs
* n_rnti UE CRNTI
* dmrs_antenna_port DMRS antenna port
* K_ptrs the parameter K_ptrs
* pusch_dmrs_type the DMRS configuration type used for PUSCH
* N_RB number of RBs scheduled for PUSCH
* k_RE_ref the parameter k_RE_ref
* start_sc first subcarrier index
* ofdm_symbol_size number of samples in an OFDM symbol
*
* RETURN : 1 if subcarrier k is PTRS, or 0 otherwise
*
......@@ -151,8 +154,17 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
*
*********************************************************************/
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size) {
uint8_t is_ptrs_subcarrier(uint16_t k,
uint16_t n_rnti,
uint8_t dmrs_antenna_port,
uint8_t pusch_dmrs_type,
uint8_t K_ptrs,
uint16_t N_RB,
uint8_t k_RE_ref,
uint16_t start_sc,
uint16_t ofdm_symbol_size)
{
// int16_t k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset);
uint16_t k_RB_ref;
if (N_RB % K_ptrs == 0)
......@@ -174,39 +186,16 @@ uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t
* NAME : is_ptrs_symbol
*
* PARAMETERS : l ofdm symbol index within slot
* k subcarrier index
* n_rnti UE CRNTI
* N_RB number of RBs scheduled for PUSCH
* dmrs_antenna_port DMRS antenna port
* K_ptrs the parameter K_ptrs
* ptrs_symbols bit mask of ptrs
* start_sc first subcarrier index
* pusch_dmrs_type PUSCH DMRS type (1 or 2)
* ptrs_UplinkConfig PTRS uplink configuration
*
* RETURN : 0 if symbol(k,l) is data, or 1 if symbol(k,l) is ptrs
* RETURN : 1 if symbol is ptrs, or 0 otherwise
*
* DESCRIPTION : 3GPP TS 38.211 6.4.1.2 Phase-tracking reference signal for PUSCH
*
*********************************************************************/
uint8_t is_ptrs_symbol(uint8_t l,
uint16_t k,
uint16_t n_rnti,
uint16_t N_RB,
uint8_t dmrs_antenna_port,
uint8_t K_ptrs,
uint16_t ptrs_symbols,
uint16_t start_sc,
uint8_t pusch_dmrs_type,
uint8_t k_RE_ref,
uint16_t ofdm_symbol_size)
uint8_t is_ptrs_symbol(uint8_t l, uint16_t ptrs_symbols)
{
// int16_t k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset);
uint8_t is_ptrs_freq = is_ptrs_subcarrier(k, K_ptrs, n_rnti, N_RB, k_RE_ref, start_sc, ofdm_symbol_size);
if (is_ptrs_freq == 0)
return 0;
if (((ptrs_symbols>>l)&1) == 1)
return 1;
......
......@@ -55,19 +55,17 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t L_ptrs,
uint16_t ul_dmrs_symb_pos);
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size);
uint8_t is_ptrs_symbol(uint8_t l,
uint16_t k,
uint16_t n_rnti,
uint16_t N_RB,
uint8_t dmrs_antenna_port,
uint8_t K_ptrs,
uint16_t ptrs_symbols,
uint16_t start_sc,
uint8_t pusch_dmrs_type,
uint8_t k_RE_ref,
uint16_t ofdm_symbol_size);
uint8_t is_ptrs_subcarrier(uint16_t k,
uint16_t n_rnti,
uint8_t dmrs_antenna_port,
uint8_t pusch_dmrs_type,
uint8_t K_ptrs,
uint16_t N_RB,
uint8_t k_RE_ref,
uint16_t start_sc,
uint16_t ofdm_symbol_size);
uint8_t is_ptrs_symbol(uint8_t l, uint16_t ptrs_symbols);
......
......@@ -285,18 +285,16 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
is_dmrs_re = 0;
if ( ((pusch_pdu->pdu_bit_map)>>2)& 0x01 ) {
is_ptrs_symbol_flag = is_ptrs_symbol(symbol,
(start_re + re) % frame_parms->ofdm_symbol_size,
n_rnti,
pusch_pdu->rb_size,
aarx,
K_ptrs,
pusch_vars->ptrs_symbols,
start_re,
pusch_pdu->dmrs_config_type,
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
frame_parms->ofdm_symbol_size);
if(is_ptrs_symbol(symbol, pusch_vars->ptrs_symbols))
is_ptrs_symbol_flag = is_ptrs_subcarrier((start_re + re) % frame_parms->ofdm_symbol_size,
n_rnti,
aarx,
pusch_pdu->dmrs_config_type,
K_ptrs,
pusch_pdu->rb_size,
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
start_re,
frame_parms->ofdm_symbol_size);
if (is_ptrs_symbol_flag == 1)
num_ptrs_symbols++;
......@@ -1026,7 +1024,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
unsigned char harq_pid)
{
uint8_t first_symbol_flag, aarx, aatx, dmrs_symbol_flag, ptrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
uint8_t first_symbol_flag, aarx, aatx, dmrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
uint32_t nb_re_pusch, bwp_start_subcarrier;
uint8_t L_ptrs = 0; // PTRS parameter
int avgs;
......@@ -1035,7 +1033,6 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[UE_id][0]->harq_processes[harq_pid]->ulsch_pdu;
dmrs_symbol_flag = 0;
ptrs_symbol_flag = 0;
first_symbol_flag = 0;
gNB->pusch_vars[UE_id]->ptrs_sc_per_ofdm_symbol = 0;
......@@ -1069,21 +1066,8 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
}
if ( ((rel15_ul->pdu_bit_map)>>2)& 0x01 ) { // if there is ptrs pdu
ptrs_symbol_flag = is_ptrs_symbol(symbol,
0,
rel15_ul->rnti,
rel15_ul->rb_size,
0,
(rel15_ul->pusch_ptrs.ptrs_freq_density)?4:2,
gNB->pusch_vars[UE_id]->ptrs_symbols,
0,
rel15_ul->dmrs_config_type,
rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
frame_parms->ofdm_symbol_size);
}
if (ptrs_symbol_flag == 1){
gNB->pusch_vars[UE_id]->ptrs_symbol_index = symbol;
if(is_ptrs_symbol(symbol, gNB->pusch_vars[UE_id]->ptrs_symbols))
gNB->pusch_vars[UE_id]->ptrs_symbol_index = symbol;
}
......
......@@ -396,17 +396,16 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
if ((harq_process_ul_ue->pusch_pdu.pdu_bit_map >> 2) & 0x01){
is_ptrs = is_ptrs_symbol(l,
k,
rnti,
nb_rb,
ap,
K_ptrs,
ulsch_ue->ptrs_symbols,
start_sc,
dmrs_type,
harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
frame_parms->ofdm_symbol_size);
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols))
is_ptrs = is_ptrs_subcarrier(k,
rnti,
ap,
dmrs_type,
K_ptrs,
nb_rb,
harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
start_sc,
frame_parms->ofdm_symbol_size);
}
if (is_dmrs == 1) {
......
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