Commit 12e0f738 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/fix_pdsch_low_prb' into integration_2020_wk46_2

parents 4b3a67b3 cc2cc95f
......@@ -758,6 +758,9 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,
//ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL,0);
for(int i=0; i<5; i++)
ue->dl_stats[i] = 0;
}
......
......@@ -333,7 +333,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
uint8_t mod_order = rel15->qamModOrder[0];
uint16_t Kr=0,r;
uint32_t r_offset=0;
uint8_t BG=1;
uint32_t E;
uint8_t Ilbrm = 1;
uint32_t Tbslbrm = 950984; //max tbs
......@@ -431,9 +430,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
Coderate = (float) R /(float) 2048;
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25)
BG = 2;
dlsch->harq_processes[harq_pid]->BG = 2;
else
BG = 1;
dlsch->harq_processes[harq_pid]->BG = 1;
start_meas(dlsch_segmentation_stats);
Kb = nr_segmentation(dlsch->harq_processes[harq_pid]->b,
......@@ -443,7 +442,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
&dlsch->harq_processes[harq_pid]->K,
Zc,
&dlsch->harq_processes[harq_pid]->F,
BG);
dlsch->harq_processes[harq_pid]->BG);
stop_meas(dlsch_segmentation_stats);
F = dlsch->harq_processes[harq_pid]->F;
......@@ -480,7 +479,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
for(int j=0;j<(dlsch->harq_processes[harq_pid]->C/8+1);j++) {
impp.macro_num=j;
nrLDPC_encoder(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,BG,&impp);
nrLDPC_encoder(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,dlsch->harq_processes[harq_pid]->BG,&impp);
}
......@@ -532,7 +531,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
start_meas(dlsch_rate_matching_stats);
nr_rate_matching_ldpc(Ilbrm,
Tbslbrm,
BG,
dlsch->harq_processes[harq_pid]->BG,
*Zc,
dlsch->harq_processes[harq_pid]->d[r],
dlsch->harq_processes[harq_pid]->e+r_offset,
......
......@@ -253,13 +253,15 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
}
t_nrLDPC_procBuf** p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
// HARQ stats
phy_vars_ue->dl_stats[harq_process->round]++;
int16_t z [68*384];
int8_t l [68*384];
//__m128i l;
//int16_t inv_d [68*384];
uint8_t kc;
uint8_t Ilbrm = 0;
uint8_t Ilbrm = 1;
uint32_t Tbslbrm;// = 950984;
uint16_t nb_rb;// = 30;
......@@ -663,6 +665,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
if (harq_process->round >= dlsch->Mlimit) {
harq_process->status = SCH_IDLE;
harq_process->round = 0;
phy_vars_ue->dl_stats[4]++;
}
if(is_crnti)
......
......@@ -139,6 +139,8 @@ typedef struct {
uint32_t num_of_mod_symbols;
// decode phich
uint8_t decode_phich;
// Encoder BG
uint8_t BG;
} NR_UL_UE_HARQ_t;
typedef struct {
......
......@@ -232,7 +232,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
uint8_t mod_order;
uint16_t Kr,r;
uint32_t r_offset;
uint8_t BG;
uint32_t E,Kb;
uint8_t Ilbrm;
uint32_t Tbslbrm;
......@@ -255,7 +254,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
Kr=0;
r_offset=0;
BG = 1;
F=0;
Ilbrm = 0;
Tbslbrm = 950984; //max tbs
......@@ -327,10 +325,10 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
Coderate = (float) R /(float) 2048;
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25){
BG = 2;
harq_process->BG = 2;
}
else{
BG = 1;
harq_process->BG = 1;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
......@@ -341,7 +339,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
&harq_process->K,
pz,
&harq_process->F,
BG);
harq_process->BG);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
F = harq_process->F;
......@@ -401,7 +399,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
for(int j = 0; j < (harq_process->C/8 + 1); j++)
{
impp.macro_num = j;
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,BG,&impp);
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT);
......@@ -451,7 +449,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
nr_rate_matching_ldpc(Ilbrm,
Tbslbrm,
BG,
harq_process->BG,
*pz,
harq_process->d[r],
harq_process->e+r_offset,
......
......@@ -110,6 +110,8 @@ typedef struct {
uint32_t K;
/// Number of "Filler" bits
uint32_t F;
/// Encoder BG
uint8_t BG;
} NR_DL_gNB_HARQ_t;
typedef struct {
......
......@@ -1121,6 +1121,8 @@ typedef struct {
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
#endif
int dl_stats[5];
} PHY_VARS_NR_UE;
......
......@@ -93,7 +93,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
if (dlsch0_harq){
dlsch0_harq->status = ACTIVE;
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs;
......
......@@ -491,6 +491,8 @@ harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int
dl_harq->round++;
if (dl_harq->harq_ack.ack) dl_harq->status = SCH_IDLE;
result_harq = RETRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-DL-PDSCH harqId : %d] reception of a retransmission \n", harq_pid);
......
......@@ -1776,6 +1776,12 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
}
}
if ((frame_rx%64 == 0) && (nr_tti_rx==0)) {
printf("============================================\n");
LOG_I(PHY,"Harq round stats for Downlink: %d/%d/%d/%d DLSCH errors: %d\n",ue->dl_stats[0],ue->dl_stats[1],ue->dl_stats[2],ue->dl_stats[3],ue->dl_stats[4]);
printf("============================================\n");
}
#ifdef NR_PDCCH_SCHED
nr_gold_pdcch(ue, 0, 2);
......
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