mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-19 07:30:31 +00:00
Merge branch 'episys/master-sl' into episys/ea/precoding_re_mapping
This commit is contained in:
@@ -400,35 +400,35 @@ int nr_rate_matching_ldpc(uint32_t Tbslbrm,
|
||||
uint32_t E,
|
||||
bool is_sl)
|
||||
{
|
||||
uint32_t Ncb, ind, k = 0, Nref, N;
|
||||
uint32_t Ncb,ind,k=0,Nref,N;
|
||||
|
||||
if (C == 0) {
|
||||
LOG_E(NR_PHY, "nr_rate_matching: invalid parameters (C %d\n", C);
|
||||
if (C==0) {
|
||||
LOG_E(PHY,"nr_rate_matching: invalid parameters (C %d\n",C);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//Bit selection
|
||||
N = (BG == 1) ? (66 * Z) : (50 * Z);
|
||||
N = (BG==1)?(66*Z):(50*Z);
|
||||
|
||||
if ((Tbslbrm == 0) || is_sl)
|
||||
Ncb = N;
|
||||
else {
|
||||
Nref = 3 * Tbslbrm / (2 * C); //R_LBRM = 2 / 3
|
||||
Nref = 3*Tbslbrm/(2*C); //R_LBRM = 2/3
|
||||
Ncb = min(N, Nref);
|
||||
}
|
||||
|
||||
ind = (index_k0[BG - 1][rvidx] * Ncb / N) * Z;
|
||||
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n", E, F, Foffset,ind, Ncb, rvidx, Tbslbrm);
|
||||
#endif
|
||||
|
||||
if (Foffset > E) {
|
||||
LOG_E(NR_PHY, "nr_rate_matching: invalid parameters (Foffset %d > E %d) F %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n",Foffset,E,F, ind, Ncb, rvidx, Tbslbrm);
|
||||
LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d) F %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n",Foffset,E,F, ind, Ncb, rvidx, Tbslbrm);
|
||||
return -1;
|
||||
}
|
||||
if (Foffset > Ncb) {
|
||||
LOG_E(NR_PHY, "nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n",Foffset,Ncb);
|
||||
LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n",Foffset,Ncb);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -485,34 +485,34 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
uint32_t Foffset,
|
||||
bool is_sl)
|
||||
{
|
||||
uint32_t Ncb, ind, k, Nref, N;
|
||||
uint32_t Ncb,ind,k,Nref,N;
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
int nulled = 0;
|
||||
int nulled=0;
|
||||
#endif
|
||||
|
||||
if (C == 0) {
|
||||
LOG_E(NR_PHY, "nr_rate_matching: invalid parameters (C %d\n", C);
|
||||
if (C==0) {
|
||||
LOG_E(PHY,"nr_rate_matching: invalid parameters (C %d\n",C);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//Bit selection
|
||||
N = (BG == 1)? (66 * Z): (50 * Z);
|
||||
N = (BG==1)?(66*Z):(50*Z);
|
||||
|
||||
if ((Tbslbrm == 0) || is_sl)
|
||||
Ncb = N;
|
||||
Ncb = N;
|
||||
else {
|
||||
Nref = 3 * Tbslbrm / (2 * C); //R_LBRM = 2 / 3
|
||||
Ncb = min(N, Nref);
|
||||
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
|
||||
Ncb = min(N, Nref);
|
||||
}
|
||||
|
||||
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
||||
if (Foffset > E) {
|
||||
LOG_E(NR_PHY, "nr_rate_matching: invalid parameters (Foffset %d > E %d)\n",Foffset,E);
|
||||
LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d)\n",Foffset,E);
|
||||
return -1;
|
||||
}
|
||||
if (Foffset > Ncb) {
|
||||
LOG_E(NR_PHY, "nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n",Foffset,Ncb);
|
||||
LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n",Foffset,Ncb);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,9 +146,8 @@ void nr_modulation(uint32_t *in,
|
||||
case 2:
|
||||
nr_mod_table128 = (__m128i*) nr_qpsk_byte_mod_table;
|
||||
out128 = (__m128i*) out;
|
||||
for (i=0; i<length/8; i++) {
|
||||
for (i=0; i<length/8; i++)
|
||||
out128[i] = nr_mod_table128[in_bytes[i]];
|
||||
}
|
||||
// the bits that are left out
|
||||
i = i*8/2;
|
||||
nr_mod_table32 = (int32_t*) nr_qpsk_mod_table;
|
||||
|
||||
@@ -291,8 +291,7 @@ void nr_processULSegment(void* arg) {
|
||||
ulsch_harq->new_rx,
|
||||
E,
|
||||
ulsch_harq->F,
|
||||
Kr-ulsch_harq->F-2*(p_decoderParms->Z),
|
||||
false) == -1) {
|
||||
Kr-ulsch_harq->F-2*(p_decoderParms->Z),false)==-1) {
|
||||
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
@@ -635,8 +634,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
harq_process->new_rx,
|
||||
E,
|
||||
harq_process->F,
|
||||
Kr - harq_process->F - 2 * (p_decParams->Z),
|
||||
false) == -1) {
|
||||
Kr-harq_process->F-2*(p_decParams->Z),false)==-1) {
|
||||
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n");
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
|
||||
@@ -298,8 +298,7 @@ void nr_processDLSegment(void* arg) {
|
||||
harq_process->first_rx,
|
||||
E,
|
||||
harq_process->F,
|
||||
Kr-harq_process->F-2*(p_decoderParms->Z),
|
||||
false) == -1) {
|
||||
Kr-harq_process->F-2*(p_decoderParms->Z),false)==-1) {
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
|
||||
stop_meas(&rdata->ts_rate_unmatch);
|
||||
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
|
||||
|
||||
@@ -250,7 +250,6 @@ int nr_slsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
NR_POLAR_PSSCH_AGGREGATION_LEVEL);
|
||||
|
||||
harq_process->B_sci2 = polar_encoder_output_len;
|
||||
|
||||
byte2bit(harq_process->b_sci2, harq_process->f_sci2, polar_encoder_output_len>>3);
|
||||
/*
|
||||
for (int i=0 ; i<polar_encoder_output_len ; i++){
|
||||
|
||||
@@ -79,45 +79,6 @@ static void nr_sci2_quantize(int16_t *psbch_llr8,
|
||||
}
|
||||
}
|
||||
|
||||
NR_UE_DLSCH_t *new_nr_ue_slsch_rx(uint16_t N_RB_DL, int number_of_harq_pids, NR_DL_FRAME_PARMS* frame_parms)
|
||||
{
|
||||
|
||||
int max_layers = (frame_parms->nb_antennas_tx < NR_MAX_NB_LAYERS_SL) ? frame_parms->nb_antennas_tx : NR_MAX_NB_LAYERS_SL;
|
||||
uint16_t a_segments = MAX_NUM_NR_SLSCH_SEGMENTS_PER_LAYER * max_layers; //number of segments to be allocated
|
||||
|
||||
if (N_RB_DL != 273) {
|
||||
a_segments = a_segments * N_RB_DL;
|
||||
a_segments = a_segments / 273 + 1;
|
||||
}
|
||||
|
||||
uint32_t slsch_bytes = a_segments * 1056; // allocated bytes per segment
|
||||
|
||||
NR_UE_DLSCH_t *slsch = malloc16(sizeof(NR_UE_DLSCH_t));
|
||||
DevAssert(slsch);
|
||||
memset(slsch, 0, sizeof(*slsch));
|
||||
|
||||
slsch->max_ldpc_iterations = MAX_LDPC_ITERATIONS;
|
||||
|
||||
for (int i = 0; i < number_of_harq_pids; i++) {
|
||||
|
||||
slsch->harq_processes[i] = (NR_DL_UE_HARQ_t *)malloc16_clear(sizeof(NR_DL_UE_HARQ_t));
|
||||
slsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(slsch_bytes);
|
||||
slsch->harq_processes[i]->c = (uint8_t**)malloc16_clear(a_segments * sizeof(uint8_t *));
|
||||
slsch->harq_processes[i]->d = (int16_t**)malloc16_clear(a_segments * sizeof(int16_t *));
|
||||
for (int r = 0; r < a_segments; r++) {
|
||||
slsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448 * sizeof(uint8_t));
|
||||
slsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68 * 384) * sizeof(int16_t));
|
||||
}
|
||||
}
|
||||
|
||||
return(slsch);
|
||||
}
|
||||
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
static uint32_t prnt_crc_cnt = 0;
|
||||
#endif
|
||||
|
||||
|
||||
bool nr_ue_sl_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool last, notifiedFIFO_t *nf_p) {
|
||||
ldpcDecode_ue_t *rdata = (ldpcDecode_ue_t*) NotifiedFifoData(req);
|
||||
NR_DL_UE_HARQ_t *harq_process = rdata->harq_process;
|
||||
|
||||
@@ -207,7 +207,7 @@ void nr_ue_slsch_tx_procedures(PHY_VARS_NR_UE *UE,
|
||||
memset(multiplexed_output, 0, available_bits * sizeof(uint8_t));
|
||||
|
||||
nr_pssch_data_control_multiplexing(harq_process_ul_ue->f,
|
||||
(uint8_t*)harq_process_ul_ue->b_sci2,
|
||||
harq_process_ul_ue->f_sci2,
|
||||
G_slsch_bits,
|
||||
G_SCI2_bits,
|
||||
Nl,
|
||||
|
||||
@@ -77,8 +77,6 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_
|
||||
|
||||
NR_UE_ULSCH_t *new_nr_ue_slsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_FRAME_PARMS* frame_parms);
|
||||
|
||||
NR_UE_DLSCH_t *new_nr_ue_slsch_rx(uint16_t N_RB_DL, int number_of_harq_pids, NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception.
|
||||
@param stream0_in Input from channel compensated (MR combined) stream 0
|
||||
@param stream1_in Input from channel compensated (MR combined) stream 1
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#define HNA_SIZE 6 * 68 * 384 // [hna] 16 segments, 68*Zc
|
||||
#define SCI2_LEN_SIZE 35
|
||||
RAN_CONTEXT_t RC;
|
||||
|
||||
double cpuf;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
@@ -559,7 +558,7 @@ int main(int argc, char **argv)
|
||||
memset(multiplexed_output, 0, available_bits * sizeof(uint8_t));
|
||||
|
||||
nr_pssch_data_control_multiplexing(harq_process_nearbyUE->f,
|
||||
(uint8_t*)harq_process_nearbyUE->b_sci2,
|
||||
harq_process_nearbyUE->f_sci2,
|
||||
G_slsch_bits,
|
||||
G_SCI2_bits,
|
||||
Nl,
|
||||
|
||||
Reference in New Issue
Block a user