initial cppcheck fixes
This commit is contained in:
@@ -177,7 +177,7 @@ function variant__v4__cppcheck {
|
|||||||
VM_MEMORY=4096
|
VM_MEMORY=4096
|
||||||
LOG_PATTERN=cppcheck.xml
|
LOG_PATTERN=cppcheck.xml
|
||||||
NB_PATTERN_FILES=1
|
NB_PATTERN_FILES=1
|
||||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4"
|
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4"
|
||||||
}
|
}
|
||||||
|
|
||||||
function variant__v5__gnb_usrp {
|
function variant__v5__gnb_usrp {
|
||||||
|
|||||||
+1
-1
@@ -774,7 +774,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
|||||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
|
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
|
||||||
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
|
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||||
AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %d/%d)\n",txs, siglen);
|
AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ int test_ldpc(short No_iteration,
|
|||||||
unsigned int *crc_misses,
|
unsigned int *crc_misses,
|
||||||
time_stats_t *time_optim,
|
time_stats_t *time_optim,
|
||||||
time_stats_t *time_decoder,
|
time_stats_t *time_decoder,
|
||||||
n_iter_stats_t * dec_iter)
|
n_iter_stats_t *dec_iter)
|
||||||
{
|
{
|
||||||
//clock initiate
|
//clock initiate
|
||||||
//time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder;
|
//time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder;
|
||||||
@@ -146,12 +146,12 @@ int test_ldpc(short No_iteration,
|
|||||||
double *modulated_input[MAX_NUM_DLSCH_SEGMENTS];
|
double *modulated_input[MAX_NUM_DLSCH_SEGMENTS];
|
||||||
char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS];
|
char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS];
|
||||||
unsigned int i,j,trial=0;
|
unsigned int i,j,trial=0;
|
||||||
short BG,Zc,Kb,nrows;//,ncols;
|
short BG=0,Zc,Kb=0,nrows=0;//,ncols;
|
||||||
int no_punctured_columns,removed_bit;
|
int no_punctured_columns,removed_bit;
|
||||||
int i1;
|
int i1;
|
||||||
int R_ind = 0;
|
int R_ind = 0;
|
||||||
//Table of possible lifting sizes
|
//Table of possible lifting sizes
|
||||||
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
|
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
|
||||||
//int n_segments=1;
|
//int n_segments=1;
|
||||||
int code_rate_vec[8] = {15, 13, 25, 12, 23, 34, 56, 89};
|
int code_rate_vec[8] = {15, 13, 25, 12, 23, 34, 56, 89};
|
||||||
//double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88};
|
//double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88};
|
||||||
@@ -227,15 +227,15 @@ int test_ldpc(short No_iteration,
|
|||||||
//determine number of bits in codeword
|
//determine number of bits in codeword
|
||||||
if (block_length>3840)
|
if (block_length>3840)
|
||||||
{
|
{
|
||||||
BG=1;
|
BG = 1;
|
||||||
Kb = 22;
|
Kb = 22;
|
||||||
nrows=46; //parity check bits
|
nrows = 46; //parity check bits
|
||||||
//ncols=22; //info bits
|
//ncols=22; //info bits
|
||||||
}
|
}
|
||||||
else if (block_length<=3840)
|
else if (block_length<=3840)
|
||||||
{
|
{
|
||||||
BG=2;
|
BG = 2;
|
||||||
nrows=42; //parity check bits
|
nrows = 42; //parity check bits
|
||||||
//ncols=10; // info bits
|
//ncols=10; // info bits
|
||||||
|
|
||||||
if (block_length>640)
|
if (block_length>640)
|
||||||
@@ -246,7 +246,7 @@ int test_ldpc(short No_iteration,
|
|||||||
Kb = 8;
|
Kb = 8;
|
||||||
else
|
else
|
||||||
Kb = 6;
|
Kb = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nom_rate == 1)
|
if (nom_rate == 1)
|
||||||
if (denom_rate == 5)
|
if (denom_rate == 5)
|
||||||
@@ -298,7 +298,7 @@ int test_ldpc(short No_iteration,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length,BG, Zc, Kb);
|
printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length, BG, Zc, Kb);
|
||||||
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*(1/((float)nom_rate/(float)denom_rate)))/Zc;
|
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*(1/((float)nom_rate/(float)denom_rate)))/Zc;
|
||||||
// printf("puncture:%d\n",no_punctured_columns);
|
// printf("puncture:%d\n",no_punctured_columns);
|
||||||
removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate));
|
removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate));
|
||||||
@@ -330,11 +330,11 @@ int test_ldpc(short No_iteration,
|
|||||||
|
|
||||||
if (ntrials==1)
|
if (ntrials==1)
|
||||||
for (j=0;j<n_segments;j++)
|
for (j=0;j<n_segments;j++)
|
||||||
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
|
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
|
||||||
if (channel_input[j][i]!=channel_input_optim[j][i]) {
|
if (channel_input[j][i]!=channel_input_optim[j][i]) {
|
||||||
printf("differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
|
printf("differ in seg %u pos %u (%u,%u)\n", j, i, channel_input[j][i], channel_input_optim[j][i]);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
//else{
|
//else{
|
||||||
// printf("NOT differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
|
// printf("NOT differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
|
||||||
// }
|
// }
|
||||||
@@ -344,7 +344,6 @@ int test_ldpc(short No_iteration,
|
|||||||
printf("removed_bit: %d\n", removed_bit);
|
printf("removed_bit: %d\n", removed_bit);
|
||||||
printf("To: %d\n", (Kb+nrows-no_punctured_columns) * Zc-removed_bit);
|
printf("To: %d\n", (Kb+nrows-no_punctured_columns) * Zc-removed_bit);
|
||||||
printf("number of undecoded bits: %d\n", (Kb+nrows-no_punctured_columns-2) * Zc-removed_bit);
|
printf("number of undecoded bits: %d\n", (Kb+nrows-no_punctured_columns-2) * Zc-removed_bit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//print_meas_now(&time, "", stdout);
|
//print_meas_now(&time, "", stdout);
|
||||||
@@ -359,7 +358,7 @@ int test_ldpc(short No_iteration,
|
|||||||
for (i = 2*Zc; i < (Kb+nrows-no_punctured_columns) * Zc-removed_bit; i++) {
|
for (i = 2*Zc; i < (Kb+nrows-no_punctured_columns) * Zc-removed_bit; i++) {
|
||||||
#ifdef DEBUG_CODER
|
#ifdef DEBUG_CODER
|
||||||
if ((i&0xf)==0)
|
if ((i&0xf)==0)
|
||||||
printf("\ne %d..%d: ",i,i+15);
|
printf("\ne %u..%u: ",i,i+15);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (channel_input[j][i-2*Zc]==0)
|
if (channel_input[j][i-2*Zc]==0)
|
||||||
@@ -369,7 +368,7 @@ int test_ldpc(short No_iteration,
|
|||||||
|
|
||||||
///channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
|
///channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
|
||||||
//channel_output_fixed[i] = (char) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
|
//channel_output_fixed[i] = (char) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
|
||||||
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
|
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
|
||||||
|
|
||||||
//channel_output_fixed[i] = (char)quantize(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
|
//channel_output_fixed[i] = (char)quantize(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
|
||||||
channel_output_fixed[j][i] = (char)quantize(sigma/4.0/4.0,modulated_input[j][i] + sigma*gaussdouble(0.0,1.0),qbits);
|
channel_output_fixed[j][i] = (char)quantize(sigma/4.0/4.0,modulated_input[j][i] + sigma*gaussdouble(0.0,1.0),qbits);
|
||||||
@@ -383,11 +382,11 @@ int test_ldpc(short No_iteration,
|
|||||||
//Uncoded BER
|
//Uncoded BER
|
||||||
if (channel_output_fixed[j][i]<0)
|
if (channel_output_fixed[j][i]<0)
|
||||||
channel_output_uncoded[j][i]=1; //QPSK demod
|
channel_output_uncoded[j][i]=1; //QPSK demod
|
||||||
else
|
else
|
||||||
channel_output_uncoded[j][i]=0;
|
channel_output_uncoded[j][i]=0;
|
||||||
|
|
||||||
if (channel_output_uncoded[j][i] != channel_input[j][i-2*Zc])
|
if (channel_output_uncoded[j][i] != channel_input[j][i-2*Zc])
|
||||||
*errors_bit_uncoded = (*errors_bit_uncoded) + 1;
|
*errors_bit_uncoded = (*errors_bit_uncoded) + 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
} // End segments
|
} // End segments
|
||||||
@@ -541,7 +540,7 @@ int main(int argc, char *argv[])
|
|||||||
time_stats_t time_optim[10], time_decoder[10];
|
time_stats_t time_optim[10], time_decoder[10];
|
||||||
n_iter_stats_t dec_iter[3];
|
n_iter_stats_t dec_iter[3];
|
||||||
|
|
||||||
short BG,Zc,Kb;
|
short BG=0,Zc,Kb;
|
||||||
|
|
||||||
while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1)
|
while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1)
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -571,8 +570,8 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S':
|
||||||
n_segments = atof(optarg);
|
n_segments = atof(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
SNR_step = atof(optarg);
|
SNR_step = atof(optarg);
|
||||||
@@ -583,8 +582,8 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'u':
|
case 'u':
|
||||||
test_uncoded = atoi(optarg);
|
test_uncoded = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
@@ -622,14 +621,14 @@ int main(int argc, char *argv[])
|
|||||||
//determine number of bits in codeword
|
//determine number of bits in codeword
|
||||||
if (block_length>3840)
|
if (block_length>3840)
|
||||||
{
|
{
|
||||||
BG=1;
|
BG = 1;
|
||||||
Kb = 22;
|
Kb = 22;
|
||||||
//nrows=46; //parity check bits
|
//nrows=46; //parity check bits
|
||||||
//ncols=22; //info bits
|
//ncols=22; //info bits
|
||||||
}
|
}
|
||||||
else if (block_length<=3840)
|
else if (block_length<=3840)
|
||||||
{
|
{
|
||||||
BG=2;
|
BG = 2;
|
||||||
//nrows=42; //parity check bits
|
//nrows=42; //parity check bits
|
||||||
//ncols=10; // info bits
|
//ncols=10; // info bits
|
||||||
|
|
||||||
@@ -689,9 +688,9 @@ int main(int argc, char *argv[])
|
|||||||
time_decoder,
|
time_decoder,
|
||||||
dec_iter);
|
dec_iter);
|
||||||
|
|
||||||
printf("SNR %f, BLER %f (%d/%d)\n",SNR,(float)decoded_errors[i]/(float)n_trials,decoded_errors[i],n_trials);
|
printf("SNR %f, BLER %f (%u/%d)\n", SNR, (float)decoded_errors[i]/(float)n_trials, decoded_errors[i], n_trials);
|
||||||
printf("SNR %f, BER %f (%d/%d)\n",SNR,(float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments ,decoded_errors[i],n_trials);
|
printf("SNR %f, BER %f (%u/%d)\n", SNR, (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments, decoded_errors[i], n_trials);
|
||||||
printf("SNR %f, Uncoded BER %f (%d/%d)\n",SNR,errors_bit_uncoded/(float)n_trials/(double)n_segments ,decoded_errors[i],n_trials);
|
printf("SNR %f, Uncoded BER %f (%u/%d)\n",SNR, errors_bit_uncoded/(float)n_trials/(double)n_segments, decoded_errors[i], n_trials);
|
||||||
printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter->n_iter_mean);
|
printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter->n_iter_mean);
|
||||||
printf("SNR %f, Std iterations: %f\n",SNR, dec_iter->n_iter_std);
|
printf("SNR %f, Std iterations: %f\n",SNR, dec_iter->n_iter_std);
|
||||||
printf("SNR %f, Max iterations: %d\n",SNR, dec_iter->n_iter_max);
|
printf("SNR %f, Max iterations: %d\n",SNR, dec_iter->n_iter_max);
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,vo
|
|||||||
#endif
|
#endif
|
||||||
for (int i=0; i<polarParams->encoderLength; i++) {
|
for (int i=0; i<polarParams->encoderLength; i++) {
|
||||||
#ifdef DEBUG_POLAR_ENCODER
|
#ifdef DEBUG_POLAR_ENCODER
|
||||||
printf("%u<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
printf("%d<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]);
|
||||||
#endif
|
#endif
|
||||||
tmp0 = (*in128&(((uint128_t)1)<<polarParams->rate_matching_pattern[i]));
|
tmp0 = (*in128&(((uint128_t)1)<<polarParams->rate_matching_pattern[i]));
|
||||||
if (tmp0!=0) {
|
if (tmp0!=0) {
|
||||||
|
|||||||
@@ -30,12 +30,12 @@
|
|||||||
//#define DEBUG_SEGMENTATION
|
//#define DEBUG_SEGMENTATION
|
||||||
|
|
||||||
int32_t nr_segmentation(unsigned char *input_buffer,
|
int32_t nr_segmentation(unsigned char *input_buffer,
|
||||||
unsigned char **output_buffers,
|
unsigned char **output_buffers,
|
||||||
unsigned int B,
|
unsigned int B,
|
||||||
unsigned int *C,
|
unsigned int *C,
|
||||||
unsigned int *K,
|
unsigned int *K,
|
||||||
unsigned int *Zout, // [hna] Zout is Zc
|
unsigned int *Zout, // [hna] Zout is Zc
|
||||||
unsigned int *F)
|
unsigned int *F)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned int L,Bprime,Bprime_by_C,Z,r,Kb,k,s,crc,Kprime;
|
unsigned int L,Bprime,Bprime_by_C,Z,r,Kb,k,s,crc,Kprime;
|
||||||
@@ -53,12 +53,12 @@ int32_t nr_segmentation(unsigned char *input_buffer,
|
|||||||
|
|
||||||
Bprime = B+((*C)*L);
|
Bprime = B+((*C)*L);
|
||||||
#ifdef DEBUG_SEGMENTATION
|
#ifdef DEBUG_SEGMENTATION
|
||||||
printf("Bprime %d\n",Bprime);
|
printf("Bprime %u\n",Bprime);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) {
|
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) {
|
||||||
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ else
|
|||||||
Z = (Bprime_by_C/Kb);
|
Z = (Bprime_by_C/Kb);
|
||||||
|
|
||||||
#ifdef DEBUG_SEGMENTATION
|
#ifdef DEBUG_SEGMENTATION
|
||||||
printf("nr segmetation B %d Bprime %d Bprime_by_C %d z %d \n", B, Bprime, Bprime_by_C, Z);
|
printf("nr segmetation B %u Bprime %u Bprime_by_C %u z %u \n", B, Bprime, Bprime_by_C, Z);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (Z <= 2) {
|
if (Z <= 2) {
|
||||||
@@ -110,7 +110,7 @@ else
|
|||||||
*K = *K + 8;
|
*K = *K + 8;
|
||||||
|
|
||||||
#ifdef DEBUG_SEGMENTATION
|
#ifdef DEBUG_SEGMENTATION
|
||||||
printf("Z_by_C %d , K2 %d\n",Z,*K);
|
printf("Z_by_C %u , K2 %u\n",Z,*K);
|
||||||
#endif
|
#endif
|
||||||
} else if (Z <= 256) { // increase by 4 bytes til here
|
} else if (Z <= 256) { // increase by 4 bytes til here
|
||||||
*K = (Z>>4)<<4;
|
*K = (Z>>4)<<4;
|
||||||
@@ -134,8 +134,8 @@ else
|
|||||||
*F = ((*K) - Bprime_by_C);
|
*F = ((*K) - Bprime_by_C);
|
||||||
|
|
||||||
#ifdef DEBUG_SEGMENTATION
|
#ifdef DEBUG_SEGMENTATION
|
||||||
printf("final nr seg output Z %d K %d F %d \n", *Zout, *K, *F);
|
printf("final nr seg output Z %u K %u F %u \n", *Zout, *K, *F);
|
||||||
printf("C %d, K %d, Bprime_bytes %d, Bprime %d, F %d\n",*C,*K,Bprime>>3,Bprime,*F);
|
printf("C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((input_buffer) && (output_buffers)) {
|
if ((input_buffer) && (output_buffers)) {
|
||||||
|
|||||||
@@ -36,10 +36,10 @@
|
|||||||
#endif*/
|
#endif*/
|
||||||
|
|
||||||
int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||||
unsigned char symbol,
|
unsigned char symbol,
|
||||||
unsigned char Ns,
|
unsigned char Ns,
|
||||||
int sample_offset,
|
int sample_offset,
|
||||||
int no_prefix)
|
int no_prefix)
|
||||||
{
|
{
|
||||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||||
NR_UE_COMMON *common_vars = &ue->common_vars;
|
NR_UE_COMMON *common_vars = &ue->common_vars;
|
||||||
@@ -131,8 +131,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
|
|
||||||
#ifdef DEBUG_FEP
|
#ifdef DEBUG_FEP
|
||||||
// if (ue->frame <100)
|
// if (ue->frame <100)
|
||||||
/*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx,Ns, symbol,
|
/*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, slot_offset %u, sample_offset %d,rx_offset %u, frame_length_samples %u\n",
|
||||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,sample_offset,rx_offset,frame_length_samples);
|
ue->proc.proc_rxtx[(Ns)&1].frame_rx, Ns, symbol, nb_prefix_samples, nb_prefix_samples0, slot_offset, sample_offset, rx_offset, frame_length_samples);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (symbol==0) {
|
if (symbol==0) {
|
||||||
@@ -192,7 +192,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
|
|
||||||
#ifdef DEBUG_FEP
|
#ifdef DEBUG_FEP
|
||||||
// if (ue->frame <100)
|
// if (ue->frame <100)
|
||||||
printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol,rx_offset);
|
printf("slot_fep: frame %d: symbol %d rx_offset %u\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol, rx_offset);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,14 +48,13 @@ short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,2
|
|||||||
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
|
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
unsigned int *nr_gold_pdsch,
|
unsigned int *nr_gold_pdsch,
|
||||||
int32_t *output,
|
int32_t *output,
|
||||||
unsigned short p,
|
unsigned short p,
|
||||||
unsigned char lp,
|
unsigned char lp,
|
||||||
unsigned short nb_pdsch_rb)
|
unsigned short nb_pdsch_rb)
|
||||||
{
|
{
|
||||||
int8_t w,config_type;
|
int8_t w,config_type;
|
||||||
short *mod_table;
|
short *mod_table;
|
||||||
@@ -101,15 +100,15 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
|
||||||
uint8_t eNB_offset,
|
|
||||||
unsigned int Ns,
|
|
||||||
unsigned int *nr_gold_pdcch,
|
|
||||||
int32_t *output,
|
|
||||||
unsigned short p,
|
|
||||||
unsigned short nb_rb_coreset)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||||
|
uint8_t eNB_offset,
|
||||||
|
unsigned int Ns,
|
||||||
|
unsigned int *nr_gold_pdcch,
|
||||||
|
int32_t *output,
|
||||||
|
unsigned short p,
|
||||||
|
unsigned short nb_rb_coreset)
|
||||||
|
{
|
||||||
uint8_t idx=0;
|
uint8_t idx=0;
|
||||||
//uint8_t pdcch_rb_offset =0;
|
//uint8_t pdcch_rb_offset =0;
|
||||||
//nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32;
|
//nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32;
|
||||||
@@ -121,8 +120,8 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
|||||||
((int16_t*)output)[(i<<1)+1] = nr_rx_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
((int16_t*)output)[(i<<1)+1] = nr_rx_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||||
#ifdef DEBUG_PDCCH
|
#ifdef DEBUG_PDCCH
|
||||||
if (i<8)
|
if (i<8)
|
||||||
printf("i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pdcch[(i<<1)>>5], (((nr_gold_pdcch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
printf("i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d addr %p\n", i, idx, nr_gold_pdcch[(i<<1)>>5], (((nr_gold_pdcch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||||
(((nr_gold_pdcch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1],&output[0]);
|
(((nr_gold_pdcch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1],&output[0]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -130,7 +129,10 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_pbch_dmrs_rx(int symbol,unsigned int *nr_gold_pbch,int32_t *output )
|
|
||||||
|
int nr_pbch_dmrs_rx(int symbol,
|
||||||
|
unsigned int *nr_gold_pbch,
|
||||||
|
int32_t *output)
|
||||||
{
|
{
|
||||||
int m,m0,m1;
|
int m,m0,m1;
|
||||||
uint8_t idx=0;
|
uint8_t idx=0;
|
||||||
@@ -164,6 +166,3 @@ int nr_pbch_dmrs_rx(int symbol,unsigned int *nr_gold_pbch,int32_t *output )
|
|||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,9 @@
|
|||||||
*
|
*
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned int scaling)
|
int16_t *base_sequence_less_than_36(unsigned int M_ZC,
|
||||||
|
unsigned int u,
|
||||||
|
unsigned int scaling)
|
||||||
{
|
{
|
||||||
char *phi_table;
|
char *phi_table;
|
||||||
int16_t *rv_overbar;
|
int16_t *rv_overbar;
|
||||||
@@ -77,7 +79,7 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned
|
|||||||
case 30:
|
case 30:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("function base_sequence_less_than 36_: unsupported base sequence size : %d \n", M_ZC);
|
printf("function base_sequence_less_than 36_: unsupported base sequence size : %u \n", M_ZC);
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -121,7 +123,10 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned
|
|||||||
*
|
*
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, unsigned int u, unsigned int v, unsigned int scaling)
|
int16_t *base_sequence_36_or_larger(unsigned int Msc_RS,
|
||||||
|
unsigned int u,
|
||||||
|
unsigned int v,
|
||||||
|
unsigned int scaling)
|
||||||
{
|
{
|
||||||
int16_t *rv_overbar;
|
int16_t *rv_overbar;
|
||||||
unsigned int N_ZC;
|
unsigned int N_ZC;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
|
|||||||
dlsch->harq_processes[i]->d[r] = NULL;
|
dlsch->harq_processes[i]->d[r] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
free16(dlsch->harq_processes[i],sizeof(NR_DL_gNB_HARQ_t));
|
free16(dlsch->harq_processes[i],sizeof(NR_DL_gNB_HARQ_t));
|
||||||
dlsch->harq_processes[i] = NULL;
|
dlsch->harq_processes[i] = NULL;
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
|
|||||||
|
|
||||||
free16(dlsch,sizeof(NR_gNB_DLSCH_t));
|
free16(dlsch,sizeof(NR_gNB_DLSCH_t));
|
||||||
dlsch = NULL;
|
dlsch = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,10 +269,11 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_dlsch_encoding(unsigned char *a,int frame,
|
int nr_dlsch_encoding(unsigned char *a,
|
||||||
uint8_t slot,
|
int frame,
|
||||||
NR_gNB_DLSCH_t *dlsch,
|
uint8_t slot,
|
||||||
NR_DL_FRAME_PARMS* frame_parms)
|
NR_gNB_DLSCH_t *dlsch,
|
||||||
|
NR_DL_FRAME_PARMS* frame_parms)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned int G;
|
unsigned int G;
|
||||||
@@ -418,7 +419,7 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_DLSCH_CODING
|
#ifdef DEBUG_DLSCH_CODING
|
||||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
printf("Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d)...\n",
|
||||||
r,
|
r,
|
||||||
G,
|
G,
|
||||||
Kr*3,
|
Kr*3,
|
||||||
|
|||||||
@@ -31,11 +31,11 @@
|
|||||||
|
|
||||||
|
|
||||||
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
||||||
uint8_t eNB_offset,
|
uint8_t eNB_offset,
|
||||||
unsigned char Ns,
|
unsigned char Ns,
|
||||||
unsigned char symbol,
|
unsigned char symbol,
|
||||||
int dmrss,
|
int dmrss,
|
||||||
NR_UE_SSB *current_ssb)
|
NR_UE_SSB *current_ssb)
|
||||||
{
|
{
|
||||||
int pilot[200] __attribute__((aligned(16)));
|
int pilot[200] __attribute__((aligned(16)));
|
||||||
unsigned char aarx;
|
unsigned char aarx;
|
||||||
@@ -149,7 +149,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
|||||||
current_ssb->c_im +=ch[1];
|
current_ssb->c_im +=ch[1];
|
||||||
|
|
||||||
#ifdef DEBUG_CH
|
#ifdef DEBUG_CH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pil+=2;
|
pil+=2;
|
||||||
@@ -165,7 +165,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
|||||||
current_ssb->c_im +=ch[1];
|
current_ssb->c_im +=ch[1];
|
||||||
|
|
||||||
#ifdef DEBUG_CH
|
#ifdef DEBUG_CH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
pil+=2;
|
pil+=2;
|
||||||
//re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
|
//re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
|
||||||
@@ -180,7 +180,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
|||||||
current_ssb->c_im +=ch[1];
|
current_ssb->c_im +=ch[1];
|
||||||
|
|
||||||
#ifdef DEBUG_CH
|
#ifdef DEBUG_CH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pil+=2;
|
pil+=2;
|
||||||
@@ -199,12 +199,12 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
|
|||||||
|
|
||||||
|
|
||||||
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||||
uint8_t eNB_offset,
|
uint8_t eNB_offset,
|
||||||
unsigned char Ns,
|
unsigned char Ns,
|
||||||
unsigned char symbol,
|
unsigned char symbol,
|
||||||
int dmrss,
|
int dmrss,
|
||||||
uint8_t ssb_index,
|
uint8_t ssb_index,
|
||||||
uint8_t n_hf)
|
uint8_t n_hf)
|
||||||
{
|
{
|
||||||
int pilot[200] __attribute__((aligned(16)));
|
int pilot[200] __attribute__((aligned(16)));
|
||||||
unsigned char aarx;
|
unsigned char aarx;
|
||||||
@@ -367,7 +367,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
|
|
||||||
#ifdef DEBUG_CH
|
#ifdef DEBUG_CH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fl,
|
multadd_real_vector_complex_scalar(fl,
|
||||||
ch,
|
ch,
|
||||||
@@ -387,7 +387,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
|
|
||||||
#ifdef DEBUG_CH
|
#ifdef DEBUG_CH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fm,
|
multadd_real_vector_complex_scalar(fm,
|
||||||
ch,
|
ch,
|
||||||
@@ -403,7 +403,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
|
|
||||||
#ifdef DEBUG_CH
|
#ifdef DEBUG_CH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
multadd_real_vector_complex_scalar(fr,
|
multadd_real_vector_complex_scalar(fr,
|
||||||
@@ -426,11 +426,11 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||||
uint8_t eNB_offset,
|
uint8_t eNB_offset,
|
||||||
unsigned char Ns,
|
unsigned char Ns,
|
||||||
unsigned char symbol,
|
unsigned char symbol,
|
||||||
unsigned short coreset_start_subcarrier,
|
unsigned short coreset_start_subcarrier,
|
||||||
unsigned short nb_rb_coreset)
|
unsigned short nb_rb_coreset)
|
||||||
{
|
{
|
||||||
int pilot[200] __attribute__((aligned(16)));
|
int pilot[200] __attribute__((aligned(16)));
|
||||||
unsigned char aarx,p;
|
unsigned char aarx,p;
|
||||||
@@ -550,7 +550,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDCCH
|
#ifdef DEBUG_PDCCH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fl,
|
multadd_real_vector_complex_scalar(fl,
|
||||||
ch,
|
ch,
|
||||||
@@ -566,7 +566,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDCCH
|
#ifdef DEBUG_PDCCH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fm,
|
multadd_real_vector_complex_scalar(fm,
|
||||||
ch,
|
ch,
|
||||||
@@ -656,14 +656,13 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||||
uint8_t eNB_offset,
|
uint8_t eNB_offset,
|
||||||
unsigned char Ns,
|
unsigned char Ns,
|
||||||
unsigned short p,
|
unsigned short p,
|
||||||
unsigned char symbol,
|
unsigned char symbol,
|
||||||
unsigned short bwp_start_subcarrier,
|
unsigned short bwp_start_subcarrier,
|
||||||
unsigned short nb_rb_pdsch)
|
unsigned short nb_rb_pdsch)
|
||||||
{
|
{
|
||||||
|
|
||||||
int pilot[1320] __attribute__((aligned(16)));
|
int pilot[1320] __attribute__((aligned(16)));
|
||||||
unsigned char aarx;
|
unsigned char aarx;
|
||||||
unsigned short k;
|
unsigned short k;
|
||||||
@@ -804,7 +803,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fm,
|
multadd_real_vector_complex_scalar(fm,
|
||||||
ch,
|
ch,
|
||||||
@@ -819,7 +818,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fmm,
|
multadd_real_vector_complex_scalar(fmm,
|
||||||
ch,
|
ch,
|
||||||
@@ -837,7 +836,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fm,
|
multadd_real_vector_complex_scalar(fm,
|
||||||
ch,
|
ch,
|
||||||
@@ -856,7 +855,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||||
printf("pilot %d: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fmr,
|
multadd_real_vector_complex_scalar(fmr,
|
||||||
ch,
|
ch,
|
||||||
@@ -872,7 +871,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
printf("pilot %u: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||||
#endif
|
#endif
|
||||||
multadd_real_vector_complex_scalar(fr,
|
multadd_real_vector_complex_scalar(fr,
|
||||||
ch,
|
ch,
|
||||||
|
|||||||
@@ -1175,7 +1175,7 @@ void nr_dci_decoding_procedure0(int s,
|
|||||||
} else {
|
} else {
|
||||||
nb_candidates = (L2 == 4) ? 4 : ((L2 == 8)? 2 : 1); // according to Table 10.1-1 (38.213 section 10.1)
|
nb_candidates = (L2 == 4) ? 4 : ((L2 == 8)? 2 : 1); // according to Table 10.1-1 (38.213 section 10.1)
|
||||||
#ifdef NR_PDCCH_DCI_DEBUG
|
#ifdef NR_PDCCH_DCI_DEBUG
|
||||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> we are in common searchSpace and nb_candidates=%d for L2=%d\n",nb_candidates,L2);
|
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> we are in common searchSpace and nb_candidates=%u for L2=%d\n", nb_candidates, L2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1214,7 +1214,7 @@ void nr_dci_decoding_procedure0(int s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NR_PDCCH_DCI_DEBUG
|
#ifdef NR_PDCCH_DCI_DEBUG
|
||||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%d) | nb_candidates(%d)\n",L2,p,nCCE[p],Yk,nb_candidates);
|
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%u) | nb_candidates(%u)\n", L2, p, nCCE[p], Yk, nb_candidates);
|
||||||
#endif
|
#endif
|
||||||
/* for (CCEind=0;
|
/* for (CCEind=0;
|
||||||
CCEind<nCCE2;
|
CCEind<nCCE2;
|
||||||
@@ -1227,7 +1227,7 @@ void nr_dci_decoding_procedure0(int s,
|
|||||||
if (L==4) m_p_s_L_max=1; // Table 10.1-2 is not defined for L=4
|
if (L==4) m_p_s_L_max=1; // Table 10.1-2 is not defined for L=4
|
||||||
|
|
||||||
#ifdef NR_PDCCH_DCI_DEBUG
|
#ifdef NR_PDCCH_DCI_DEBUG
|
||||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]);
|
if(0 <= L && L < 4) printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (m = 0; m < nb_candidates; m++) {
|
for (m = 0; m < nb_candidates; m++) {
|
||||||
@@ -1236,16 +1236,16 @@ void nr_dci_decoding_procedure0(int s,
|
|||||||
if (nCCE[p] < L2) return;
|
if (nCCE[p] < L2) return;
|
||||||
|
|
||||||
#ifdef NR_PDCCH_DCI_DEBUG
|
#ifdef NR_PDCCH_DCI_DEBUG
|
||||||
int debug1 = nCCE[p] / L2;
|
int debug1 = nCCE[p] / L2;
|
||||||
int debug2 = L2*m_p_s_L_max;
|
int debug2 = L2*m_p_s_L_max;
|
||||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",debug1,p,nCCE[p],L2);
|
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",debug1,p,nCCE[p],L2);
|
||||||
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",debug2,L2,m_p_s_L_max);
|
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",debug2,L2,m_p_s_L_max);
|
||||||
#endif
|
#endif
|
||||||
CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2);
|
CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2);
|
||||||
#ifdef NR_PDCCH_DCI_DEBUG
|
#ifdef NR_PDCCH_DCI_DEBUG
|
||||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEind(%d) = (((Yk(%d) + ((m(%d)*nCCE[p](%d))/(L2(%d)*m_p_s_L_max(%d)))) % (nCCE[p] / L2)) * L2)\n",
|
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEind(%d) = (((Yk(%u) + ((m(%u)*nCCE[p](%d))/(L2(%d)*m_p_s_L_max(%d)))) %% (nCCE[p] / L2)) * L2)\n",
|
||||||
CCEind,Yk,m,nCCE[p],L2,m_p_s_L_max);
|
CCEind,Yk,m,nCCE[p],L2,m_p_s_L_max);
|
||||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> n_candidate(m)=%d | CCEind=%d |",m,CCEind);
|
printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> n_candidate(m)=%u | CCEind=%d |",m,CCEind);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (CCEind < 32)
|
if (CCEind < 32)
|
||||||
@@ -1254,7 +1254,7 @@ void nr_dci_decoding_procedure0(int s,
|
|||||||
CCEmap = CCEmap1;
|
CCEmap = CCEmap1;
|
||||||
else if (CCEind < 96)
|
else if (CCEind < 96)
|
||||||
CCEmap = CCEmap2;
|
CCEmap = CCEmap2;
|
||||||
else AssertFatal(1==0,"Illegal CCEind %d (Yk %d, m %d, nCCE %d, L2 %d\n",CCEind, Yk, m, nCCE[p], L2);
|
else AssertFatal(1==0,"Illegal CCEind %d (Yk %u, m %u, nCCE %d, L2 %d\n", CCEind, Yk, m, nCCE[p], L2);
|
||||||
|
|
||||||
switch (L2) {
|
switch (L2) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1286,7 +1286,7 @@ void nr_dci_decoding_procedure0(int s,
|
|||||||
CCEmap_cand = (*CCEmap) & CCEmap_mask;
|
CCEmap_cand = (*CCEmap) & CCEmap_mask;
|
||||||
// CCE is not allocated yet
|
// CCE is not allocated yet
|
||||||
#ifdef NR_PDCCH_DCI_DEBUG
|
#ifdef NR_PDCCH_DCI_DEBUG
|
||||||
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEmap_cand=%d \n",CCEmap_cand);
|
printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEmap_cand=%u \n",CCEmap_cand);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (CCEmap_cand == 0) {
|
if (CCEmap_cand == 0) {
|
||||||
|
|||||||
@@ -379,11 +379,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
|||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot]);
|
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot]);
|
||||||
#if DISABLE_LOG_X
|
#if DISABLE_LOG_X
|
||||||
printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,nr_tti_rx,slot,
|
printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",
|
||||||
symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
frame,nr_tti_rx,slot,symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||||
#else
|
#else
|
||||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,nr_tti_rx,slot,symbol,
|
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",
|
||||||
ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
frame,nr_tti_rx,slot,symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
|||||||
(i!=(nushiftmod4+8))) {
|
(i!=(nushiftmod4+8))) {
|
||||||
rxF_ext[j]=rxF[rx_offset];
|
rxF_ext[j]=rxF[rx_offset];
|
||||||
#ifdef DEBUG_PBCH
|
#ifdef DEBUG_PBCH
|
||||||
printf("rxF ext[%d] = (%d,%d) rxF [%d]= (%d,%d)\n",(9*rb) + j,
|
printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(9*rb) + j,
|
||||||
((int16_t *)&rxF_ext[j])[0],
|
((int16_t *)&rxF_ext[j])[0],
|
||||||
((int16_t *)&rxF_ext[j])[1],
|
((int16_t *)&rxF_ext[j])[1],
|
||||||
rx_offset,
|
rx_offset,
|
||||||
@@ -116,7 +116,7 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
|||||||
(i!=(nushiftmod4+8))) {
|
(i!=(nushiftmod4+8))) {
|
||||||
rxF_ext[j]=rxF[rx_offset];
|
rxF_ext[j]=rxF[rx_offset];
|
||||||
#ifdef DEBUG_PBCH
|
#ifdef DEBUG_PBCH
|
||||||
printf("rxF ext[%d] = (%d,%d) rxF [%d]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j,
|
printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j,
|
||||||
((int16_t *)&rxF_ext[j])[0],
|
((int16_t *)&rxF_ext[j])[0],
|
||||||
((int16_t *)&rxF_ext[j])[1],
|
((int16_t *)&rxF_ext[j])[1],
|
||||||
rx_offset,
|
rx_offset,
|
||||||
|
|||||||
@@ -44,8 +44,7 @@
|
|||||||
|
|
||||||
void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
|
void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
|
||||||
{
|
{
|
||||||
int i;
|
int i, r;
|
||||||
int r;
|
|
||||||
|
|
||||||
if (ulsch) {
|
if (ulsch) {
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
@@ -87,10 +86,10 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL,
|
||||||
NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, uint8_t abstraction_flag)
|
int number_of_harq_pids,
|
||||||
|
uint8_t abstraction_flag)
|
||||||
{
|
{
|
||||||
|
|
||||||
NR_UE_ULSCH_t *ulsch;
|
NR_UE_ULSCH_t *ulsch;
|
||||||
unsigned char exit_flag = 0,i,r;
|
unsigned char exit_flag = 0,i,r;
|
||||||
unsigned char bw_scaling =1;
|
unsigned char bw_scaling =1;
|
||||||
@@ -187,12 +186,10 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||||
NR_DL_FRAME_PARMS* frame_parms,
|
NR_DL_FRAME_PARMS* frame_parms,
|
||||||
uint8_t harq_pid)
|
uint8_t harq_pid)
|
||||||
{
|
{
|
||||||
|
|
||||||
/////////////////////////parameters and variables declaration/////////////////////////
|
/////////////////////////parameters and variables declaration/////////////////////////
|
||||||
///////////
|
///////////
|
||||||
|
|
||||||
@@ -376,7 +373,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_CODING
|
#ifdef DEBUG_DLSCH_CODING
|
||||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
printf("Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d)...\n",
|
||||||
r,
|
r,
|
||||||
G,
|
G,
|
||||||
Kr*3,
|
Kr*3,
|
||||||
|
|||||||
@@ -234,8 +234,8 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
|||||||
if (N_ID_2 == 0) {
|
if (N_ID_2 == 0) {
|
||||||
char output_file[255];
|
char output_file[255];
|
||||||
char sequence_name[255];
|
char sequence_name[255];
|
||||||
sprintf(output_file, "pss_seq_%d_%d.m", N_ID_2, length);
|
sprintf(output_file, "pss_seq_%d_%u.m", N_ID_2, length);
|
||||||
sprintf(sequence_name, "pss_seq_%d_%d", N_ID_2, length);
|
sprintf(sequence_name, "pss_seq_%d_%u", N_ID_2, length);
|
||||||
printf("file %s sequence %s\n", output_file, sequence_name);
|
printf("file %s sequence %s\n", output_file, sequence_name);
|
||||||
|
|
||||||
LOG_M(output_file, sequence_name, primary_synchro, LENGTH_PSS_NR, 1, 1);
|
LOG_M(output_file, sequence_name, primary_synchro, LENGTH_PSS_NR, 1, 1);
|
||||||
@@ -298,14 +298,14 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
|||||||
if (N_ID_2 == 0) {
|
if (N_ID_2 == 0) {
|
||||||
char output_file[255];
|
char output_file[255];
|
||||||
char sequence_name[255];
|
char sequence_name[255];
|
||||||
sprintf(output_file, "%s%d_%d%s","pss_seq_t_", N_ID_2, length, ".m");
|
sprintf(output_file, "%s%d_%u%s","pss_seq_t_", N_ID_2, length, ".m");
|
||||||
sprintf(sequence_name, "%s%d_%d","pss_seq_t_", N_ID_2, length);
|
sprintf(sequence_name, "%s%d_%u","pss_seq_t_", N_ID_2, length);
|
||||||
|
|
||||||
printf("file %s sequence %s\n", output_file, sequence_name);
|
printf("file %s sequence %s\n", output_file, sequence_name);
|
||||||
|
|
||||||
LOG_M(output_file, sequence_name, primary_synchro_time, length, 1, 1);
|
LOG_M(output_file, sequence_name, primary_synchro_time, length, 1, 1);
|
||||||
sprintf(output_file, "%s%d_%d%s","pss_seq_f_", N_ID_2, length, ".m");
|
sprintf(output_file, "%s%d_%u%s","pss_seq_f_", N_ID_2, length, ".m");
|
||||||
sprintf(sequence_name, "%s%d_%d","pss_seq_f_", N_ID_2, length);
|
sprintf(sequence_name, "%s%d_%u","pss_seq_f_", N_ID_2, length);
|
||||||
LOG_M(output_file, sequence_name, synchroF_tmp, length, 1, 1);
|
LOG_M(output_file, sequence_name, synchroF_tmp, length, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -900,7 +900,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
|
|||||||
pss_source = pss_index;
|
pss_source = pss_index;
|
||||||
|
|
||||||
#ifdef DEBUG_PSS_NR
|
#ifdef DEBUG_PSS_NR
|
||||||
printf("pss_index %d: n %6d peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]);
|
printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3044,7 +3044,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,
|
|||||||
&format_found,
|
&format_found,
|
||||||
crc_scrambled_values);
|
crc_scrambled_values);
|
||||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt);
|
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT);
|
||||||
|
|||||||
@@ -922,7 +922,7 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size
|
|||||||
/* a valid resource has already be found outside this function */
|
/* a valid resource has already be found outside this function */
|
||||||
resource_set_found = TRUE;
|
resource_set_found = TRUE;
|
||||||
ready_pucch_resource_id = TRUE;
|
ready_pucch_resource_id = TRUE;
|
||||||
pucch_resource_indicator = pucch_resource_indicator;
|
//pucch_resource_indicator = pucch_resource_indicator;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resource_set_found == TRUE) {
|
if (resource_set_found == TRUE) {
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ int main(int argc, char **argv)
|
|||||||
mod_order = nr_get_Qm(Imcs, 1);
|
mod_order = nr_get_Qm(Imcs, 1);
|
||||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||||
TBS = nr_compute_tbs(Imcs, nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, Nl);
|
TBS = nr_compute_tbs(Imcs, nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, Nl);
|
||||||
printf("available bits %d TBS %d mod_order %d\n", available_bits, TBS, mod_order);
|
printf("available bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
|
||||||
//dlsch->harq_ids[subframe]= 0;
|
//dlsch->harq_ids[subframe]= 0;
|
||||||
rel15->n_prb = nb_rb;
|
rel15->n_prb = nb_rb;
|
||||||
rel15->nb_symbols = nb_symb_sch;
|
rel15->nb_symbols = nb_symb_sch;
|
||||||
@@ -463,7 +463,7 @@ int main(int argc, char **argv)
|
|||||||
//estimated_output = harq_process->b;
|
//estimated_output = harq_process->b;
|
||||||
|
|
||||||
#ifdef DEBUG_NR_DLSCHSIM
|
#ifdef DEBUG_NR_DLSCHSIM
|
||||||
for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]);
|
for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*for (int i=0; i<TBS/8; i++)
|
/*for (int i=0; i<TBS/8; i++)
|
||||||
@@ -548,7 +548,7 @@ int main(int argc, char **argv)
|
|||||||
if (errors_bit > 0) {
|
if (errors_bit > 0) {
|
||||||
n_false_positive++;
|
n_false_positive++;
|
||||||
if (n_trials == 1)
|
if (n_trials == 1)
|
||||||
printf("errors_bit %d (trial %d)\n", errors_bit, trial);
|
printf("errors_bit %u (trial %d)\n", errors_bit, trial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -386,8 +386,8 @@ int main(int argc, char **argv)
|
|||||||
mod_order = nr_get_Qm(Imcs, 1);
|
mod_order = nr_get_Qm(Imcs, 1);
|
||||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||||
TBS = nr_compute_tbs(Imcs, nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, Nl);
|
TBS = nr_compute_tbs(Imcs, nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, Nl);
|
||||||
printf("\n");
|
|
||||||
printf("available bits %d TBS %d mod_order %d\n", available_bits, TBS, mod_order);
|
printf("\nAvailable bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
|
||||||
|
|
||||||
/////////// setting rel15_ul parameters ///////////
|
/////////// setting rel15_ul parameters ///////////
|
||||||
rel15_ul->number_rbs = nb_rb;
|
rel15_ul->number_rbs = nb_rb;
|
||||||
@@ -449,7 +449,7 @@ int main(int argc, char **argv)
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef DEBUG_NR_ULSCHSIM
|
#ifdef DEBUG_NR_ULSCHSIM
|
||||||
for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]);
|
for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/////////////////////////ULSCH coding/////////////////////////
|
/////////////////////////ULSCH coding/////////////////////////
|
||||||
@@ -536,7 +536,7 @@ int main(int argc, char **argv)
|
|||||||
if (errors_bit > 0) {
|
if (errors_bit > 0) {
|
||||||
n_false_positive++;
|
n_false_positive++;
|
||||||
if (n_trials == 1)
|
if (n_trials == 1)
|
||||||
printf("errors_bit %d (trial %d)\n", errors_bit, trial);
|
printf("errors_bit %u (trial %d)\n", errors_bit, trial);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ int main(int argc, char **argv)
|
|||||||
if (errors_bit > 0) {
|
if (errors_bit > 0) {
|
||||||
n_false_positive++;
|
n_false_positive++;
|
||||||
if (n_trials == 1)
|
if (n_trials == 1)
|
||||||
printf("errors_bit = %d (trial %d)\n", errors_bit, trial);
|
printf("errors_bit = %u (trial %d)\n", errors_bit, trial);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} // [hna] for (trial = 0; trial < n_trials; trial++)
|
} // [hna] for (trial = 0; trial < n_trials; trial++)
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ int32_t **txdata;
|
|||||||
|
|
||||||
int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||||
|
|
||||||
static inline void saif_meas(int frame_rx, int subframe_rx) {
|
static inline void saif_meas(unsigned int frame_rx, unsigned int subframe_rx) {
|
||||||
static latency_stat_t __thread latency_stat;
|
static latency_stat_t __thread latency_stat;
|
||||||
static struct timespec __thread last= {0};
|
static struct timespec __thread last= {0};
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
@@ -238,7 +238,7 @@ static inline void saif_meas(int frame_rx, int subframe_rx) {
|
|||||||
if ( (diffTime>=1500) || ( !(frame_rx%1024) && subframe_rx == 0 ) ) {
|
if ( (diffTime>=1500) || ( !(frame_rx%1024) && subframe_rx == 0 ) ) {
|
||||||
time_t current=time(NULL);
|
time_t current=time(NULL);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("%.2f Period stats cnt=%7.7ld 0.. 250=%7.7ld 250.. 500=%7.7ld 500.. 600=%7.7ld 600.. 700=%7.7ld 700.. 800=%7.7ld - (frame_rx=%d) - %s",
|
printf("%.2f Period stats cnt=%7.7ld 0.. 250=%7.7ld 250.. 500=%7.7ld 500.. 600=%7.7ld 600.. 700=%7.7ld 700.. 800=%7.7ld - (frame_rx=%u) - %s",
|
||||||
now.tv_sec+(double)now.tv_nsec/1e9,
|
now.tv_sec+(double)now.tv_nsec/1e9,
|
||||||
latency_stat.counter,
|
latency_stat.counter,
|
||||||
latency_stat.stat250, latency_stat.stat500,
|
latency_stat.stat250, latency_stat.stat500,
|
||||||
@@ -246,7 +246,7 @@ static inline void saif_meas(int frame_rx, int subframe_rx) {
|
|||||||
latency_stat.stat800,
|
latency_stat.stat800,
|
||||||
frame_rx,
|
frame_rx,
|
||||||
ctime(¤t));
|
ctime(¤t));
|
||||||
printf("%.2f Period stats cnt=%7.7ld 800.. 880=%7.7ld 880.. 960=%7.7ld 960..1040=%7.7ld 1040..1120=%7.7ld 1120..1200=%7.7ld - (frame_rx=%d) - %s",
|
printf("%.2f Period stats cnt=%7.7ld 800.. 880=%7.7ld 880.. 960=%7.7ld 960..1040=%7.7ld 1040..1120=%7.7ld 1120..1200=%7.7ld - (frame_rx=%u) - %s",
|
||||||
now.tv_sec+(double)now.tv_nsec/1e9,
|
now.tv_sec+(double)now.tv_nsec/1e9,
|
||||||
latency_stat.counter,
|
latency_stat.counter,
|
||||||
latency_stat.stat880, latency_stat.stat960,
|
latency_stat.stat880, latency_stat.stat960,
|
||||||
@@ -254,7 +254,7 @@ static inline void saif_meas(int frame_rx, int subframe_rx) {
|
|||||||
latency_stat.stat1200,
|
latency_stat.stat1200,
|
||||||
frame_rx,
|
frame_rx,
|
||||||
ctime(¤t));
|
ctime(¤t));
|
||||||
printf("%.2f Period stats cnt=%7.7ld 1200..1300=%7.7ld 1300..1500=%7.7ld 1500..2000=%7.7ld 2000..2500=%7.7ld >3000=%7.7ld - (frame_rx=%d) - %s",
|
printf("%.2f Period stats cnt=%7.7ld 1200..1300=%7.7ld 1300..1500=%7.7ld 1500..2000=%7.7ld 2000..2500=%7.7ld >3000=%7.7ld - (frame_rx=%u) - %s",
|
||||||
now.tv_sec+(double)now.tv_nsec/1e9,
|
now.tv_sec+(double)now.tv_nsec/1e9,
|
||||||
latency_stat.counter,
|
latency_stat.counter,
|
||||||
latency_stat.stat1300, latency_stat.stat1500,
|
latency_stat.stat1300, latency_stat.stat1500,
|
||||||
@@ -326,7 +326,7 @@ int main(void)
|
|||||||
openair0_device rf_device;
|
openair0_device rf_device;
|
||||||
openair0_timestamp timestamp = 0;
|
openair0_timestamp timestamp = 0;
|
||||||
|
|
||||||
int sub_frame = 0;
|
unsigned int sub_frame = 0;
|
||||||
unsigned int frame_rx = 0;
|
unsigned int frame_rx = 0;
|
||||||
|
|
||||||
unsigned int nb_antennas_tx = 1;
|
unsigned int nb_antennas_tx = 1;
|
||||||
@@ -922,7 +922,7 @@ int main(void)
|
|||||||
|
|
||||||
rxp[0] = (void*)&rxdata[0][sub_frame*nb_sample_per_tti];
|
rxp[0] = (void*)&rxdata[0][sub_frame*nb_sample_per_tti];
|
||||||
|
|
||||||
readBlockSize = rf_device.trx_read_func( &rf_device,
|
readBlockSize = rf_device.trx_read_func(&rf_device,
|
||||||
×tamp,
|
×tamp,
|
||||||
rxp,
|
rxp,
|
||||||
nb_sample_per_tti,
|
nb_sample_per_tti,
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ void *UE_thread(void *arg) {
|
|||||||
{
|
{
|
||||||
proc = rxtx_proc[i];
|
proc = rxtx_proc[i];
|
||||||
pthread_getname_np(proc->pthread_rxtx,threadname,128 );
|
pthread_getname_np(proc->pthread_rxtx,threadname,128 );
|
||||||
printf("RxTX Thread unlock latency on thread %s (it. %ld) (us) : max=%8.3f - mean=%8.3f - min=%8.3f\n",
|
printf("RxTX Thread unlock latency on thread %s (it. %lu) (us) : max=%8.3f - mean=%8.3f - min=%8.3f\n",
|
||||||
threadname,
|
threadname,
|
||||||
proc->syr_rdtsc_rxtx_th_unlock_iteration,
|
proc->syr_rdtsc_rxtx_th_unlock_iteration,
|
||||||
proc->syr_rdtsc_rxtx_th_unlock_max,
|
proc->syr_rdtsc_rxtx_th_unlock_max,
|
||||||
@@ -1192,9 +1192,9 @@ void histogram_save_in_csv( histo_time_t *histo , char *file_sufix)
|
|||||||
|
|
||||||
for ( i = 0; i < HISTOGRAM_SIZE; i++ ) {
|
for ( i = 0; i < HISTOGRAM_SIZE; i++ ) {
|
||||||
if ( i + 1 == HISTOGRAM_SIZE )
|
if ( i + 1 == HISTOGRAM_SIZE )
|
||||||
fprintf( fp, "%u+;%u\n", min_val, histo[i].count );
|
fprintf( fp, "%d+;%u\n", min_val, histo[i].count );
|
||||||
else
|
else
|
||||||
fprintf( fp, "%u-%.0f;%u\n", min_val, histo[i].max, histo[i].count );
|
fprintf( fp, "%d-%.0f;%u\n", min_val, histo[i].max, histo[i].count );
|
||||||
min_val = histo[i].max;
|
min_val = histo[i].max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user