Commit 9dabdde3 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/test' into integration_2024_w28

parents 0753615c 83c59b05
...@@ -452,7 +452,7 @@ int nr_rate_matching_ldpc(uint32_t Tbslbrm, ...@@ -452,7 +452,7 @@ int nr_rate_matching_ldpc(uint32_t Tbslbrm,
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z; ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("nr_rate_matching_ldpc: E %u, F %u, Foffset %u, k0 %u, Ncb %u, rvidx %d, Tbslbrm %u\n", E, F, Foffset,ind, Ncb, rvidx, Tbslbrm); printf("nr_rate_matching_ldpc: E %u, F %u, Foffset %u, k0 %u, Ncb %u, rvidx %d, Tbslbrm %u\n", E, F, Foffset, ind, Ncb, rvidx, Tbslbrm);
#endif #endif
if (Foffset > E) { if (Foffset > E) {
...@@ -548,7 +548,7 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm, ...@@ -548,7 +548,7 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
} }
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("nr_rate_matching_ldpc_rx: Clear %d, E %u, k0 %u, Ncb %u, rvidx %d, Tbslbrm %u\n", clear, E, ind, Ncb, rvidx, Tbslbrm); printf("nr_rate_matching_ldpc_rx: Clear %d, E %u, Foffset %u, k0 %u, Ncb %u, rvidx %d, Tbslbrm %u\n", clear, E, Foffset, ind, Ncb, rvidx, Tbslbrm);
#endif #endif
if (clear == 1) if (clear == 1)
......
...@@ -308,10 +308,10 @@ int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, ...@@ -308,10 +308,10 @@ int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter,
/* return the total number of dmrs symbol in a slot */ /* return the total number of dmrs symbol in a slot */
uint8_t get_dmrs_symbols_in_slot(uint16_t l_prime_mask, uint16_t nb_symb) uint8_t get_dmrs_symbols_in_slot(uint16_t l_prime_mask, uint16_t nb_symb, uint8_t start)
{ {
uint8_t tmp = 0; uint8_t tmp = 0;
for (int i = 0; i < nb_symb; i++) { for (int i = start; i < start + nb_symb; i++) {
tmp += (l_prime_mask >> i) & 0x01; tmp += (l_prime_mask >> i) & 0x01;
} }
return tmp; return tmp;
...@@ -351,7 +351,7 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms, ...@@ -351,7 +351,7 @@ void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms,
simde__m128i *ul_ch128_1; simde__m128i *ul_ch128_1;
int16_t *ul_ch16_0; int16_t *ul_ch16_0;
int total_symbols = start_symbol + num_symbols; int total_symbols = start_symbol + num_symbols;
int num_dmrs_symb = get_dmrs_symbols_in_slot(dmrs_bitmap, total_symbols); int num_dmrs_symb = get_dmrs_symbols_in_slot(dmrs_bitmap, total_symbols, start_symbol);
int first_dmrs_symb = get_next_dmrs_symbol_in_slot(dmrs_bitmap, start_symbol, total_symbols); int first_dmrs_symb = get_next_dmrs_symbol_in_slot(dmrs_bitmap, start_symbol, total_symbols);
AssertFatal(first_dmrs_symb > -1, "No DMRS symbol present in this slot\n"); AssertFatal(first_dmrs_symb > -1, "No DMRS symbol present in this slot\n");
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
......
...@@ -63,7 +63,7 @@ uint8_t allowed_xlsch_re_in_dmrs_symbol(uint16_t k, ...@@ -63,7 +63,7 @@ uint8_t allowed_xlsch_re_in_dmrs_symbol(uint16_t k,
void nr_gen_ref_conj_symbols(uint32_t *in, uint32_t length, int16_t *output, uint16_t offset, int mod_order); void nr_gen_ref_conj_symbols(uint32_t *in, uint32_t length, int16_t *output, uint16_t offset, int mod_order);
int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol); int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol);
uint8_t get_dmrs_symbols_in_slot(uint16_t l_prime_mask, uint16_t nb_symb); uint8_t get_dmrs_symbols_in_slot(uint16_t l_prime_mask, uint16_t nb_symb, uint8_t start);
int8_t get_valid_dmrs_idx_for_channel_est(uint16_t dmrs_symb_pos, uint8_t counter); int8_t get_valid_dmrs_idx_for_channel_est(uint16_t dmrs_symb_pos, uint8_t counter);
void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms, void nr_chest_time_domain_avg(NR_DL_FRAME_PARMS *frame_parms,
int32_t **ch_estimates, int32_t **ch_estimates,
......
...@@ -32,16 +32,14 @@ void nr_codeword_scrambling(uint8_t *in, ...@@ -32,16 +32,14 @@ void nr_codeword_scrambling(uint8_t *in,
uint32_t* out) uint32_t* out)
{ {
uint32_t x1; uint32_t x1;
uint32_t x2 = (n_RNTI<<15) + (q<<14) + Nid; uint32_t x2 = (n_RNTI << 15) + (q << 14) + Nid;
uint32_t s = 0; uint32_t s = lte_gold_generic(&x1, &x2, 1);
for (int i = 0; i < ((size >> 5) + ((size & 0x1f) > 0 ? 1 : 0)); i++) {
s=lte_gold_generic(&x1, &x2, 1);
for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) {
simde__m256i c = ((simde__m256i*)in)[i]; simde__m256i c = ((simde__m256i*)in)[i];
uint32_t in32 = simde_mm256_movemask_epi8(simde_mm256_slli_epi16(c,7)); uint32_t in32 = simde_mm256_movemask_epi8(simde_mm256_slli_epi16(c, 7));
out[i]=(in32^s); out[i] = (in32 ^ s);
DEBUG_SCRAMBLING(LOG_D(PHY, "in[%d] %x => %x\n", i, in32, out[i])); DEBUG_SCRAMBLING(LOG_D(PHY, "in[%d] %x => %x\n", i, in32, out[i]));
s=lte_gold_generic(&x1, &x2, 0); s = lte_gold_generic(&x1, &x2, 0);
} }
} }
......
...@@ -775,8 +775,7 @@ int main(int argc, char *argv[]) ...@@ -775,8 +775,7 @@ int main(int argc, char *argv[])
uint8_t length_dmrs = pusch_len1; uint8_t length_dmrs = pusch_len1;
uint16_t l_prime_mask = get_l_prime(nb_symb_sch, mapping_type, add_pos, length_dmrs, start_symbol, NR_MIB__dmrs_TypeA_Position_pos2); uint16_t l_prime_mask = get_l_prime(nb_symb_sch, mapping_type, add_pos, length_dmrs, start_symbol, NR_MIB__dmrs_TypeA_Position_pos2);
uint16_t number_dmrs_symbols = get_dmrs_symbols_in_slot(l_prime_mask, nb_symb_sch); uint16_t number_dmrs_symbols = get_dmrs_symbols_in_slot(l_prime_mask, nb_symb_sch, start_symbol);
printf("num dmrs sym %d\n",number_dmrs_symbols);
uint8_t nb_re_dmrs = (dmrs_config_type == pusch_dmrs_type1) ? 6 : 4; uint8_t nb_re_dmrs = (dmrs_config_type == pusch_dmrs_type1) ? 6 : 4;
uint32_t tbslbrm = 0; uint32_t tbslbrm = 0;
...@@ -804,8 +803,18 @@ int main(int argc, char *argv[]) ...@@ -804,8 +803,18 @@ int main(int argc, char *argv[])
nb_re_dmrs = nb_re_dmrs * num_dmrs_cdm_grps_no_data; nb_re_dmrs = nb_re_dmrs * num_dmrs_cdm_grps_no_data;
unsigned int TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers); unsigned int TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers);
printf("[ULSIM]: length_dmrs: %u, l_prime_mask: %u number_dmrs_symbols: %u, mapping_type: %u add_pos: %d \n", length_dmrs, l_prime_mask, number_dmrs_symbols, mapping_type, add_pos); printf("[ULSIM]: length_dmrs: %u, l_prime_mask: %u number_dmrs_symbols: %u, mapping_type: %u add_pos: %d \n",
printf("[ULSIM]: CDM groups: %u, dmrs_config_type: %d, num_rbs: %u, nb_symb_sch: %u\n", num_dmrs_cdm_grps_no_data, dmrs_config_type, nb_rb, nb_symb_sch); length_dmrs,
l_prime_mask,
number_dmrs_symbols,
mapping_type,
add_pos);
printf("[ULSIM]: CDM groups: %u, dmrs_config_type: %d, num_rbs: %u, nb_symb_sch: %u, start_symbol %u\n",
num_dmrs_cdm_grps_no_data,
dmrs_config_type,
nb_rb,
nb_symb_sch,
start_symbol);
printf("[ULSIM]: MCS: %d, mod order: %u, code_rate: %u\n", Imcs, mod_order, code_rate); printf("[ULSIM]: MCS: %d, mod order: %u, code_rate: %u\n", Imcs, mod_order, code_rate);
uint8_t ulsch_input_buffer[TBS/8]; uint8_t ulsch_input_buffer[TBS/8];
......
...@@ -50,8 +50,14 @@ uint32_t nr_compute_tbs(uint16_t Qm, ...@@ -50,8 +50,14 @@ uint32_t nr_compute_tbs(uint16_t Qm,
uint8_t tb_scaling, uint8_t tb_scaling,
uint8_t Nl) uint8_t Nl)
{ {
LOG_D(NR_MAC,
LOG_D(NR_MAC, "In %s: nb_symb_sch %d, nb_dmrs_prb %d, nb_rb %d, nb_rb_oh %d, tb_scaling %d Nl %d\n", __FUNCTION__, nb_symb_sch, nb_dmrs_prb, nb_rb, nb_rb_oh, tb_scaling, Nl); "nb_symb_sch %d, nb_dmrs_prb %d, nb_rb %d, nb_rb_oh %d, tb_scaling %d Nl %d\n",
nb_symb_sch,
nb_dmrs_prb,
nb_rb,
nb_rb_oh,
tb_scaling,
Nl);
const int nb_subcarrier_per_rb = 12; const int nb_subcarrier_per_rb = 12;
const uint32_t nbp_re = nb_subcarrier_per_rb * nb_symb_sch - nb_dmrs_prb - nb_rb_oh; const uint32_t nbp_re = nb_subcarrier_per_rb * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
...@@ -91,10 +97,9 @@ uint32_t nr_compute_tbs(uint16_t Qm, ...@@ -91,10 +97,9 @@ uint32_t nr_compute_tbs(uint16_t Qm,
} }
} }
LOG_D(NR_MAC, "In %s: Ninfo %u nbp_re %d nb_re %d Qm %d, R %d, tbs %d bits\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs); LOG_D(NR_MAC, "Ninfo %u nbp_re %d nb_re %d Qm %d, R %d, tbs %d bits\n", Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
return nr_tbs; return nr_tbs;
} }
//tbslbrm calculation according to 5.4.2.1 of 38.212 //tbslbrm calculation according to 5.4.2.1 of 38.212
......
...@@ -2473,25 +2473,26 @@ uint8_t getAntPortBitWidth(NR_SetupRelease_DMRS_DownlinkConfig_t *typeA, NR_Setu ...@@ -2473,25 +2473,26 @@ uint8_t getAntPortBitWidth(NR_SetupRelease_DMRS_DownlinkConfig_t *typeA, NR_Setu
* *
*********************************************************************/ *********************************************************************/
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position) { uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position)
{
return ((mapping_type==typeA)?dmrs_typeA_position:0); return ((mapping_type==typeA)?dmrs_typeA_position:0);
} }
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength, uint8_t start_symbol, uint8_t dmrs_typeA_position) { int32_t get_l_prime(uint8_t duration_in_symbols,
uint8_t mapping_type,
uint8_t row, colomn; pusch_dmrs_AdditionalPosition_t additional_pos,
int32_t l_prime; pusch_maxLength_t pusch_maxLength,
uint8_t start_symbol,
LOG_D(NR_MAC, "In %s: PUSCH NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d additional_pos:%d, pusch_maxLength:%d\n", uint8_t dmrs_typeA_position)
__FUNCTION__, {
duration_in_symbols, LOG_D(NR_MAC,
start_symbol, "PUSCH NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d additional_pos:%d, pusch_maxLength:%d\n",
mapping_type, duration_in_symbols,
dmrs_typeA_position, start_symbol,
additional_pos, mapping_type,
pusch_maxLength); dmrs_typeA_position,
additional_pos,
pusch_maxLength);
// Section 6.4.1.1.3 in Spec 38.211 // Section 6.4.1.1.3 in Spec 38.211
// For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources // For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources
...@@ -2499,16 +2500,18 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr ...@@ -2499,16 +2500,18 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
uint8_t ld = (mapping_type == typeA) ? (duration_in_symbols + start_symbol) : duration_in_symbols; uint8_t ld = (mapping_type == typeA) ? (duration_in_symbols + start_symbol) : duration_in_symbols;
uint8_t l0 = (dmrs_typeA_position == NR_MIB__dmrs_TypeA_Position_pos2) ? 2 : 3 ; uint8_t l0 = (dmrs_typeA_position == NR_MIB__dmrs_TypeA_Position_pos2) ? 2 : 3 ;
colomn = additional_pos; uint8_t colomn = additional_pos;
if (mapping_type == typeB) if (mapping_type == typeB)
colomn += 4; colomn += 4;
uint8_t row;
if (ld < 4) if (ld < 4)
row = 0; row = 0;
else else
row = ld - 3; row = ld - 3;
uint32_t l_prime;
if (pusch_maxLength == pusch_len1) { if (pusch_maxLength == pusch_len1) {
l_prime = table_6_4_1_1_3_3_pusch_dmrs_positions_l[row][colomn]; l_prime = table_6_4_1_1_3_3_pusch_dmrs_positions_l[row][colomn];
l0 = 1 << l0; l0 = 1 << l0;
...@@ -2525,7 +2528,6 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr ...@@ -2525,7 +2528,6 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
LOG_D(MAC, " PUSCH DMRS MASK in HEX:%x\n", l_prime); LOG_D(MAC, " PUSCH DMRS MASK in HEX:%x\n", l_prime);
return l_prime; return l_prime;
} }
/******************************************************************* /*******************************************************************
......
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