Added encoding stats in ulsim
This commit is contained in:
@@ -1041,7 +1041,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
uint8_t is_crnti,
|
uint8_t is_crnti,
|
||||||
uint8_t llr8_flag);
|
uint8_t llr8_flag);
|
||||||
|
|
||||||
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||||
|
NR_UE_ULSCH_t *ulsch,
|
||||||
NR_DL_FRAME_PARMS* frame_parms,
|
NR_DL_FRAME_PARMS* frame_parms,
|
||||||
uint8_t harq_pid,
|
uint8_t harq_pid,
|
||||||
unsigned int G);
|
unsigned int G);
|
||||||
|
|||||||
@@ -215,11 +215,13 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||||
|
NR_UE_ULSCH_t *ulsch,
|
||||||
NR_DL_FRAME_PARMS* frame_parms,
|
NR_DL_FRAME_PARMS* frame_parms,
|
||||||
uint8_t harq_pid,
|
uint8_t harq_pid,
|
||||||
unsigned int G)
|
unsigned int G)
|
||||||
{
|
{
|
||||||
|
start_meas(&ue->ulsch_encoding_stats);
|
||||||
/////////////////////////parameters and variables declaration/////////////////////////
|
/////////////////////////parameters and variables declaration/////////////////////////
|
||||||
///////////
|
///////////
|
||||||
|
|
||||||
@@ -331,6 +333,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
|
||||||
|
start_meas(&ue->ulsch_segmentation_stats);
|
||||||
Kb=nr_segmentation(harq_process->b,
|
Kb=nr_segmentation(harq_process->b,
|
||||||
harq_process->c,
|
harq_process->c,
|
||||||
harq_process->B,
|
harq_process->B,
|
||||||
@@ -339,6 +342,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
pz,
|
pz,
|
||||||
&harq_process->F,
|
&harq_process->F,
|
||||||
harq_process->BG);
|
harq_process->BG);
|
||||||
|
stop_meas(&ue->ulsch_segmentation_stats);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
F = harq_process->F;
|
F = harq_process->F;
|
||||||
@@ -373,14 +377,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
//for (int i=0;i<68*384;i++)
|
//for (int i=0;i<68*384;i++)
|
||||||
// printf("channel_input[%d]=%d\n",i,channel_input[i]);
|
// printf("channel_input[%d]=%d\n",i,channel_input[i]);
|
||||||
|
|
||||||
int temp_opp = 0;
|
|
||||||
|
|
||||||
if (opp_enabled) {
|
|
||||||
opp_enabled = 0;
|
|
||||||
temp_opp = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*printf("output %d %d %d %d %d \n", harq_process->d[0][0], harq_process->d[0][1], harq_process->d[r][2],harq_process->d[0][3], harq_process->d[0][4]);
|
/*printf("output %d %d %d %d %d \n", harq_process->d[0][0], harq_process->d[0][1], harq_process->d[r][2],harq_process->d[0][3], harq_process->d[0][4]);
|
||||||
for (int cnt =0 ; cnt < 66*(*pz); cnt ++){
|
for (int cnt =0 ; cnt < 66*(*pz); cnt ++){
|
||||||
printf("%d \n", harq_process->d[0][cnt]);
|
printf("%d \n", harq_process->d[0][cnt]);
|
||||||
@@ -396,11 +392,13 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
|
||||||
|
|
||||||
|
start_meas(&ue->ulsch_ldpc_encoding_stats);
|
||||||
for(int j = 0; j < (harq_process->C/8 + 1); j++)
|
for(int j = 0; j < (harq_process->C/8 + 1); j++)
|
||||||
{
|
{
|
||||||
impp.macro_num = j;
|
impp.macro_num = j;
|
||||||
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp);
|
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp);
|
||||||
}
|
}
|
||||||
|
stop_meas(&ue->ulsch_ldpc_encoding_stats);
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
@@ -411,8 +409,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
write_output("ulsch_enc_output0.m","enc0",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,4);
|
write_output("ulsch_enc_output0.m","enc0",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,4);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (temp_opp) opp_enabled = 1;
|
|
||||||
|
|
||||||
///////////
|
///////////
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -447,6 +443,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->pusch_pdu.nrOfLayers);
|
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->pusch_pdu.nrOfLayers);
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
|
||||||
|
start_meas(&ue->ulsch_rate_matching_stats);
|
||||||
nr_rate_matching_ldpc(Ilbrm,
|
nr_rate_matching_ldpc(Ilbrm,
|
||||||
Tbslbrm,
|
Tbslbrm,
|
||||||
harq_process->BG,
|
harq_process->BG,
|
||||||
@@ -458,6 +455,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
Kr-F-2*(*pz),
|
Kr-F-2*(*pz),
|
||||||
harq_process->pusch_pdu.pusch_data.rv_index,
|
harq_process->pusch_pdu.pusch_data.rv_index,
|
||||||
E);
|
E);
|
||||||
|
stop_meas(&ue->ulsch_rate_matching_stats);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
|
|
||||||
@@ -479,10 +477,12 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
//start_meas(i_stats);
|
//start_meas(i_stats);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_IN);
|
||||||
|
|
||||||
|
start_meas(&ue->ulsch_interleaving_stats);
|
||||||
nr_interleaving_ldpc(E,
|
nr_interleaving_ldpc(E,
|
||||||
mod_order,
|
mod_order,
|
||||||
harq_process->e+r_offset,
|
harq_process->e+r_offset,
|
||||||
harq_process->f+r_offset);
|
harq_process->f+r_offset);
|
||||||
|
stop_meas(&ue->ulsch_interleaving_stats);
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_OUT);
|
||||||
//stop_meas(i_stats);
|
//stop_meas(i_stats);
|
||||||
@@ -507,5 +507,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
|
stop_meas(&ue->ulsch_encoding_stats);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
|||||||
nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
|
nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
|
||||||
|
|
||||||
|
|
||||||
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G);
|
nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G);
|
||||||
|
|
||||||
///////////
|
///////////
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ int main(int argc, char **argv)
|
|||||||
unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl);
|
unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl);
|
||||||
|
|
||||||
if (input_fd == NULL) {
|
if (input_fd == NULL) {
|
||||||
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G);
|
nr_ulsch_encoding(ue, ulsch_ue, frame_parms, harq_pid, G);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
@@ -906,6 +906,10 @@ int main(int argc, char **argv)
|
|||||||
reset_meas(&gNB->ulsch_llr_stats);
|
reset_meas(&gNB->ulsch_llr_stats);
|
||||||
reset_meas(&gNB->ulsch_channel_compensation_stats);
|
reset_meas(&gNB->ulsch_channel_compensation_stats);
|
||||||
reset_meas(&gNB->ulsch_rbs_extraction_stats);
|
reset_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||||
|
reset_meas(&UE->ulsch_ldpc_encoding_stats);
|
||||||
|
reset_meas(&UE->ulsch_rate_matching_stats);
|
||||||
|
reset_meas(&UE->ulsch_interleaving_stats);
|
||||||
|
reset_meas(&UE->ulsch_encoding_stats);
|
||||||
|
|
||||||
clear_pusch_stats(gNB);
|
clear_pusch_stats(gNB);
|
||||||
for (trial = 0; trial < n_trials; trial++) {
|
for (trial = 0; trial < n_trials; trial++) {
|
||||||
@@ -914,6 +918,7 @@ int main(int argc, char **argv)
|
|||||||
crc_status = 1;
|
crc_status = 1;
|
||||||
errors_decoding = 0;
|
errors_decoding = 0;
|
||||||
memset((void*)roundStats,0,50*sizeof(roundStats[0]));
|
memset((void*)roundStats,0,50*sizeof(roundStats[0]));
|
||||||
|
ulsch_ue[0]->harq_processes[harq_pid]->ndi = 1;
|
||||||
while (round<max_rounds && crc_status) {
|
while (round<max_rounds && crc_status) {
|
||||||
round_trials[round]++;
|
round_trials[round]++;
|
||||||
ulsch_ue[0]->harq_processes[harq_pid]->round = round;
|
ulsch_ue[0]->harq_processes[harq_pid]->round = round;
|
||||||
@@ -1278,6 +1283,11 @@ int main(int argc, char **argv)
|
|||||||
printStatIndent2(&gNB->ulsch_llr_stats,"ULSCH llr computation");
|
printStatIndent2(&gNB->ulsch_llr_stats,"ULSCH llr computation");
|
||||||
printStatIndent(&gNB->ulsch_unscrambling_stats,"ULSCH unscrambling");
|
printStatIndent(&gNB->ulsch_unscrambling_stats,"ULSCH unscrambling");
|
||||||
printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time");
|
printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time");
|
||||||
|
printStatIndent(&UE->ulsch_encoding_stats,"ULSCH total encoding time");
|
||||||
|
printStatIndent2(&UE->ulsch_segmentation_stats,"ULSCH segmentation time");
|
||||||
|
printStatIndent2(&UE->ulsch_ldpc_encoding_stats,"ULSCH LDPC encoder time");
|
||||||
|
printStatIndent2(&UE->ulsch_rate_matching_stats,"ULSCH rate-matching time");
|
||||||
|
printStatIndent2(&UE->ulsch_interleaving_stats,"ULSCH interleaving time");
|
||||||
//printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving");
|
//printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving");
|
||||||
//printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx");
|
//printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx");
|
||||||
//printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding");
|
//printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding");
|
||||||
|
|||||||
Reference in New Issue
Block a user