Commit cfa37e72 authored by francescomani's avatar francescomani

cosmetic changes

parent 2162ba6d
......@@ -478,17 +478,14 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
int off = 0;
#endif
for (aatx = 0; aatx < nrOfLayers; aatx++)
{
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++)
{
for (aatx = 0; aatx < nrOfLayers; aatx++) {
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
//clear average level
avg128U = _mm_setzero_si128();
ul_ch128=(__m128i *)&ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
for (rb = 0; rb < nb_rb_0; rb++)
{
for (rb = 0; rb < nb_rb_0; rb++) {
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[0], ul_ch128[0]), x));
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[1], ul_ch128[1]), x));
avg128U = _mm_add_epi32(avg128U, _mm_srai_epi32(_mm_madd_epi16(ul_ch128[2], ul_ch128[2]), x));
......@@ -499,7 +496,6 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
((int32_t*)&avg128U)[1] +
((int32_t*)&avg128U)[2] +
((int32_t*)&avg128U)[3]) / y;
}
}
......@@ -637,23 +633,19 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
QAM_amp128b = _mm_setzero_si128();
uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
for (aatx=0; aatx<nrOfLayers; aatx++)
{
if (mod_order == 4)
{
for (aatx=0; aatx<nrOfLayers; aatx++) {
if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = _mm_setzero_si128();
}
else if (mod_order == 6)
{
else if (mod_order == 6) {
QAM_amp128 = _mm_set1_epi16(QAM64_n1); //
QAM_amp128b = _mm_set1_epi16(QAM64_n2);
}
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
{
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
ul_ch_mag128 = (__m128i *)&ul_ch_mag[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
ul_ch_mag128b = (__m128i *)&ul_ch_magb[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
......@@ -661,10 +653,8 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aatx*frame_parms->nb_antennas_rx+aarx][symbol*(off+(nb_rb*12))];
for (rb=0; rb<nb_rb_0; rb++)
{
if (mod_order>2)
{
for (rb=0; rb<nb_rb_0; rb++) {
if (mod_order>2) {
// get channel amplitude if not QPSK
//print_shorts("ch:",(int16_t*)&ul_ch128[0]);
......@@ -1164,8 +1154,7 @@ void nr_ulsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
int off = 0;
#endif
if (n_rx > 1)
{
if (n_rx > 1) {
#if defined(__x86_64__) || defined(__i386__)
for (int aatx=0; aatx<nrOfLayers; aatx++) {
int nb_re = nb_rb*12;
......@@ -1174,15 +1163,13 @@ void nr_ulsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
ul_ch_mag128[0] = (__m128i *)&ul_ch_mag[aatx*frame_parms->nb_antennas_rx][(symbol*(nb_re + off))];
ul_ch_mag128b[0] = (__m128i *)&ul_ch_magb[aatx*frame_parms->nb_antennas_rx][(symbol*(nb_re + off))];
for (int aa=1;aa < n_rx;aa++)
{
for (int aa=1;aa < n_rx;aa++) {
rxdataF_comp128[1] = (__m128i *)&rxdataF_comp[aatx*frame_parms->nb_antennas_rx+aa][(symbol*(nb_re + off))];
ul_ch_mag128[1] = (__m128i *)&ul_ch_mag[aatx*frame_parms->nb_antennas_rx+aa][(symbol*(nb_re + off))];
ul_ch_mag128b[1] = (__m128i *)&ul_ch_magb[aatx*frame_parms->nb_antennas_rx+aa][(symbol*(nb_re + off))];
// MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
for (i=0; i<nb_rb_0*3; i++)
{
for (i=0; i<nb_rb_0*3; i++) {
rxdataF_comp128[0][i] = _mm_adds_epi16(rxdataF_comp128[0][i],rxdataF_comp128[1][i]);
ul_ch_mag128[0][i] = _mm_adds_epi16(ul_ch_mag128[0][i],ul_ch_mag128[1][i]);
ul_ch_mag128b[0][i] = _mm_adds_epi16(ul_ch_mag128b[0][i],ul_ch_mag128b[1][i]);
......@@ -1933,18 +1920,15 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
//--------------------- Channel estimation ---------------------
//----------------------------------------------------------
start_meas(&gNB->ulsch_channel_estimation_stats);
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++)
{
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
LOG_D(PHY, "symbol %d, dmrs_symbol_flag :%d\n", symbol, dmrs_symbol_flag);
if (dmrs_symbol_flag == 1)
{
if (dmrs_symbol_flag == 1) {
if (gNB->pusch_vars[ulsch_id]->dmrs_symbol == INVALID_VALUE)
gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
for (int nl=0; nl<rel15_ul->nrOfLayers; nl++)
{
for (int nl=0; nl<rel15_ul->nrOfLayers; nl++) {
nr_pusch_channel_estimation(gNB,
slot,
......@@ -1984,29 +1968,24 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
#endif
uint32_t rxdataF_ext_offset = 0;
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++)
{
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
if (dmrs_symbol_flag == 1)
{
if (dmrs_symbol_flag == 1) {
if ((rel15_ul->ul_dmrs_symb_pos >> ((symbol + 1) % frame_parms->symbols_per_slot)) & 0x01)
AssertFatal(1==0,"Double DMRS configuration is not yet supported\n");
gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
if (rel15_ul->dmrs_config_type == 0)
{
if (rel15_ul->dmrs_config_type == 0) {
// if no data in dmrs cdm group is 1 only even REs have no data
// if no data in dmrs cdm group is 2 both odd and even REs have no data
nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*6));
}
else
{
else {
nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*4));
}
}
else
{
else {
nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
}
......@@ -2016,8 +1995,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
//----------------------------------------------------------
//--------------------- RBs extraction ---------------------
//----------------------------------------------------------
if (nb_re_pusch > 0)
{
if (nb_re_pusch > 0) {
start_meas(&gNB->ulsch_rbs_extraction_stats);
nr_ulsch_extract_rbs(gNB->common_vars.rxdataF,
gNB->pusch_vars[ulsch_id],
......@@ -2104,8 +2082,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
nb_re_pusch);
stop_meas(&gNB->ulsch_mrc_stats);
if (rel15_ul->transformPrecoder == transformPrecoder_enabled)
{
if (rel15_ul->transformPrecoder == transformPrecoder_enabled) {
#ifdef __AVX2__
// For odd number of resource blocks need byte alignment to multiple of 8
int nb_re_pusch2 = nb_re_pusch + (nb_re_pusch&7);
......@@ -2123,8 +2100,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
//----------------------------------------------------------
/* In case PTRS is enabled then LLR will be calculated after PTRS symbols are processed *
* otherwise LLR are calculated for each symbol based upon DMRS channel estimates only. */
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS)
{
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
start_meas(&gNB->ulsch_ptrs_processing_stats);
nr_pusch_ptrs_processing(gNB,
frame_parms,
......@@ -2143,8 +2119,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
/*-------------------- LLRs computation -------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------------------*/
start_meas(&gNB->ulsch_llr_stats);
for (aatx=0; aatx < rel15_ul->nrOfLayers; aatx++)
{
for (aatx=0; aatx < rel15_ul->nrOfLayers; aatx++) {
nr_ulsch_compute_llr(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aatx*frame_parms->nb_antennas_rx][symbol * (off + rel15_ul->rb_size * NR_NB_SC_PER_RB)],
gNB->pusch_vars[ulsch_id]->ul_ch_mag0[aatx*frame_parms->nb_antennas_rx],
gNB->pusch_vars[ulsch_id]->ul_ch_magb0[aatx*frame_parms->nb_antennas_rx],
......
......@@ -285,9 +285,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
for(int i=0; i< ue->frame_parms.nb_antennas_tx; ++i)
{
memset(ue->common_vars.txdataF[i], 0, sizeof(int)*14*ue->frame_parms.ofdm_symbol_size);
}
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
......
......@@ -444,9 +444,7 @@ int main(int argc, char **argv)
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0];
if ((Nl==4)||(Nl==3))
{
nb_re_dmrs = nb_re_dmrs*2;
}
mod_order = nr_get_Qm_ul(Imcs, 0);
code_rate = nr_get_code_rate_ul(Imcs, 0);
......
......@@ -1359,8 +1359,7 @@ int main(int argc, char **argv)
LOG_M("rxsigF0_llrlayers0.m","rxsF0_llrlayers0",
&gNB->pusch_vars[0]->llr_layers[0][0],(nb_symb_sch-1)*NR_NB_SC_PER_RB * pusch_pdu->rb_size * mod_order,1,0);
if (precod_nbr_layers==2)
{
if (precod_nbr_layers==2) {
LOG_M("rxsigF1_ext.m","rxsF1_ext",
&gNB->pusch_vars[0]->rxdataF_ext[1][start_symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
......@@ -1379,8 +1378,7 @@ int main(int argc, char **argv)
}
if (precod_nbr_layers==4)
{
if (precod_nbr_layers==4) {
LOG_M("rxsigF1_ext.m","rxsF1_ext",
&gNB->pusch_vars[0]->rxdataF_ext[1][start_symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size],nb_symb_sch*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
LOG_M("rxsigF2_ext.m","rxsF2_ext",
......
......@@ -231,8 +231,7 @@ void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_con
if (n_antenna_port == 1); // 1 antenna port and the higher layer parameter txConfig = codebook 0 bits
if (n_antenna_port == 4)
{ // 4 antenna port and the higher layer parameter txConfig = codebook
if (n_antenna_port == 4) { // 4 antenna port and the higher layer parameter txConfig = codebook
// Table 7.3.1.1.2-2: transformPrecoder=disabled and maxRank = 2 or 3 or 4
if ((transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled)
......@@ -259,8 +258,7 @@ void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_con
// Table 7.3.1.1.2-3: transformPrecoder= enabled, or transformPrecoder=disabled and maxRank = 1
if (((transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled)
|| (transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled))
&& (*pusch_Config->maxRank == 1))
{
&& (*pusch_Config->maxRank == 1)) {
if (*pusch_Config->codebookSubset == NR_PUSCH_Config__codebookSubset_fullyAndPartialAndNonCoherent) {
pusch_config_pdu->nrOfLayers = table_7_3_1_1_2_2_3_4_5[dci->precoding_information.val][6];
......@@ -279,11 +277,10 @@ void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_con
}
}
if (n_antenna_port == 2)
{ // 2 antenna port and the higher layer parameter txConfig = codebook
if (n_antenna_port == 2) {
// 2 antenna port and the higher layer parameter txConfig = codebook
// Table 7.3.1.1.2-4: transformPrecoder=disabled and maxRank = 2
if ((transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled) && (*pusch_Config->maxRank == 2))
{
if ((transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled) && (*pusch_Config->maxRank == 2)) {
if (*pusch_Config->codebookSubset == NR_PUSCH_Config__codebookSubset_fullyAndPartialAndNonCoherent) {
pusch_config_pdu->nrOfLayers = table_7_3_1_1_2_2_3_4_5[dci->precoding_information.val][12];
pusch_config_pdu->Tpmi = table_7_3_1_1_2_2_3_4_5[dci->precoding_information.val][13];
......@@ -299,8 +296,7 @@ void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_con
// Table 7.3.1.1.2-5: transformPrecoder= enabled, or transformPrecoder= disabled and maxRank = 1
if (((transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled)
|| (transformPrecoder == NR_PUSCH_Config__transformPrecoder_disabled))
&& (*pusch_Config->maxRank == 1))
{
&& (*pusch_Config->maxRank == 1)) {
if (*pusch_Config->codebookSubset == NR_PUSCH_Config__codebookSubset_fullyAndPartialAndNonCoherent) {
pusch_config_pdu->nrOfLayers = table_7_3_1_1_2_2_3_4_5[dci->precoding_information.val][16];
......
......@@ -459,9 +459,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
const int dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0;
uint8_t num_dmrs_cdm_grps_no_data = 1;
if ((target_ul_Nl==4)||(target_ul_Nl==3))
{
num_dmrs_cdm_grps_no_data = 2;
}
/* we want to avoid a lengthy deduction of DMRS and other parameters in
* every TTI if we can save it, so check whether dci_format, TDA, or
......
......@@ -1011,13 +1011,9 @@ void config_uldci(const NR_SIB1_t *sib1,
}
dci_pdu_rel15->precoding_information.val= 0;
if (pusch_pdu->nrOfLayers == 2)
{
dci_pdu_rel15->precoding_information.val = 4;
}
else if (pusch_pdu->nrOfLayers == 4)
{
dci_pdu_rel15->precoding_information.val = 11;
}
// antenna_ports.val = 0 for transform precoder is disabled, dmrs-Type=1, maxLength=1, Rank=1/2/3/4
// Antenna Ports
......
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