diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index b586a294000ea76d0f8804f23034fabb47a0c3dc..74699bce4540fc103aa2374fae4bc3d38d1a4c9f 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -48,6 +48,7 @@ #include "defs.h" #include "extern.h" #include "SIMULATION/ETH_TRANSPORT/extern.h" +#include "UTIL/LOG/vcd_signal_dumper.h" //#define DEBUG_ULSCH_CODING //#define DEBUG_ULSCH_FREE 1 @@ -209,6 +210,7 @@ u32 ulsch_encoding(u8 *a, LTE_UE_DLSCH_t **dlsch = phy_vars_ue->dlsch_ue[eNB_id]; double sinr_eff; u16 rnti; + if (!ulsch) { LOG_E(PHY,"Null ulsch ptr %p\n",ulsch); return(-1); @@ -231,9 +233,14 @@ u32 ulsch_encoding(u8 *a, return(-1); } + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_IN); + // fill CQI/PMI information if (ulsch->O>0) { - sinr_eff = sinr_eff_cqi_calc(phy_vars_ue, 0); //eNB_id is missing here + if (flag_LA==1) + sinr_eff = sinr_eff_cqi_calc(phy_vars_ue, 0); //eNB_id is missing here + else + sinr_eff = 0; rnti = phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti; fill_CQI(ulsch->o,ulsch->uci_format,meas,0,rnti, tmode,sinr_eff); @@ -336,6 +343,7 @@ u32 ulsch_encoding(u8 *a, iind = 123 + ((Kr_bytes-256)>>3); else { LOG_E(PHY,"ulsch_coding: Illegal codeword size %d!!!\n",Kr_bytes); + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } @@ -381,6 +389,7 @@ u32 ulsch_encoding(u8 *a, if (ulsch->harq_processes[harq_pid]->C == 0) { LOG_E(PHY,"null segment\n"); + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } @@ -460,7 +469,7 @@ u32 ulsch_encoding(u8 *a, if ((int)G < 0) { LOG_E(PHY,"FATAL: ulsch_coding.c G < 0 (%d) : Q_RI %d, Q_CQI %d, O %d, betaCQI_times8 %d)\n",G,Q_RI,Q_CQI,ulsch->O,ulsch->beta_offset_cqi_times8); - + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } @@ -516,6 +525,7 @@ u32 ulsch_encoding(u8 *a, // Do CQI coding if ((ulsch->O>1) && (ulsch->O < 12)) { LOG_E(PHY,"short CQI sizes not supported yet\n"); + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } else { @@ -574,6 +584,7 @@ u32 ulsch_encoding(u8 *a, } else if (ulsch->O_RI>1){ LOG_E(PHY,"RI cannot be more than 1 bit yet\n"); + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } // Do ACK coding, Section 5.2.2.6 36.213 (p.23-24 in v8.6) @@ -664,6 +675,7 @@ u32 ulsch_encoding(u8 *a, } if (ulsch->harq_processes[harq_pid]->O_ACK > 2) { LOG_E(PHY,"ACK cannot be more than 2 bits yet\n"); + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } @@ -837,9 +849,11 @@ u32 ulsch_encoding(u8 *a, if (j!=(H+Q_RI)) { LOG_E(PHY,"Error in output buffer length (j %d, H+Q_RI %d)\n",j,H+Q_RI); + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(-1); } + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); return(0); } diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c index ff6409a09af3a17d591930f8cac2ff7edc912ae0..fb830d3ac049c76a3ad39ba13e57174ad745dca2 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c @@ -43,6 +43,7 @@ #include "PHY/CODING/extern.h" #include "PHY/LTE_TRANSPORT/defs.h" #include "defs.h" +#include "UTIL/LOG/vcd_signal_dumper.h" //#define OFDMA_ULSCH @@ -294,6 +295,8 @@ void ulsch_modulation(mod_sym_t **txdataF, return; } + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, VCD_FUNCTION_IN); + Q_m = get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs); G = (int)ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch); @@ -629,6 +632,7 @@ void ulsch_modulation(mod_sym_t **txdataF, } } #endif + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, VCD_FUNCTION_OUT); } diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index edab9abe700a26f5155d5794a7c2b212c1f9485c..b23b6757181a26550d1edc9ab024c052b9c8e502 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -970,6 +970,7 @@ void ue_get_sdu(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index,u8 *ulsch_buffer,u //if (UE_mac_inst[Mod_id].scheduling_info.LCID_status[DTCH] == LCID_EMPTY) if (use_cba_access(Mod_id,frame,subframe,eNB_index)==0){ *access_mode=POSTPONED_ACCESS; + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT); return; } LOG_D(MAC,"[UE %d] frame %d subframe %d CBA transmission oppurtunity, tbs %d\n", Mod_id, frame, subframe,buflen); @@ -1132,6 +1133,7 @@ void ue_get_sdu(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index,u8 *ulsch_buffer,u if ((buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total) == buflen) { *access_mode=CANCELED_ACCESS; + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT); return; } else if ((buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total) <= 2) { short_padding = buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total; diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 3b25187b50f3e32c406021b18e4a1bef2f2b6e35..23bf82cd6d8d7e9c5c372df16f519e04c2a07581 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -146,6 +146,8 @@ const char* eurecomFunctionsNames[] = { "phy_ue_config_sib2", "phy_ue_compute_prach", "phy_enb_ulsch_decoding", + "phy_ue_ulsch_modulation", + "phy_ue_ulsch_encoding", "test" }; diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 557ce5a3ac6ca3d620b06296bd8575a0cce8e171..09d8b31f20193fe3047bdb79b41377b5f9fd22f7 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -117,7 +117,9 @@ typedef enum VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_CONFIG_SIB2, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, - VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, + VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_SIGNAL_DUMPER_FUNCTIONS_TEST, VCD_SIGNAL_DUMPER_FUNCTIONS_LAST, VCD_SIGNAL_DUMPER_FUNCTIONS_END = VCD_SIGNAL_DUMPER_FUNCTIONS_LAST,