Commit 1e39dd77 authored by francescomani's avatar francescomani

fix physical simulators

parent 8e56e14d
...@@ -460,6 +460,7 @@ int main(int argc, char **argv) ...@@ -460,6 +460,7 @@ int main(int argc, char **argv)
rel15->mcsIndex[0] = Imcs; rel15->mcsIndex[0] = Imcs;
rel15->numDmrsCdmGrpsNoData = 1; rel15->numDmrsCdmGrpsNoData = 1;
rel15->maintenance_parms_v3.tbSizeLbrmBytes = Tbslbrm; rel15->maintenance_parms_v3.tbSizeLbrmBytes = Tbslbrm;
rel15->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS, rate);
double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc
short channel_output_fixed[16 * 68 * 384]; short channel_output_fixed[16 * 68 * 384];
//unsigned char *estimated_output; //unsigned char *estimated_output;
......
...@@ -318,6 +318,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -318,6 +318,7 @@ void nr_dlsim_preprocessor(module_id_t module_id,
sched_pdsch->rbStart = g_rbStart; sched_pdsch->rbStart = g_rbStart;
sched_pdsch->rbSize = g_rbSize; sched_pdsch->rbSize = g_rbSize;
sched_pdsch->mcs = g_mcsIndex; sched_pdsch->mcs = g_mcsIndex;
sched_pdsch->nrOfLayers = g_nrOfLayers;
/* the following might override the table that is mandated by RRC /* the following might override the table that is mandated by RRC
* configuration */ * configuration */
current_BWP->mcsTableIdx = g_mcsTableIdx; current_BWP->mcsTableIdx = g_mcsTableIdx;
......
...@@ -466,6 +466,7 @@ int main(int argc, char **argv) ...@@ -466,6 +466,7 @@ int main(int argc, char **argv)
rel15_ul->nrOfLayers = Nl; rel15_ul->nrOfLayers = Nl;
rel15_ul->target_code_rate = code_rate; rel15_ul->target_code_rate = code_rate;
rel15_ul->pusch_data.tb_size = TBS>>3; rel15_ul->pusch_data.tb_size = TBS>>3;
rel15_ul->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS, code_rate);
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc
......
...@@ -1126,7 +1126,7 @@ int main(int argc, char **argv) ...@@ -1126,7 +1126,7 @@ int main(int argc, char **argv)
pusch_pdu->bwp_size = abwp_size; pusch_pdu->bwp_size = abwp_size;
} }
pusch_pdu->pusch_data.tb_size = TBS/8; pusch_pdu->pusch_data.tb_size = TBS>>3;
pusch_pdu->pdu_bit_map = pdu_bit_map; pusch_pdu->pdu_bit_map = pdu_bit_map;
pusch_pdu->rnti = n_rnti; pusch_pdu->rnti = n_rnti;
pusch_pdu->mcs_index = Imcs; pusch_pdu->mcs_index = Imcs;
...@@ -1158,6 +1158,7 @@ int main(int argc, char **argv) ...@@ -1158,6 +1158,7 @@ int main(int argc, char **argv)
pusch_pdu->pusch_ptrs.ptrs_freq_density = ptrs_freq_density; pusch_pdu->pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
pusch_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ptrs_ports_t)); pusch_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ptrs_ports_t));
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
pusch_pdu->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS, code_rate);
// if transform precoding is enabled // if transform precoding is enabled
if (transform_precoding == transformPrecoder_enabled) { if (transform_precoding == transformPrecoder_enabled) {
......
...@@ -3498,6 +3498,15 @@ void csi_period_offset(NR_CSI_ReportConfig_t *csirep, ...@@ -3498,6 +3498,15 @@ void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
} }
} }
uint8_t get_BG(uint32_t A, uint16_t R) {
float code_rate = (float) R / 10240.0f;
if ((A <=292) || ((A<=3824) && (code_rate <= 0.6667)) || code_rate <= 0.25)
return 2;
else
return 1;
}
uint32_t get_Y(NR_SearchSpace_t *ss, int slot, rnti_t rnti) { uint32_t get_Y(NR_SearchSpace_t *ss, int slot, rnti_t rnti) {
if(ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common) if(ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common)
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
uint32_t get_Y(NR_SearchSpace_t *ss, int slot, rnti_t rnti); uint32_t get_Y(NR_SearchSpace_t *ss, int slot, rnti_t rnti);
uint8_t get_BG(uint32_t A, uint16_t R);
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn); uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw); uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
......
...@@ -212,6 +212,7 @@ uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx) ...@@ -212,6 +212,7 @@ uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx)
return 9; return 9;
} }
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
//TODO first basic implementation of dmrs port selection //TODO first basic implementation of dmrs port selection
...@@ -248,15 +249,6 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { ...@@ -248,15 +249,6 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
} }
} }
uint8_t get_BG(uint32_t A, uint16_t R) {
float code_rate = (float) R / 10240.0f;
if ((A <=292) || ((A<=3824) && (code_rate <= 0.6667)) || code_rate <= 0.25)
return 2;
else
return 1;
}
NR_ControlResourceSet_t *get_coreset(gNB_MAC_INST *nrmac, NR_ControlResourceSet_t *get_coreset(gNB_MAC_INST *nrmac,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
void *bwp, void *bwp,
......
...@@ -469,7 +469,6 @@ uint16_t set_pm_index(NR_UE_sched_ctrl_t *sched_ctrl, ...@@ -469,7 +469,6 @@ uint16_t set_pm_index(NR_UE_sched_ctrl_t *sched_ctrl,
int codebook_mode); int codebook_mode);
uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx); uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx);
uint8_t get_BG(uint32_t A, uint16_t R);
uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl); uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl);
const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot); const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot);
......
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