Merge branch 'develop' into NR_RRC_PRACH_procedures
Conflicts: executables/nr-ue.c openair1/PHY/NR_REFSIG/dmrs_nr.c openair1/PHY/NR_TRANSPORT/nr_prach.c openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h openair1/PHY/NR_TRANSPORT/nr_transport_proto_common.h openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c openair1/SCHED_NR_UE/fapi_nr_ue_l1.c openair1/SIMULATION/NR_PHY/prachsim.c openair1/SIMULATION/NR_PHY/ulsim.c openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
This commit is contained in:
@@ -28,8 +28,9 @@
|
||||
* \email: lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __SOCKET_H__
|
||||
# define __SOCKET_H__
|
||||
#ifndef __SIMULATION_ETH_TRANSPORT_SOCKET__H__
|
||||
#define __SIMULATION_ETH_TRANSPORT_SOCKET__H__
|
||||
|
||||
# ifdef SOCKET_C
|
||||
# define private_socket(x) x
|
||||
# define public_socket(x) x
|
||||
|
||||
@@ -867,7 +867,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (errors_scrambling > 0) {
|
||||
if (n_trials == 1)
|
||||
printf("errors_scrambling = %d/%d (trial %d)\n", errors_scrambling, available_bits,trial);
|
||||
printf("errors_scrambling = %u/%u (trial %d)\n", errors_scrambling, available_bits,trial);
|
||||
}
|
||||
|
||||
if (errors_bit > 0) {
|
||||
@@ -975,6 +975,8 @@ int main(int argc, char **argv)
|
||||
if (input_fd)
|
||||
fclose(input_fd);
|
||||
|
||||
if (scg_fd)
|
||||
fclose(scg_fd);
|
||||
return(n_errors);
|
||||
|
||||
}
|
||||
|
||||
@@ -160,21 +160,27 @@ int main(int argc, char **argv){
|
||||
|
||||
case 'H':
|
||||
channel_model=Rayleigh8;
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
channel_model=Rayleigh1;
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
channel_model=Rayleigh1_corr;
|
||||
break;
|
||||
|
||||
case 'K':
|
||||
channel_model=Rayleigh1_anticorr;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
channel_model=Rice8;
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
channel_model=Rice1;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
channel_model=Rayleigh1_800;
|
||||
|
||||
@@ -465,7 +465,7 @@ int main(int argc, char **argv)
|
||||
mcs=table1_mcs[actual_payload];
|
||||
else if(nr_bit==2)
|
||||
mcs=table2_mcs[actual_payload];
|
||||
else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n");
|
||||
else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag);
|
||||
}
|
||||
|
||||
for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
|
||||
|
||||
@@ -402,7 +402,6 @@ int main(int argc, char **argv)
|
||||
rel15_ul->mcs_index = Imcs;
|
||||
rel15_ul->pusch_data.rv_index = rvidx;
|
||||
rel15_ul->nrOfLayers = Nl;
|
||||
//rel15_ul->length_dmrs = length_dmrs;
|
||||
rel15_ul->target_code_rate = code_rate;
|
||||
rel15_ul->pusch_data.tb_size = TBS>>3;
|
||||
///////////////////////////////////////////////////
|
||||
@@ -424,15 +423,6 @@ int main(int argc, char **argv)
|
||||
for (i = 0; i < TBS / 8; i++)
|
||||
test_input[i] = (unsigned char) rand();
|
||||
|
||||
|
||||
/////////////////////////[adk] preparing NR_UE_ULSCH_t parameters///////////////////////// A HOT FIX until creating nfapi_nr_ul_config_ulsch_pdu_rel15_t
|
||||
///////////
|
||||
ulsch_ue->nb_re_dmrs = nb_re_dmrs;
|
||||
ulsch_ue->length_dmrs = length_dmrs;
|
||||
ulsch_ue->rnti = n_rnti;
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////[adk] preparing UL harq_process parameters/////////////////////////
|
||||
///////////
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
|
||||
@@ -442,13 +432,14 @@ int main(int argc, char **argv)
|
||||
|
||||
if (harq_process_ul_ue) {
|
||||
|
||||
harq_process_ul_ue->mcs = Imcs;
|
||||
harq_process_ul_ue->Nl = Nl;
|
||||
harq_process_ul_ue->nb_rb = nb_rb;
|
||||
harq_process_ul_ue->number_of_symbols = nb_symb_sch;
|
||||
harq_process_ul_ue->pusch_pdu.rnti = n_rnti;
|
||||
harq_process_ul_ue->pusch_pdu.mcs_index = Imcs;
|
||||
harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl;
|
||||
harq_process_ul_ue->pusch_pdu.rb_size = nb_rb;
|
||||
harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch;
|
||||
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
|
||||
harq_process_ul_ue->rvidx = rvidx;
|
||||
harq_process_ul_ue->TBS = TBS;
|
||||
harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx;
|
||||
harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS;
|
||||
harq_process_ul_ue->a = &test_input[0];
|
||||
|
||||
}
|
||||
@@ -461,9 +452,10 @@ int main(int argc, char **argv)
|
||||
|
||||
/////////////////////////ULSCH coding/////////////////////////
|
||||
///////////
|
||||
unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl);
|
||||
|
||||
if (input_fd == NULL) {
|
||||
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid);
|
||||
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
|
||||
int loglvl = OAILOG_WARNING;
|
||||
uint64_t SSB_positions=0x01;
|
||||
uint16_t nb_symb_sch = 12;
|
||||
int start_symbol = 0;
|
||||
int start_symbol = 2;
|
||||
uint16_t nb_rb = 50;
|
||||
uint8_t Imcs = 9;
|
||||
uint8_t precod_nbr_layers = 1;
|
||||
@@ -512,18 +512,31 @@ int main(int argc, char **argv)
|
||||
unsigned int TBS;
|
||||
uint16_t number_dmrs_symbols = 1;
|
||||
unsigned int available_bits;
|
||||
|
||||
uint8_t nb_re_dmrs=12; // no PUSCH REs
|
||||
uint8_t length_dmrs = 1;
|
||||
uint8_t nb_re_dmrs;
|
||||
unsigned char mod_order;
|
||||
uint16_t code_rate;
|
||||
uint8_t ptrs_mcs1 = 2;
|
||||
uint8_t ptrs_mcs2 = 4;
|
||||
uint8_t ptrs_mcs3 = 10;
|
||||
uint16_t n_rb0 = 25;
|
||||
uint16_t n_rb1 = 75;
|
||||
uint8_t mcs_table = 0;
|
||||
uint16_t pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; // | PUSCH_PDU_BITMAP_PUSCH_PTRS;
|
||||
|
||||
uint8_t length_dmrs = pusch_len1; // [hna] remove dmrs struct
|
||||
uint16_t l_prime_mask = get_l_prime(nb_symb_sch, typeB, pusch_dmrs_pos0, length_dmrs); // [hna] remove dmrs struct
|
||||
uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, Imcs, mcs_table);
|
||||
uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, nb_rb);
|
||||
|
||||
if(1<<ptrs_time_density >= nb_symb_sch)
|
||||
pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
|
||||
|
||||
for (i = 0; i < nb_symb_sch; i++) {
|
||||
number_dmrs_symbols += (l_prime_mask >> i) & 0x01;
|
||||
}
|
||||
|
||||
mod_order = nr_get_Qm_ul(Imcs, 0);
|
||||
|
||||
code_rate = nr_get_code_rate_ul(Imcs, 0);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, precod_nbr_layers);
|
||||
|
||||
printf("\n");
|
||||
|
||||
@@ -568,16 +581,16 @@ int main(int argc, char **argv)
|
||||
UL_tti_req->pdus_list[0].pdu_size = sizeof(nfapi_nr_pusch_pdu_t);
|
||||
memset(pusch_pdu,0,sizeof(nfapi_nr_pusch_pdu_t));
|
||||
|
||||
pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
|
||||
pusch_pdu->pdu_bit_map = pdu_bit_map;
|
||||
pusch_pdu->rnti = n_rnti;
|
||||
pusch_pdu->mcs_index = Imcs;
|
||||
pusch_pdu->mcs_table = 0;
|
||||
pusch_pdu->mcs_table = mcs_table;
|
||||
pusch_pdu->target_code_rate = code_rate;
|
||||
pusch_pdu->qam_mod_order = mod_order;
|
||||
pusch_pdu->transform_precoding = 0;
|
||||
pusch_pdu->data_scrambling_id = 0;
|
||||
pusch_pdu->nrOfLayers = 1;
|
||||
pusch_pdu->ul_dmrs_symb_pos = 1;
|
||||
pusch_pdu->ul_dmrs_symb_pos = l_prime_mask << start_symbol;
|
||||
pusch_pdu->dmrs_config_type = 0;
|
||||
pusch_pdu->ul_dmrs_scrambling_id = 0;
|
||||
pusch_pdu->scid = 0;
|
||||
@@ -592,11 +605,11 @@ int main(int argc, char **argv)
|
||||
pusch_pdu->pusch_data.rv_index = 0;
|
||||
pusch_pdu->pusch_data.harq_process_id = 0;
|
||||
pusch_pdu->pusch_data.new_data_indicator = 0;
|
||||
pusch_pdu->pusch_data.tb_size = TBS>>3;
|
||||
pusch_pdu->pusch_data.num_cb = 0;
|
||||
|
||||
// prepare ULSCH/PUSCH reception
|
||||
nr_schedule_response(Sched_INFO);
|
||||
pusch_pdu->pusch_ptrs.ptrs_time_density = ptrs_time_density;
|
||||
pusch_pdu->pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
|
||||
pusch_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ptrs_ports_t));
|
||||
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
|
||||
|
||||
// --------- setting parameters for UE --------
|
||||
|
||||
@@ -611,19 +624,33 @@ int main(int argc, char **argv)
|
||||
ul_config.slot = slot;
|
||||
ul_config.number_pdus = 1;
|
||||
ul_config.ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.rnti = n_rnti;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_rbs = nb_rb;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = Imcs;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = 0;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
|
||||
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.rnti = n_rnti;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.rb_size = nb_rb;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.rb_start = start_rb;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.nr_of_symbols = nb_symb_sch;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask << start_symbol;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = 0;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = 0;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_pid;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_time_density = ptrs_time_density;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ue_ptrs_ports_t));
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
|
||||
//there are plenty of other parameters that we don't seem to be using for now. e.g.
|
||||
//ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.absolute_delta_PUSCH = 0;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0;
|
||||
|
||||
nb_re_dmrs = ((ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type == pusch_dmrs_type1) ? 6 : 4);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers);
|
||||
|
||||
pusch_pdu->pusch_data.tb_size = TBS>>3;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS;
|
||||
// set FAPI parameters for UE, put them in the scheduled response and call
|
||||
nr_ue_scheduled_response(&scheduled_response);
|
||||
|
||||
@@ -704,7 +731,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (errors_scrambling > 0) {
|
||||
if (n_trials==1)
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %d\n" "\x1B[0m", frame, trial, errors_scrambling);
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %u\n" "\x1B[0m", frame, trial, errors_scrambling);
|
||||
}
|
||||
|
||||
for (i = 0; i < TBS; i++) {
|
||||
@@ -722,13 +749,13 @@ int main(int argc, char **argv)
|
||||
if (errors_decoding > 0) {
|
||||
n_false_positive++;
|
||||
if (n_trials==1)
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in decoding = %d\n" "\x1B[0m", frame, trial, errors_decoding);
|
||||
printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in decoding = %u\n" "\x1B[0m", frame, trial, errors_decoding);
|
||||
}
|
||||
|
||||
} // trial loop
|
||||
|
||||
printf("*****************************************\n");
|
||||
printf("SNR %f: n_errors (negative CRC) = %d/%d, false_positive %d/%d, errors_scrambling %d/%d\n", SNR, n_errors, n_trials, n_false_positive, n_trials, errors_scrambling, n_trials);
|
||||
printf("SNR %f: n_errors (negative CRC) = %d/%d, false_positive %d/%d, errors_scrambling %u/%d\n", SNR, n_errors, n_trials, n_false_positive, n_trials, errors_scrambling, n_trials);
|
||||
printf("\n");
|
||||
printf("SNR %f: Channel BLER %e, Channel BER %e\n", SNR,(double)n_errors/n_trials,(double)errors_scrambling/available_bits/n_trials);
|
||||
printf("*****************************************\n");
|
||||
@@ -771,5 +798,8 @@ int main(int argc, char **argv)
|
||||
if (input_fd)
|
||||
fclose(input_fd);
|
||||
|
||||
if (scg_fd)
|
||||
fclose(scg_fd);
|
||||
|
||||
return (n_errors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user