Commit 1de69e8e authored by Khodr Saaifan's avatar Khodr Saaifan
Browse files

PHY: link dmrs_config to higher layers

parent e38679e6
...@@ -713,7 +713,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -713,7 +713,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
// dmrs_Uplink_Config->pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0; // dmrs_Uplink_Config->pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0;
// dmrs_Uplink_Config->pusch_maxLength = pusch_len1; // dmrs_Uplink_Config->pusch_maxLength = pusch_len1;
//-------------------------------------------------// //-------------------------------------------------//
ue->dmrs_DownlinkConfig.pdsch_dmrs_type = pdsch_dmrs_type1; ue->dmrs_DownlinkConfig.pdsch_dmrs_type = pdsch_dmrs_type1;//sfn
ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition = pdsch_dmrs_pos0; ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition = pdsch_dmrs_pos0;
ue->dmrs_DownlinkConfig.pdsch_maxLength = pdsch_len1; ue->dmrs_DownlinkConfig.pdsch_maxLength = pdsch_len1;
//-------------------------------------------------// //-------------------------------------------------//
......
...@@ -121,18 +121,18 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue, ...@@ -121,18 +121,18 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
array_of_w *wf; array_of_w *wf;
array_of_w *wt; array_of_w *wt;
config_type = 0; //to be updated by higher layer config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
wf = (config_type==0) ? wf1 : wf2; wf = (config_type==pdsch_dmrs_type1) ? wf1 : wf2;
wt = (config_type==0) ? wt1 : wt2; wt = (config_type==pdsch_dmrs_type1) ? wt1 : wt2;
if (config_type > 1) if (config_type > 1)
LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type); LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type);
if ((p>=1000) && (p<((config_type==0) ? 1008 : 1012))) { if ((p>=1000) && (p<((config_type==pdsch_dmrs_type1) ? 1008 : 1012))) {
if (ue->frame_parms.Ncp == NORMAL) { if (ue->frame_parms.Ncp == NORMAL) {
for (int i=0; i<nb_pdsch_rb*((config_type==0) ? 6:4); i++) { for (int i=0; i<nb_pdsch_rb*((config_type==pdsch_dmrs_type1) ? 6:4); i++) {
w = (wf[p-1000][i&1])*(wt[p-1000][lp]); w = (wf[p-1000][i&1])*(wt[p-1000][lp]);
mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table; mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table;
......
...@@ -716,12 +716,12 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -716,12 +716,12 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
// generate pilot // generate pilot
uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12; uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12;
int config_type = 0; // needs to be updated from higher layer int config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][0], &pilot[0],1000,0,nb_rb_pdsch+rb_offset); nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][0], &pilot[0],1000,0,nb_rb_pdsch+rb_offset);
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
pil = (int16_t *)&pilot[rb_offset*((config_type==0) ? 6:4)]; pil = (int16_t *)&pilot[rb_offset*((config_type==pdsch_dmrs_type1) ? 6:4)];
k = k % ue->frame_parms.ofdm_symbol_size; k = k % ue->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset]; dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
...@@ -875,7 +875,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -875,7 +875,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
uint16_t idxDC = 2*(ue->frame_parms.ofdm_symbol_size - bwp_start_subcarrier); uint16_t idxDC = 2*(ue->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
uint16_t idxPil = idxDC/2; uint16_t idxPil = idxDC/2;
re_offset = k; re_offset = k;
pil = (int16_t *)&pilot[rb_offset*((config_type==0) ? 6:4)]; pil = (int16_t *)&pilot[rb_offset*((config_type==pdsch_dmrs_type1) ? 6:4)];
pil += (idxPil-2); pil += (idxPil-2);
dl_ch += (idxDC-4); dl_ch += (idxDC-4);
dl_ch = memset(dl_ch, 0, sizeof(int16_t)*10); dl_ch = memset(dl_ch, 0, sizeof(int16_t)*10);
......
...@@ -496,8 +496,8 @@ typedef struct{ // CSI-MeasConfig IE is used to configure CSI-RS (reference sign ...@@ -496,8 +496,8 @@ typedef struct{ // CSI-MeasConfig IE is used to configure CSI-RS (reference sign
uint8_t reportTriggerSize; uint8_t reportTriggerSize;
} csi_MeasConfig_t; } csi_MeasConfig_t;
typedef enum { typedef enum {
pdsch_dmrs_type1 = 1, pdsch_dmrs_type1 = 0,
pdsch_dmrs_type2 = 2 pdsch_dmrs_type2 = 1
} pdsch_dmrs_type_t; } pdsch_dmrs_type_t;
typedef enum { typedef enum {
pusch_dmrs_type1 = 0, pusch_dmrs_type1 = 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