Merge branch 'bler_txoptim' into F1C_extensions_develop
Conflicts: cmake_targets/CMakeLists.txt common/utils/nr/nr_common.c openair1/PHY/INIT/nr_parms.c openair1/PHY/NR_TRANSPORT/pucch_rx.c openair1/PHY/NR_UE_TRANSPORT/dci_nr.c openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c openair1/SCHED_NR/fapi_nr_l1.c openair1/SCHED_NR/phy_procedures_nr_gNB.c openair1/SCHED_NR_UE/phy_procedures_nr_ue.c openair1/SIMULATION/NR_PHY/dlschsim.c openair1/SIMULATION/NR_PHY/dlsim.c openair2/GNB_APP/gnb_config.c openair2/LAYER2/NR_MAC_UE/config_ue.c openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c openair2/LAYER2/NR_MAC_gNB/main.c openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c openair2/RRC/NR/L2_nr_interface.c openair2/RRC/NR/MESSAGES/asn1_msg.c openair2/RRC/NR/MESSAGES/asn1_msg.h openair2/RRC/NR/rrc_gNB_NGAP.c openair3/NAS/NR_UE/nr_nas_msg_sim.c openair3/NAS/NR_UE/nr_nas_msg_sim.h openair3/ocp-gtpu/gtp_itf.cpp targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
This commit is contained in:
@@ -19,10 +19,10 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include<stdio.h>
|
||||
#include<string.h>
|
||||
#include<gpib/ib.h>
|
||||
#include"gpib_send.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <gpib/ib.h>
|
||||
#include "gpib_send.h"
|
||||
void gpib_send(unsigned int gpib_board, unsigned int gpib_device, char *command_string )
|
||||
{
|
||||
unsigned short addlist[2] = {gpib_device, NOADDR};
|
||||
|
||||
@@ -68,6 +68,7 @@ uint16_t n_rnti = 0x1234;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
void processSlotTX(void *arg) {}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -116,8 +117,10 @@ int main(int argc, char **argv)
|
||||
uint8_t Imcs = 9;
|
||||
uint8_t mcs_table = 0;
|
||||
double DS_TDL = .03;
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
char gNBthreads[128]="n";
|
||||
|
||||
|
||||
if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) {
|
||||
exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n");
|
||||
}
|
||||
@@ -426,9 +429,22 @@ int main(int argc, char **argv)
|
||||
UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
|
||||
UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
|
||||
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
|
||||
processingData_L1tx_t msgDataTx;
|
||||
init_DLSCH_struct(gNB, &msgDataTx);
|
||||
NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0];
|
||||
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
initTpool(gNBthreads, gNB->threadPool, true);
|
||||
gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
initNotifiedFIFO(gNB->resp_L1_tx);
|
||||
// we create 2 threads for L1 tx processing
|
||||
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX);
|
||||
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
|
||||
init_DLSCH_struct(gNB, msgDataTx);
|
||||
msgDataTx->slot = slot;
|
||||
msgDataTx->frame = frame;
|
||||
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
|
||||
reset_meas(&msgDataTx->phy_proc_tx);
|
||||
gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx;
|
||||
pushTpool(gNB->threadPool,msgL1Tx);
|
||||
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;
|
||||
uint8_t is_crnti = 0, llr8_flag = 0;
|
||||
@@ -501,10 +517,13 @@ int main(int argc, char **argv)
|
||||
/*for (int i=0; i<TBS/8; i++)
|
||||
printf("test input[%d]=%d \n",i,test_input[i]);*/
|
||||
|
||||
|
||||
//printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32));
|
||||
// generate signal
|
||||
unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
|
||||
bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
if (input_fd == NULL) {
|
||||
nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
}
|
||||
|
||||
for (SNR = snr0; SNR < snr1; SNR += snr_step) {
|
||||
@@ -521,11 +540,12 @@ int main(int argc, char **argv)
|
||||
|
||||
//if (i<16)
|
||||
// printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]);
|
||||
/*
|
||||
if (dlsch->harq_process.f[i] == 0)
|
||||
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
|
||||
else
|
||||
modulated_input[i] = -1.0; ///sqrt(2);
|
||||
|
||||
*/
|
||||
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
|
||||
//SNR =10;
|
||||
SNR_lin = pow(10, SNR / 10.0);
|
||||
@@ -548,9 +568,10 @@ int main(int argc, char **argv)
|
||||
channel_output_uncoded[i] = 1; //QPSK demod
|
||||
else
|
||||
channel_output_uncoded[i] = 0;
|
||||
|
||||
/*
|
||||
if (channel_output_uncoded[i] != dlsch->harq_process.f[i])
|
||||
errors_bit_uncoded = errors_bit_uncoded + 1;
|
||||
*/
|
||||
}
|
||||
|
||||
//if (errors_bit_uncoded>10)
|
||||
@@ -636,7 +657,7 @@ int main(int argc, char **argv)
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
printf("gNB %d\n", i);
|
||||
free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL);
|
||||
free_gNB_dlsch(&(msgDataTx->dlsch[0][i]),N_RB_DL);
|
||||
printf("UE %d\n", i);
|
||||
free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL);
|
||||
}
|
||||
|
||||
@@ -371,6 +371,7 @@ int main(int argc, char **argv)
|
||||
uint8_t n_tx=1,n_rx=1;
|
||||
uint8_t round;
|
||||
uint8_t num_rounds = 4;
|
||||
char gNBthreads[128]="n";
|
||||
|
||||
channel_desc_t *gNB2UE;
|
||||
//uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
|
||||
@@ -432,9 +433,7 @@ int main(int argc, char **argv)
|
||||
|
||||
FILE *scg_fd=NULL;
|
||||
|
||||
|
||||
while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) {
|
||||
|
||||
while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
scg_fd = fopen(optarg,"r");
|
||||
@@ -637,7 +636,12 @@ int main(int argc, char **argv)
|
||||
dmrs_arg[i] = atoi(argv[optind++]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'X':
|
||||
strncpy(gNBthreads, optarg, sizeof(gNBthreads));
|
||||
gNBthreads[sizeof(gNBthreads)-1]=0;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'h':
|
||||
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -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",
|
||||
@@ -673,7 +677,8 @@ int main(int argc, char **argv)
|
||||
printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n");
|
||||
printf("-P Print DLSCH performances\n");
|
||||
printf("-w Write txdata to binary file (one frame)\n");
|
||||
printf("-D number of dlsch threads, 0: no dlsch parallelization\n");
|
||||
printf("-d number of dlsch threads, 0: no dlsch parallelization\n");
|
||||
printf("-X gNB thread pool configuration, n => no threads");
|
||||
exit (-1);
|
||||
break;
|
||||
}
|
||||
@@ -829,6 +834,14 @@ int main(int argc, char **argv)
|
||||
fs = 61.44e6;
|
||||
bw = 40e6;
|
||||
}
|
||||
else if (mu == 1 && N_RB_DL == 133) {
|
||||
fs = 61.44e6;
|
||||
bw = 50e6;
|
||||
}
|
||||
else if (mu == 1 && N_RB_DL == 162) {
|
||||
fs = 61.44e6;
|
||||
bw = 60e6;
|
||||
}
|
||||
else if (mu == 3 && N_RB_DL == 66) {
|
||||
fs = 122.88e6;
|
||||
bw = 100e6;
|
||||
@@ -968,8 +981,7 @@ int main(int argc, char **argv)
|
||||
snrRun = 0;
|
||||
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
char tp_param[] = "n";
|
||||
initTpool(tp_param, gNB->threadPool, true);
|
||||
initTpool(gNBthreads, gNB->threadPool, true);
|
||||
gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
initNotifiedFIFO(gNB->resp_L1_tx);
|
||||
// we create 2 threads for L1 tx processing
|
||||
@@ -1223,8 +1235,8 @@ int main(int argc, char **argv)
|
||||
UE->dlsch[UE_proc.thread_id][0][0]->max_ldpc_iterations+1)
|
||||
n_errors++;
|
||||
|
||||
NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id];
|
||||
int16_t *UE_llr = pdsch_vars[0]->llr[0];
|
||||
//NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id];
|
||||
//int16_t *UE_llr = pdsch_vars[0]->llr[0];
|
||||
|
||||
TBS = UE_harq_process->TBS;//rel15->TBSize[0];
|
||||
uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
|
||||
@@ -1239,6 +1251,7 @@ int main(int argc, char **argv)
|
||||
printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) );
|
||||
}
|
||||
|
||||
/*
|
||||
for (i = 0; i < available_bits; i++) {
|
||||
|
||||
if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) ||
|
||||
@@ -1252,6 +1265,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
for (i = 0; i < TBS; i++) {
|
||||
|
||||
estimated_output_bit[i] = (UE_harq_process->b[i/8] & (1 << (i & 7))) >> (i & 7);
|
||||
@@ -1295,11 +1309,9 @@ int main(int argc, char **argv)
|
||||
printf("\n");
|
||||
|
||||
if (print_perf==1) {
|
||||
printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n",
|
||||
printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n",
|
||||
1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex,
|
||||
msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3,
|
||||
msgDataTx->dlsch[0][0]->harq_process.K,
|
||||
msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10));
|
||||
msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3);
|
||||
printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx");
|
||||
printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time");
|
||||
printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time");
|
||||
@@ -1311,6 +1323,9 @@ int main(int argc, char **argv)
|
||||
printStatIndent3(&gNB->dlsch_interleaving_stats, "DLSCH Interleaving time");
|
||||
printStatIndent2(&gNB->dlsch_modulation_stats,"DLSCH modulation time");
|
||||
printStatIndent2(&gNB->dlsch_scrambling_stats, "DLSCH scrambling time");
|
||||
printStatIndent2(&gNB->dlsch_layer_mapping_stats, "DLSCH Layer Mapping time");
|
||||
printStatIndent2(&gNB->dlsch_resource_mapping_stats, "DLSCH Resource Mapping time");
|
||||
printStatIndent2(&gNB->dlsch_precoding_stats,"DLSCH Layer Precoding time");
|
||||
|
||||
|
||||
printf("\nUE RX function statistics (per %d us slot)\n",1000>>*scc->ssbSubcarrierSpacing);
|
||||
|
||||
Reference in New Issue
Block a user