Commit 15565c96 authored by francescomani's avatar francescomani

gold init improvement at ue for pusch

parent 34ab52b6
...@@ -103,7 +103,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, ...@@ -103,7 +103,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
} }
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
uint16_t *N_n_scid, uint16_t N_n_scid,
uint8_t n_scid) uint8_t n_scid)
{ {
uint32_t x1, x2, n; uint32_t x1, x2, n;
...@@ -116,7 +116,7 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, ...@@ -116,7 +116,7 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
for (symb=0; symb<fp->symbols_per_slot; symb++) { for (symb=0; symb<fp->symbols_per_slot; symb++) {
reset = 1; reset = 1;
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid)); x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid<<1)+1) +((N_n_scid<<1)+n_scid));
for (n=0; n<NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD; n++) { for (n=0; n<NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD; n++) {
pusch_dmrs[slot][symb][0][n] = lte_gold_generic(&x1, &x2, reset); pusch_dmrs[slot][symb][0][n] = lte_gold_generic(&x1, &x2, reset);
......
...@@ -65,7 +65,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, ...@@ -65,7 +65,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
uint32_t nid); uint32_t nid);
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
uint16_t *N_n_scid, uint16_t N_n_scid,
uint8_t n_scid); uint8_t n_scid);
#endif #endif
...@@ -316,9 +316,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -316,9 +316,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
} }
// initialize the pusch dmrs // initialize the pusch dmrs
uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell}; for (int i=0; i<2; i++) {
int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization ue->scramblingID_ulsch[i]=fp->Nid_cell;
nr_init_pusch_dmrs(ue, N_n_scid, n_scid); nr_init_pusch_dmrs(ue, ue->scramblingID_ulsch[i], i);
}
// we also need to take into account the shift by samples_per_frame in case the if is true // we also need to take into account the shift by samples_per_frame in case the if is true
if (ue->ssb_offset < sync_pos_frame){ if (ue->ssb_offset < sync_pos_frame){
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <stdint.h> #include <stdint.h>
#include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_REFSIG/ptrs_nr.h" #include "PHY/NR_REFSIG/ptrs_nr.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/MODULATION/nr_modulation.h" #include "PHY/MODULATION/nr_modulation.h"
...@@ -220,6 +221,11 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ...@@ -220,6 +221,11 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/////////////////////////DMRS Modulation///////////////////////// /////////////////////////DMRS Modulation/////////////////////////
/////////// ///////////
if(pusch_pdu->ul_dmrs_scrambling_id != UE->scramblingID_ulsch[pusch_pdu->scid]) {
UE->scramblingID_ulsch[pusch_pdu->scid] = pusch_pdu->ul_dmrs_scrambling_id;
nr_init_pusch_dmrs(UE, pusch_pdu->scid, pusch_pdu->ul_dmrs_scrambling_id);
}
uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
uint16_t n_dmrs = (pusch_pdu->bwp_start + start_rb + nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4); uint16_t n_dmrs = (pusch_pdu->bwp_start + start_rb + nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4);
int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16))); int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16)));
......
...@@ -861,6 +861,9 @@ typedef struct { ...@@ -861,6 +861,9 @@ typedef struct {
// Scrambling IDs used in PDSCH DMRS // Scrambling IDs used in PDSCH DMRS
uint16_t scramblingID_dlsch[2]; uint16_t scramblingID_dlsch[2];
// Scrambling IDs used in PUSCH DMRS
uint16_t scramblingID_ulsch[2];
/// PDCCH DMRS /// PDCCH DMRS
uint32_t ***nr_gold_pdcch[NUMBER_OF_CONNECTED_eNB_MAX]; uint32_t ***nr_gold_pdcch[NUMBER_OF_CONNECTED_eNB_MAX];
......
...@@ -732,6 +732,11 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -732,6 +732,11 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
? pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup : pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup; ? pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup : pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
} }
pusch_config_pdu->scid = 0;
pusch_config_pdu->ul_dmrs_scrambling_id = mac->physCellId;
if(*dci_format == NR_UL_DCI_FORMAT_0_1)
pusch_config_pdu->scid = dci->dmrs_sequence_initialization.val;
/* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/ /* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) { if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) {
...@@ -757,6 +762,14 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -757,6 +762,14 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
LOG_D(NR_MAC,"TRANSFORM PRECODING IS ENABLED. CDM groups: %d, U: %d \n", pusch_config_pdu->num_dmrs_cdm_grps_no_data, LOG_D(NR_MAC,"TRANSFORM PRECODING IS ENABLED. CDM groups: %d, U: %d \n", pusch_config_pdu->num_dmrs_cdm_grps_no_data,
pusch_config_pdu->dfts_ofdm.low_papr_group_number); pusch_config_pdu->dfts_ofdm.low_papr_group_number);
} }
else {
if (pusch_config_pdu->scid == 0 &&
NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID0)
pusch_config_pdu->ul_dmrs_scrambling_id = *NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID0;
if (pusch_config_pdu->scid == 1 &&
NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID1)
pusch_config_pdu->ul_dmrs_scrambling_id = *NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID1;
}
/* TRANSFORM PRECODING --------------------------------------------------------------------------------------------------------*/ /* TRANSFORM PRECODING --------------------------------------------------------------------------------------------------------*/
......
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