Merge remote-tracking branch 'origin/develop' into support-15-kHz-SCS
This commit is contained in:
@@ -395,19 +395,6 @@ int main(int argc, char **argv)
|
||||
load_pbch_desc(pbch_file_fd);
|
||||
}
|
||||
|
||||
/* for (int k=0; k<2; k++) {
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
gNB->dlsch[k][i] = new_gNB_dlsch(Kmimo,8,Nsoft,0,frame_parms,gNB_config);
|
||||
|
||||
if (!gNB->dlsch[k][i]) {
|
||||
printf("Can't get eNB dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
gNB->dlsch[k][i]->Nsoft = 10;
|
||||
gNB->dlsch[k][i]->rnti = n_rnti+k;
|
||||
}
|
||||
}*/
|
||||
//configure UE
|
||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
@@ -420,10 +407,10 @@ int main(int argc, char **argv)
|
||||
|
||||
//nr_init_frame_parms_ue(&UE->frame_parms);
|
||||
//init_nr_ue_transport(UE, 0);
|
||||
int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1;
|
||||
for (int sf = 0; sf < 2; sf++) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
for (i = 0; i < num_codeword; i++) {
|
||||
UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL);
|
||||
|
||||
if (!UE->dlsch[sf][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
@@ -434,8 +421,8 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
|
||||
processingData_L1tx_t msgDataTx;
|
||||
init_DLSCH_struct(gNB, &msgDataTx);
|
||||
processingData_L1tx_t msgDataTx;
|
||||
init_DLSCH_struct(gNB, &msgDataTx);
|
||||
NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0];
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
|
||||
//time_stats_t *rm_stats, *te_stats, *i_stats;
|
||||
@@ -642,8 +629,9 @@ int main(int argc, char **argv)
|
||||
free(RC.gNB[0]);
|
||||
free(RC.gNB);
|
||||
|
||||
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
|
||||
for (int sf = 0; sf < 2; sf++)
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (int i = 0; i < num_cw; i++)
|
||||
free_nr_ue_dlsch(&UE->dlsch[sf][0][i], N_RB_DL);
|
||||
term_nr_ue_signal(UE, 1);
|
||||
free(UE);
|
||||
|
||||
@@ -655,7 +655,7 @@ int main(int argc, char **argv)
|
||||
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n",
|
||||
argv[0]);
|
||||
printf("-h This message\n");
|
||||
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n");
|
||||
printf("-L <log level, 0(errors), 1(warning), 2(analysis), 3(info), 4(debug), 5(trace)>\n");
|
||||
//printf("-p Use extended prefix mode\n");
|
||||
//printf("-d Use TDD\n");
|
||||
printf("-n Number of frames to simulate\n");
|
||||
@@ -1117,7 +1117,7 @@ int main(int argc, char **argv)
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos);
|
||||
ptrsSymbPerSlot = get_ptrs_symbols_in_slot(dlPtrsSymPos, pdsch_pdu_rel15->StartSymbolIndex, pdsch_pdu_rel15->NrOfSymbols);
|
||||
ptrsRePerSymb = ((rel15->rbSize + rel15->PTRSFreqDensity - 1)/rel15->PTRSFreqDensity);
|
||||
printf("[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb );
|
||||
LOG_D(PHY,"[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb );
|
||||
}
|
||||
|
||||
msgDataTx->ssb[0].ssb_pdu.ssb_pdu_rel15.bchPayload=0x001234;
|
||||
@@ -1274,7 +1274,7 @@ int main(int argc, char **argv)
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, rel15->nrOfLayers);
|
||||
if(pdu_bit_map & 0x1) {
|
||||
available_bits-= (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2);
|
||||
printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) );
|
||||
LOG_D(PHY,"[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1331,7 +1331,8 @@ int main(int argc, char **argv)
|
||||
printf("*****************************************\n");
|
||||
printf("\n");
|
||||
dump_pdsch_stats(stdout,gNB);
|
||||
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
|
||||
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n",
|
||||
SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
|
||||
printf("\n");
|
||||
|
||||
if (print_perf==1) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); }
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
@@ -35,4 +36,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus,
|
||||
UE_nr_rxtx_proc_t *proc) {}
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
void * typeSpecific ) {}
|
||||
|
||||
@@ -438,6 +438,7 @@ int main(int argc, char **argv)
|
||||
|
||||
printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL);
|
||||
|
||||
|
||||
RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = malloc16_clear(sizeof(*(RC.gNB[0])));
|
||||
gNB = RC.gNB[0];
|
||||
@@ -531,13 +532,13 @@ int main(int argc, char **argv)
|
||||
s_im = malloc(2*sizeof(double*));
|
||||
r_re = malloc(2*sizeof(double*));
|
||||
r_im = malloc(2*sizeof(double*));
|
||||
txdata = malloc(2*sizeof(int*));
|
||||
txdata = calloc(2,sizeof(int*));
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
|
||||
|
||||
s_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
|
||||
s_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
|
||||
|
||||
r_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
|
||||
r_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
|
||||
printf("Allocating %d samples for txdata\n",frame_length_complex_samples);
|
||||
@@ -550,6 +551,7 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
//configure UE
|
||||
|
||||
UE = malloc16_clear(sizeof(*UE));
|
||||
memcpy(&UE->frame_parms,frame_parms,sizeof(UE->frame_parms));
|
||||
//phy_init_nr_top(UE); //called from init_nr_ue_signal
|
||||
@@ -722,6 +724,9 @@ int main(int argc, char **argv)
|
||||
UE_nr_rxtx_proc_t proc={0};
|
||||
UE->rx_offset=0;
|
||||
uint8_t ssb_index = 0;
|
||||
const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size;
|
||||
__attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz];
|
||||
__attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz];
|
||||
while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb
|
||||
UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index);
|
||||
|
||||
@@ -732,17 +737,20 @@ int main(int argc, char **argv)
|
||||
i%frame_parms->symbols_per_slot,
|
||||
ssb_slot);
|
||||
|
||||
nr_pbch_channel_estimation(UE,&proc,0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf);
|
||||
nr_pbch_channel_estimation(UE,estimateSz, dl_ch_estimates, dl_ch_estimates_time, &proc,
|
||||
0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf);
|
||||
|
||||
}
|
||||
|
||||
fapiPbch_t result;
|
||||
ret = nr_rx_pbch(UE,
|
||||
&proc,
|
||||
UE->pbch_vars[0],
|
||||
estimateSz, dl_ch_estimates,
|
||||
UE->pbch_vars[0],
|
||||
frame_parms,
|
||||
0,
|
||||
ssb_index%8,
|
||||
SISO);
|
||||
SISO,
|
||||
&result);
|
||||
|
||||
if (ret==0) {
|
||||
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
|
||||
@@ -751,9 +759,9 @@ int main(int argc, char **argv)
|
||||
for (int i=0; i<8; i++)
|
||||
gNB_xtra_byte |= ((gNB->pbch.pbch_a>>(31-i))&1)<<(7-i);
|
||||
|
||||
payload_ret = (UE->pbch_vars[0]->xtra_byte == gNB_xtra_byte);
|
||||
payload_ret = (result.xtra_byte == gNB_xtra_byte);
|
||||
for (i=0;i<3;i++){
|
||||
payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
|
||||
payload_ret += (result.decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
|
||||
}
|
||||
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte);
|
||||
//printf("ret %d\n", payload_ret);
|
||||
|
||||
@@ -407,15 +407,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (sf = 0; sf < 2; sf++) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
||||
UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8);
|
||||
|
||||
if (!UE->ulsch[sf][0][i]) {
|
||||
printf("Can't get ue ulsch structures.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
UE->ulsch[sf][0] = new_nr_ue_ulsch(N_RB_UL, 8);
|
||||
if (!UE->ulsch[sf][0]) {
|
||||
printf("Can't get ue ulsch structures.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,11 +426,11 @@ int main(int argc, char **argv)
|
||||
uint8_t rvidx = 0;
|
||||
uint8_t UE_id = 0;
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0];
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id];
|
||||
NR_UL_gNB_HARQ_t *harq_process_gNB = ulsch_gNB->harq_processes[harq_pid];
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul = &harq_process_gNB->ulsch_pdu;
|
||||
|
||||
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0][0];
|
||||
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0];
|
||||
|
||||
mod_order = nr_get_Qm_ul(Imcs, 0);
|
||||
code_rate = nr_get_code_rate_ul(Imcs, 0);
|
||||
@@ -525,7 +520,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
*/
|
||||
|
||||
if (ulsch_ue->g[i] == 0)
|
||||
if (ulsch_ue->harq_processes[harq_pid]->f[i] == 0)
|
||||
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
|
||||
else
|
||||
modulated_input[i] = -1.0; ///sqrt(2);
|
||||
@@ -615,8 +610,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (sf = 0; sf < 2; sf++)
|
||||
for (i = 0; i < 2; i++)
|
||||
free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL);
|
||||
free_nr_ue_ulsch(&UE->ulsch[sf][0], N_RB_UL);
|
||||
term_nr_ue_signal(UE, 1);
|
||||
free(UE);
|
||||
|
||||
|
||||
@@ -822,7 +822,7 @@ int main(int argc, char **argv)
|
||||
|
||||
unsigned char harq_pid = 0;
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0];
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id];
|
||||
//nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &ulsch_gNB->harq_processes[harq_pid]->ulsch_pdu;
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = malloc(sizeof(*UL_tti_req));
|
||||
NR_Sched_Rsp_t *Sched_INFO = malloc(sizeof(*Sched_INFO));
|
||||
@@ -831,7 +831,7 @@ int main(int argc, char **argv)
|
||||
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu;
|
||||
|
||||
NR_UE_ULSCH_t **ulsch_ue = UE->ulsch[0][0];
|
||||
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0];
|
||||
|
||||
unsigned char *estimated_output_bit;
|
||||
unsigned char *test_input_bit;
|
||||
@@ -1070,8 +1070,8 @@ int main(int argc, char **argv)
|
||||
memset((void*)roundStats,0,50*sizeof(roundStats[0]));
|
||||
while (round<max_rounds && crc_status) {
|
||||
round_trials[round][snrRun]++;
|
||||
ulsch_ue[0]->harq_processes[harq_pid]->round = round;
|
||||
gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round;
|
||||
ulsch_ue->harq_processes[harq_pid]->round = round;
|
||||
gNB->ulsch[0]->harq_processes[harq_pid]->round = round;
|
||||
rv_index = nr_rv_round_map[round];
|
||||
|
||||
UE_proc.thread_id = 0;
|
||||
@@ -1212,7 +1212,7 @@ int main(int argc, char **argv)
|
||||
|
||||
//nr_fill_ulsch(gNB,frame,slot,pusch_pdu); // Not needed as its its already filled as apart of "nr_schedule_response(Sched_INFO);"
|
||||
|
||||
for (int i=0;i<(TBS/8);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff;
|
||||
for (int i=0;i<(TBS/8);i++) ulsch_ue->harq_processes[harq_pid]->a[i]=i&0xff;
|
||||
if (input_fd == NULL) {
|
||||
|
||||
// set FAPI parameters for UE, put them in the scheduled response and call
|
||||
@@ -1387,8 +1387,8 @@ int main(int argc, char **argv)
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
if ((gNB->ulsch[0][0]->last_iteration_cnt >=
|
||||
gNB->ulsch[0][0]->max_ldpc_iterations+1) || ul_proc_error == 1) {
|
||||
if ((gNB->ulsch[0]->last_iteration_cnt >=
|
||||
gNB->ulsch[0]->max_ldpc_iterations+1) || ul_proc_error == 1) {
|
||||
error_flag = 1;
|
||||
n_errors[round][snrRun]++;
|
||||
crc_status = 1;
|
||||
@@ -1413,8 +1413,8 @@ int main(int argc, char **argv)
|
||||
|
||||
for (i = 0; i < available_bits; i++) {
|
||||
|
||||
if(((ulsch_ue[0]->g[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) ||
|
||||
((ulsch_ue[0]->g[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0)))
|
||||
if(((ulsch_ue->harq_processes[harq_pid]->f[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) ||
|
||||
((ulsch_ue->harq_processes[harq_pid]->f[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0)))
|
||||
{
|
||||
/*if(errors_scrambling == 0)
|
||||
printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/
|
||||
@@ -1432,7 +1432,7 @@ int main(int argc, char **argv)
|
||||
for (i = 0; i < TBS; i++) {
|
||||
|
||||
estimated_output_bit[i] = (ulsch_gNB->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
|
||||
test_input_bit[i] = (ulsch_ue[0]->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
|
||||
test_input_bit[i] = (ulsch_ue->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7);
|
||||
|
||||
if (estimated_output_bit[i] != test_input_bit[i]) {
|
||||
/*if(errors_decoding == 0)
|
||||
@@ -1441,13 +1441,13 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
if (n_trials == 1) {
|
||||
for (int r=0;r<ulsch_ue[0]->harq_processes[harq_pid]->C;r++)
|
||||
for (int i=0;i<ulsch_ue[0]->harq_processes[harq_pid]->K>>3;i++) {
|
||||
if ((ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************");
|
||||
for (int r=0;r<ulsch_ue->harq_processes[harq_pid]->C;r++)
|
||||
for (int i=0;i<ulsch_ue->harq_processes[harq_pid]->K>>3;i++) {
|
||||
if ((ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************");
|
||||
/*printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r,
|
||||
i,ulsch_ue[0]->harq_processes[harq_pid]->c[r][i],
|
||||
i,ulsch_ue->harq_processes[harq_pid]->c[r][i],
|
||||
i,ulsch_gNB->harq_processes[harq_pid]->c[r][i],
|
||||
ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/
|
||||
ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/
|
||||
}
|
||||
}
|
||||
if (errors_decoding > 0 && error_flag == 0) {
|
||||
|
||||
Reference in New Issue
Block a user