Commit a5734bdb authored by Ahmed Hussein's avatar Ahmed Hussein

Using ul_dmrs_symb_pos at UE side instead of assuming that DMRS is only...

Using ul_dmrs_symb_pos at UE side instead of assuming that DMRS is only present at 1st symbol of PUSCH
parent a6f729c8
......@@ -359,7 +359,7 @@ static void UE_synch(void *arg) {
void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
uint32_t nb_rb, start_rb;
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
uint16_t n_rnti;
uint16_t n_rnti, l_prime_mask;
nr_dcireq_t dcireq;
nr_scheduled_response_t scheduled_response;
......@@ -390,6 +390,7 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
mcs = 9;
harq_pid = 0;
rvidx = 0;
l_prime_mask = get_l_prime(nb_symb_sch, typeB, pusch_dmrs_pos0, pusch_len1);
//------------------------------------------------------------------------------//
scheduled_response.ul_config->slot = 8;
......@@ -400,6 +401,7 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ul_dmrs_symb_pos = l_prime_mask;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = mcs;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx;
......
......@@ -276,6 +276,8 @@ typedef struct {
int8_t absolute_delta_PUSCH;
uint8_t n_layers;
uint8_t tpmi;
//DMRS
uint16_t ul_dmrs_symb_pos;
uint8_t n_dmrs_cdm_groups;
uint8_t dmrs_ports[4];
uint8_t n_front_load_symb;
......
......@@ -133,6 +133,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t dmrs_type,
uint8_t L_ptrs,
uint8_t pusch_maxLength,
uint16_t ul_dmrs_symb_pos,
uint16_t ofdm_symbol_size) {
uint8_t i, last_symbol, is_dmrs_symbol1, is_dmrs_symbol2;
int16_t l_ref;
......@@ -145,14 +146,11 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
while ( (l_ref + i*L_ptrs) <= last_symbol) {
// [hna] Temporary implementation until nFAPI structs are adopted at UE side
// --------------------------
if(max((l_ref + (i-1)*L_ptrs + 1), l_ref) == start_symbol)
if((ul_dmrs_symb_pos >> max((l_ref + (i-1)*L_ptrs + 1), l_ref)) & 0x01)
is_dmrs_symbol1 = 1;
if(l_ref + i*L_ptrs == start_symbol)
if((ul_dmrs_symb_pos >> (l_ref + i*L_ptrs)) & 0x01)
is_dmrs_symbol2 = 0;
// --------------------------
if ( is_dmrs_symbol1 + is_dmrs_symbol2 > 0 ) {
if (pusch_maxLength == 2)
......
......@@ -57,6 +57,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t dmrs_type,
uint8_t L_ptrs,
uint8_t pusch_maxLength,
uint16_t ul_dmrs_symb_pos,
uint16_t ofdm_symbol_size);
uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs);
......
......@@ -1055,6 +1055,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
rel15_ul->dmrs_config_type,
L_ptrs,
1, // only dmrs of length 1 is currently supported
rel15_ul->ul_dmrs_symb_pos,
frame_parms->ofdm_symbol_size);
}
}
......
......@@ -156,6 +156,7 @@ typedef struct {
uint8_t number_of_symbols;
// This is "S" in TS 38.214 V15.4.0 subclause 6.1.2.1
uint8_t start_symbol;
uint16_t ul_dmrs_symb_pos;
// decode phich
uint8_t decode_phich;
} NR_UL_UE_HARQ_t;
......
......@@ -110,7 +110,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
uint8_t dmrs_type, nb_dmrs_re_per_rb;
int ap, start_symbol, Nid_cell, i;
int sample_offsetF, N_RE_prime, N_PRB_oh;
uint16_t n_rnti;
uint16_t n_rnti, ul_dmrs_symb_pos;
uint8_t data_existing =0;
uint8_t L_ptrs, K_ptrs; // PTRS parameters
uint16_t beta_ptrs; // PTRS parameter related to power control
......@@ -135,14 +135,12 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
start_symbol = harq_process_ul_ue->start_symbol;
ul_dmrs_symb_pos = harq_process_ul_ue->ul_dmrs_symb_pos;
for (i = start_symbol; i < start_symbol + harq_process_ul_ue->number_of_symbols; i++) {
// [hna] Temporary implementation until nFAPI structs are adopted at UE side
// --------------------------
if((mapping_type ? (i - start_symbol) : i) == start_symbol)
if((ul_dmrs_symb_pos >> (mapping_type ? (i - start_symbol) : i)) & 0x01)
number_dmrs_symbols += 1;
// --------------------------
}
......@@ -295,6 +293,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
dmrs_type,
L_ptrs,
number_dmrs_symbols,
ul_dmrs_symb_pos,
frame_parms->ofdm_symbol_size);
}
......@@ -326,13 +325,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
for (l = start_symbol; l < start_symbol + harq_process_ul_ue->number_of_symbols; l++) {
// [hna] Temporary implementation until nFAPI structs are adopted at UE side
// --------------------------
if(((mapping_type)?l-start_symbol:l) == start_symbol)
if((ul_dmrs_symb_pos >> ((mapping_type)?l-start_symbol:l)) & 0x01)
is_dmrs = 1;
else
is_dmrs = 0;
// --------------------------
if (is_dmrs == 1)
nb_re_dmrs_per_rb = nb_dmrs_re_per_rb;
......@@ -392,13 +388,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
is_dmrs = 0;
is_ptrs = 0;
// [hna] Temporary implementation until nFAPI structs are adopted at UE side
// --------------------------
if(l_ref == start_symbol) {
if((ul_dmrs_symb_pos >> l_ref) & 0x01) {
if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%frame_parms->ofdm_symbol_size))
is_dmrs = 1;
}
// --------------------------
if (UE->ptrs_configured == 1){
is_ptrs = is_ptrs_symbol(l,
......
......@@ -122,6 +122,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
ulsch0->harq_processes[current_harq_pid]->first_rb = pusch_config_pdu->start_rb;
ulsch0->harq_processes[current_harq_pid]->number_of_symbols = pusch_config_pdu->number_symbols;
ulsch0->harq_processes[current_harq_pid]->start_symbol = pusch_config_pdu->start_symbol;
ulsch0->harq_processes[current_harq_pid]->ul_dmrs_symb_pos = pusch_config_pdu->ul_dmrs_symb_pos;
ulsch0->harq_processes[current_harq_pid]->mcs = pusch_config_pdu->mcs;
ulsch0->harq_processes[current_harq_pid]->DCINdi = pusch_config_pdu->ndi;
ulsch0->harq_processes[current_harq_pid]->rvidx = pusch_config_pdu->rv;
......
......@@ -592,6 +592,7 @@ int main(int argc, char **argv)
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ul_dmrs_symb_pos = l_prime_mask;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = Imcs;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = 0;
......
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