Fixing critical warnings in pucchsim
This commit is contained in:
@@ -31,12 +31,12 @@ void nr_decode_pucch0( int32_t **rxdataF,
|
|||||||
uint16_t startingPRB, // should come from resource set
|
uint16_t startingPRB, // should come from resource set
|
||||||
uint8_t nr_bit) { // is number of UCI bits to be decoded
|
uint8_t nr_bit) { // is number of UCI bits to be decoded
|
||||||
int nr_sequences;
|
int nr_sequences;
|
||||||
uint8_t *mcs;
|
const uint8_t *mcs;
|
||||||
if(nr_bit==1){
|
if(nr_bit==1){
|
||||||
mcs=table1_mcs;
|
mcs=table1_mcs;
|
||||||
nr_sequences=4;
|
nr_sequences=4;
|
||||||
}
|
}
|
||||||
else if(nr_bit==2){
|
else{
|
||||||
mcs=table2_mcs;
|
mcs=table2_mcs;
|
||||||
nr_sequences=8;
|
nr_sequences=8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ void nr_group_sequence_hopping (pucch_GroupHopping_t PUCCH_GroupHopping,
|
|||||||
|
|
||||||
if (PUCCH_GroupHopping == enable) { // PUCCH_GroupHopping 'enabled'
|
if (PUCCH_GroupHopping == enable) { // PUCCH_GroupHopping 'enabled'
|
||||||
c_init = floor(n_id/30); // we initialize c_init to calculate u,v according to 6.3.2.2.1 of 38.211
|
c_init = floor(n_id/30); // we initialize c_init to calculate u,v according to 6.3.2.2.1 of 38.211
|
||||||
|
s = lte_gold_generic(&x1, &c_init, 1); // TS 38.211 Subclause 5.2.1
|
||||||
for (int m=0; m<8; m++) {
|
for (int m=0; m<8; m++) {
|
||||||
while(minShift >= l) {
|
while(minShift >= l) {
|
||||||
s = lte_gold_generic(&x1, &c_init, 0);
|
s = lte_gold_generic(&x1, &c_init, 0);
|
||||||
@@ -118,6 +119,7 @@ void nr_group_sequence_hopping (pucch_GroupHopping_t PUCCH_GroupHopping,
|
|||||||
|
|
||||||
if (PUCCH_GroupHopping == disable) { // PUCCH_GroupHopping 'disabled'
|
if (PUCCH_GroupHopping == disable) { // PUCCH_GroupHopping 'disabled'
|
||||||
c_init = (1<<5)*floor(n_id/30)+(n_id%30); // we initialize c_init to calculate u,v
|
c_init = (1<<5)*floor(n_id/30)+(n_id%30); // we initialize c_init to calculate u,v
|
||||||
|
s = lte_gold_generic(&x1, &c_init, 1); // TS 38.211 Subclause 5.2.1
|
||||||
f_ss = n_id%30;
|
f_ss = n_id%30;
|
||||||
l = 32, minShift = (2*nr_tti_tx+n_hop);
|
l = 32, minShift = (2*nr_tti_tx+n_hop);
|
||||||
|
|
||||||
|
|||||||
@@ -92,9 +92,6 @@ int main(int argc, char **argv)
|
|||||||
uint8_t snr1set=0;
|
uint8_t snr1set=0;
|
||||||
int **txdata;
|
int **txdata;
|
||||||
double **s_re,**s_im,**r_re,**r_im;
|
double **s_re,**s_im,**r_re,**r_im;
|
||||||
double iqim = 0.0;
|
|
||||||
double ip =0.0;
|
|
||||||
unsigned char pbch_pdu[6];
|
|
||||||
// int sync_pos, sync_pos_slot;
|
// int sync_pos, sync_pos_slot;
|
||||||
// FILE *rx_frame_file;
|
// FILE *rx_frame_file;
|
||||||
FILE *output_fd = NULL;
|
FILE *output_fd = NULL;
|
||||||
@@ -103,7 +100,7 @@ int main(int argc, char **argv)
|
|||||||
//int freq_offset;
|
//int freq_offset;
|
||||||
// int subframe_offset;
|
// int subframe_offset;
|
||||||
// char fname[40], vname[40];
|
// char fname[40], vname[40];
|
||||||
int trial,n_trials=1,n_errors=0,n_errors_payload=0;
|
int trial,n_trials=1,n_errors=0;
|
||||||
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
|
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
|
||||||
uint16_t Nid_cell=0;
|
uint16_t Nid_cell=0;
|
||||||
uint64_t SSB_positions=0x01;
|
uint64_t SSB_positions=0x01;
|
||||||
@@ -135,13 +132,8 @@ int main(int argc, char **argv)
|
|||||||
NR_DL_FRAME_PARMS *frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms;
|
||||||
nfapi_nr_config_request_t *gNB_config;
|
nfapi_nr_config_request_t *gNB_config;
|
||||||
|
|
||||||
int ret, payload_ret=0;
|
|
||||||
int run_initial_sync=0;
|
|
||||||
|
|
||||||
int loglvl=OAILOG_WARNING;
|
int loglvl=OAILOG_WARNING;
|
||||||
|
|
||||||
float target_error_rate = 0.01;
|
|
||||||
|
|
||||||
cpuf = get_cpu_freq_GHz();
|
cpuf = get_cpu_freq_GHz();
|
||||||
|
|
||||||
if ( load_configmodule(argc,argv) == 0) {
|
if ( load_configmodule(argc,argv) == 0) {
|
||||||
@@ -308,11 +300,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'I':
|
|
||||||
run_initial_sync=1;
|
|
||||||
target_error_rate=0.1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'L':
|
case 'L':
|
||||||
loglvl = atoi(optarg);
|
loglvl = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
@@ -458,8 +445,6 @@ int main(int argc, char **argv)
|
|||||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||||
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||||
//phy_init_nr_top(UE); //called from init_nr_ue_signal
|
//phy_init_nr_top(UE); //called from init_nr_ue_signal
|
||||||
/* if (run_initial_sync==1) UE->is_synchronized = 0;
|
|
||||||
else UE->is_synchronized = 1; */
|
|
||||||
|
|
||||||
UE->perfect_ce = 0;
|
UE->perfect_ce = 0;
|
||||||
|
|
||||||
@@ -478,7 +463,7 @@ int main(int argc, char **argv)
|
|||||||
// pucch_config_common_nr should assign values for this if not done before structure in ue being used by functions
|
// pucch_config_common_nr should assign values for this if not done before structure in ue being used by functions
|
||||||
uint8_t actual_payload=0,payload_received;//payload bits b7b6...b2b1b0 where b7..b3=0 b2b1=HARQ b0 is SR. payload maximum value is 7
|
uint8_t actual_payload=0,payload_received;//payload bits b7b6...b2b1b0 where b7..b3=0 b2b1=HARQ b0 is SR. payload maximum value is 7
|
||||||
uint8_t mcs;
|
uint8_t mcs;
|
||||||
int nr_bit=1;
|
int nr_bit=1; // maximum value possible is 2
|
||||||
/*if(nr_bit==1){
|
/*if(nr_bit==1){
|
||||||
mcs=table1_mcs[actual_payload];
|
mcs=table1_mcs[actual_payload];
|
||||||
}
|
}
|
||||||
@@ -494,7 +479,6 @@ int main(int argc, char **argv)
|
|||||||
printf("\nsnr1=%f\n",snr1);
|
printf("\nsnr1=%f\n",snr1);
|
||||||
for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
|
for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
|
||||||
n_errors = 0;
|
n_errors = 0;
|
||||||
n_errors_payload = 0;
|
|
||||||
sigma2_dB = 20*log10((double)amp/32767)-SNR;
|
sigma2_dB = 20*log10((double)amp/32767)-SNR;
|
||||||
sigma2 = pow(10,sigma2_dB/10);
|
sigma2 = pow(10,sigma2_dB/10);
|
||||||
printf("entering SNR value %f\n",SNR);
|
printf("entering SNR value %f\n",SNR);
|
||||||
|
|||||||
Reference in New Issue
Block a user