Commit 3f38b447 authored by Raymond Knopp's avatar Raymond Knopp

prachsim functional for format A2 and 0. added format 0 test to CI autotests

parent 7176bb46
...@@ -1299,18 +1299,20 @@ ...@@ -1299,18 +1299,20 @@
<testCase id="015112"> <testCase id="015112">
<class>execution</class> <class>execution</class>
<desc>nr_prachsim Test cases. (Test1: 106 PRBs), <desc>nr_prachsim Test cases. (Test1: 106 PRBs - Prach format A2),
(Test2: 217 PRBs), (Test2: 217 PRBs - Prach format A2),
(Test3: 273 PRBs)</desc> (Test3: 273 PRBs - Prach format A2),
(Test4: 106 PRBs - Prach format 0)</desc>
<pre_compile_prog></pre_compile_prog> <pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args> <compile_prog_args> --phy_simulators -c </compile_prog_args>
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args> <pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_prachsim.Rel15</main_exec> <main_exec> $OPENAIR_DIR/targets/bin/nr_prachsim.Rel15</main_exec>
<main_exec_args>-a -s -30 -n 100 -p 16 -R 106 <main_exec_args>-a -s -30 -n 100 -p 63 -R 106
-a -s -30 -n 100 -p 16 -R 217 -a -s -30 -n 100 -p 63 -R 217
-a -s -30 -n 100 -p 16 -R 273</main_exec_args> -a -s -30 -n 100 -p 63 -R 273
-a -s -30 -n 100 -p 63 -R 106 -c 4</main_exec_args>
<tags>nr_prachsim.test1 nr_prachsim.test2 nr_prachsim.test3</tags> <tags>nr_prachsim.test1 nr_prachsim.test2 nr_prachsim.test3</tags>
<search_expr_true>PRACH test OK</search_expr_true> <search_expr_true>PRACH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
......
...@@ -753,7 +753,6 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -753,7 +753,6 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC)); preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC));
for (i=0; i<NCS2; i++) { for (i=0; i<NCS2; i++) {
lev = (int32_t)prach_ifft[(preamble_shift2+i)]; lev = (int32_t)prach_ifft[(preamble_shift2+i)];
levdB = dB_fixed_times10(lev); levdB = dB_fixed_times10(lev);
......
...@@ -139,7 +139,7 @@ void compute_nr_prach_seq(uint8_t short_sequence, ...@@ -139,7 +139,7 @@ void compute_nr_prach_seq(uint8_t short_sequence,
} }
u = prach_root_sequence_map[index]; u = prach_root_sequence_map[index];
LOG_D(PHY,"prach index %d => u=%d\n",index,u);
inv_u = nr_ZC_inv[u]; // multiplicative inverse of u inv_u = nr_ZC_inv[u]; // multiplicative inverse of u
......
...@@ -339,6 +339,8 @@ int main(int argc, char **argv){ ...@@ -339,6 +339,8 @@ int main(int argc, char **argv){
if (config_index<67) { prach_sequence_length=0; slot = subframe*2; slot_gNB = 1+(subframe*2); } if (config_index<67) { prach_sequence_length=0; slot = subframe*2; slot_gNB = 1+(subframe*2); }
uint16_t N_ZC;
N_ZC = prach_sequence_length == 0 ? 839 : 139;
printf("Config_index %d, prach_sequence_length %d\n",config_index,prach_sequence_length); printf("Config_index %d, prach_sequence_length %d\n",config_index,prach_sequence_length);
...@@ -485,8 +487,8 @@ int main(int argc, char **argv){ ...@@ -485,8 +487,8 @@ int main(int argc, char **argv){
prach_config->num_prach_fd_occasions_list[fd_occasion].k1.value = msg1_frequencystart; prach_config->num_prach_fd_occasions_list[fd_occasion].k1.value = msg1_frequencystart;
prach_config->restricted_set_config.value = restrictedSetConfig; prach_config->restricted_set_config.value = restrictedSetConfig;
prach_config->prach_sequence_length.value = prach_sequence_length; prach_config->prach_sequence_length.value = prach_sequence_length;
prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value = num_root_sequences;
prach_pdu->num_cs = get_NCS(NCS_config, format0, restrictedSetConfig); prach_pdu->num_cs = get_NCS(NCS_config, format0, restrictedSetConfig);
prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value = 1+(64/(N_ZC/prach_pdu->num_cs));
prach_pdu->prach_format = prach_format; prach_pdu->prach_format = prach_format;
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config)); memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
...@@ -525,7 +527,7 @@ int main(int argc, char **argv){ ...@@ -525,7 +527,7 @@ int main(int argc, char **argv){
ue_prach_config->prach_sub_c_spacing = mu; ue_prach_config->prach_sub_c_spacing = mu;
ue_prach_config->prach_sequence_length = prach_sequence_length; ue_prach_config->prach_sequence_length = prach_sequence_length;
ue_prach_config->restricted_set_config = restrictedSetConfig; ue_prach_config->restricted_set_config = restrictedSetConfig;
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences = num_root_sequences; ue_prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences = prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value ;
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index = rootSequenceIndex; ue_prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index = rootSequenceIndex;
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].k1 = msg1_frequencystart; ue_prach_config->num_prach_fd_occasions_list[fd_occasion].k1 = msg1_frequencystart;
...@@ -601,13 +603,10 @@ int main(int argc, char **argv){ ...@@ -601,13 +603,10 @@ int main(int argc, char **argv){
/* tx_lev_dB not used later, no need to set */ /* tx_lev_dB not used later, no need to set */
//tx_lev_dB = (unsigned int) dB_fixed(tx_lev); //tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
samp_count=0; prach_start = subframe*frame_parms->samples_per_subframe-UE->N_TA_offset;
for (int s=0; s<slot; s++) samp_count+=frame_parms->get_samples_per_slot(s,frame_parms);
prach_start = samp_count - UE->N_TA_offset;
#ifdef NR_PRACH_DEBUG #ifdef NR_PRACH_DEBUG
LOG_M("txsig0.m", "txs0", &txdata[0][prach_start], frame_parms->samples_per_subframe, 1, 1); LOG_M("txsig0.m", "txs0", &txdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("txsig0_frame.m","txs0", txdata[0],frame_parms->samples_per_frame,1,1); LOG_M("txsig0_frame.m","txs0", txdata[0],frame_parms->samples_per_frame,1,1);
#endif #endif
...@@ -651,8 +650,8 @@ int main(int argc, char **argv){ ...@@ -651,8 +650,8 @@ int main(int argc, char **argv){
rx_prach_start = subframe*frame_parms->samples_per_subframe; rx_prach_start = subframe*frame_parms->samples_per_subframe;
if (n_frames==1) printf("slot %d, rx_prach_start %d\n",slot,rx_prach_start); if (n_frames==1) printf("slot %d, rx_prach_start %d\n",slot,rx_prach_start);
uint16_t preamble_rx, preamble_energy, N_ZC; uint16_t preamble_rx, preamble_energy;
N_ZC = prach_sequence_length == 0 ? 839 : 139;
for (SNR=snr0; SNR<snr1; SNR+=.1) { for (SNR=snr0; SNR<snr1; SNR+=.1) {
for (ue_speed=ue_speed0; ue_speed<ue_speed1; ue_speed+=10) { for (ue_speed=ue_speed0; ue_speed<ue_speed1; ue_speed+=10) {
...@@ -703,7 +702,7 @@ int main(int argc, char **argv){ ...@@ -703,7 +702,7 @@ int main(int argc, char **argv){
rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, frame, slot); rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, frame, slot);
gNB->prach_vars.rxsigF = ru->prach_rxsigF; gNB->prach_vars.rxsigF = ru->prach_rxsigF;
if (n_frames == 1) printf("ncs %d,num_seq %d\n",prach_pdu->num_cs, prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value);
rx_nr_prach(gNB, prach_pdu, frame, subframe, &preamble_rx, &preamble_energy, &preamble_delay); rx_nr_prach(gNB, prach_pdu, frame, subframe, &preamble_rx, &preamble_energy, &preamble_delay);
// printf(" preamble_energy %d preamble_rx %d preamble_tx %d \n", preamble_energy, preamble_rx, preamble_tx); // printf(" preamble_energy %d preamble_rx %d preamble_tx %d \n", preamble_energy, preamble_rx, preamble_tx);
...@@ -720,8 +719,8 @@ int main(int argc, char **argv){ ...@@ -720,8 +719,8 @@ int main(int argc, char **argv){
#ifdef NR_PRACH_DEBUG #ifdef NR_PRACH_DEBUG
LOG_M("prach0.m","prach0", &txdata[0][prach_start], frame_parms->samples_per_subframe, 1, 1); LOG_M("prach0.m","prach0", &txdata[0][prach_start], frame_parms->samples_per_subframe, 1, 1);
LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1); LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1);
LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][rx_prach_start], frame_parms->samples_per_subframe, 1, 1); LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][rx_prach_start], frame_parms->samples_per_subframe, 1, 1); LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("rxsigF0.m","rxsF0", gNB->prach_vars.rxsigF[0], N_ZC, 1, 1); LOG_M("rxsigF0.m","rxsF0", gNB->prach_vars.rxsigF[0], N_ZC, 1, 1);
LOG_M("prach_preamble.m","prachp", &gNB->X_u[0], N_ZC, 1, 1); LOG_M("prach_preamble.m","prachp", &gNB->X_u[0], N_ZC, 1, 1);
LOG_M("ue_prach_preamble.m","prachp", &UE->X_u[0], N_ZC, 1, 1); LOG_M("ue_prach_preamble.m","prachp", &UE->X_u[0], N_ZC, 1, 1);
......
...@@ -52,6 +52,9 @@ const char *prachfmt03[]={"0","1","2","3"}; ...@@ -52,6 +52,9 @@ const char *prachfmt03[]={"0","1","2","3"};
uint16_t get_NCS(uint8_t index, uint16_t format0, uint8_t restricted_set_config) { uint16_t get_NCS(uint8_t index, uint16_t format0, uint8_t restricted_set_config) {
LOG_D(MAC,"get_NCS: indx %d,format0 %d, restriced_set_config %d\n",
index,format0,restricted_set_config);
if (format0 < 3) { if (format0 < 3) {
switch(restricted_set_config){ switch(restricted_set_config){
case 0: case 0:
......
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