dlschsim fixed
This commit is contained in:
@@ -117,6 +117,7 @@ int main(int argc, char **argv)
|
|||||||
uint8_t mcs_table = 0;
|
uint8_t mcs_table = 0;
|
||||||
double DS_TDL = .03;
|
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) {
|
if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) {
|
||||||
exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n");
|
exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n");
|
||||||
@@ -125,7 +126,7 @@ int main(int argc, char **argv)
|
|||||||
//logInit();
|
//logInit();
|
||||||
randominit(0);
|
randominit(0);
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:")) != -1) {
|
while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:X:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
/*case 'f':
|
/*case 'f':
|
||||||
write_output_file = 1;
|
write_output_file = 1;
|
||||||
@@ -291,6 +292,11 @@ int main(int argc, char **argv)
|
|||||||
nb_rb = atoi(optarg);
|
nb_rb = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'X':
|
||||||
|
strncpy(gNBthreads, optarg, sizeof(gNBthreads));
|
||||||
|
gNBthreads[sizeof(gNBthreads)-1]=0;
|
||||||
|
break;
|
||||||
|
|
||||||
/*case 'x':
|
/*case 'x':
|
||||||
transmission_mode = atoi(optarg);
|
transmission_mode = atoi(optarg);
|
||||||
break;*/
|
break;*/
|
||||||
@@ -349,6 +355,8 @@ int main(int argc, char **argv)
|
|||||||
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
|
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
|
||||||
RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
|
RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
|
||||||
gNB = RC.gNB[0];
|
gNB = RC.gNB[0];
|
||||||
|
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||||
|
initTpool(gNBthreads, gNB->threadPool, true);
|
||||||
//gNB_config = &gNB->gNB_config;
|
//gNB_config = &gNB->gNB_config;
|
||||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||||
frame_parms->nb_antennas_tx = n_tx;
|
frame_parms->nb_antennas_tx = n_tx;
|
||||||
@@ -465,7 +473,6 @@ int main(int argc, char **argv)
|
|||||||
double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
|
double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
|
||||||
short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384);
|
short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384);
|
||||||
short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384);
|
short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384);
|
||||||
double errors_bit_uncoded = 0;
|
|
||||||
//unsigned char *estimated_output;
|
//unsigned char *estimated_output;
|
||||||
unsigned char *estimated_output_bit;
|
unsigned char *estimated_output_bit;
|
||||||
unsigned char *test_input_bit;
|
unsigned char *test_input_bit;
|
||||||
@@ -514,7 +521,6 @@ int main(int argc, char **argv)
|
|||||||
n_false_positive = 0;
|
n_false_positive = 0;
|
||||||
|
|
||||||
for (trial = 0; trial < n_trials; trial++) {
|
for (trial = 0; trial < n_trials; trial++) {
|
||||||
errors_bit_uncoded = 0;
|
|
||||||
for (i = 0; i < available_bits; i++) {
|
for (i = 0; i < available_bits; i++) {
|
||||||
#ifdef DEBUG_CODER
|
#ifdef DEBUG_CODER
|
||||||
if ((i&0xf)==0)
|
if ((i&0xf)==0)
|
||||||
@@ -523,12 +529,12 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
//if (i<16)
|
//if (i<16)
|
||||||
// printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]);
|
// printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]);
|
||||||
/*
|
|
||||||
if (dlsch->harq_process.f[i] == 0)
|
if (output[i] == 0)
|
||||||
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
|
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
|
||||||
else
|
else
|
||||||
modulated_input[i] = -1.0; ///sqrt(2);
|
modulated_input[i] = -1.0; ///sqrt(2);
|
||||||
*/
|
|
||||||
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
|
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
|
||||||
//SNR =10;
|
//SNR =10;
|
||||||
SNR_lin = pow(10, SNR / 10.0);
|
SNR_lin = pow(10, SNR / 10.0);
|
||||||
@@ -546,19 +552,14 @@ int main(int argc, char **argv)
|
|||||||
i,modulated_input[i],
|
i,modulated_input[i],
|
||||||
i,channel_output_fixed[i]);
|
i,channel_output_fixed[i]);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Uncoded BER
|
//Uncoded BER
|
||||||
if (channel_output_fixed[i] < 0)
|
if (channel_output_fixed[i] < 0)
|
||||||
channel_output_uncoded[i] = 1; //QPSK demod
|
channel_output_uncoded[i] = 1; //QPSK demod
|
||||||
else
|
else
|
||||||
channel_output_uncoded[i] = 0;
|
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)
|
|
||||||
//printf("errors bits uncoded %f\n", errors_bit_uncoded);
|
|
||||||
#ifdef DEBUG_CODER
|
#ifdef DEBUG_CODER
|
||||||
printf("\n");
|
printf("\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user