Merge remote-tracking branch 'origin/develop' into NR_RRC_harq_hacks
This commit is contained in:
@@ -91,7 +91,7 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon;
|
||||
// NR_BeamFailureRecoveryConfig_t *beam_failure_recovery_config = &mac->RA_BeamFailureRecoveryConfig; // todo
|
||||
|
||||
int messagePowerOffsetGroupB, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3;
|
||||
int messagePowerOffsetGroupB = 0, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3 = 0;
|
||||
uint8_t noGroupB = 0, s_id, f_id, ul_carrier_id, msg1_FDM, prach_ConfigIndex, SFN_nbr, Msg3_size;
|
||||
|
||||
// NR_RSRP_Range_t rsrp_ThresholdSSB; // todo
|
||||
|
||||
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
|
||||
int format=0;
|
||||
//uint8_t extended_prefix_flag=0;
|
||||
FILE *input_fd=NULL;
|
||||
uint8_t nacktoack_flag=0;
|
||||
//uint8_t nacktoack_flag=0;
|
||||
int16_t amp=0x7FFF;
|
||||
int nr_tti_tx=0;
|
||||
uint64_t actual_payload=0,payload_received;
|
||||
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
|
||||
actual_payload=atoi(optarg);
|
||||
break;
|
||||
case 'T':
|
||||
nacktoack_flag=(uint8_t)atoi(optarg);
|
||||
//nacktoack_flag=(uint8_t)atoi(optarg);
|
||||
target_error_rate=0.001;
|
||||
break;
|
||||
default:
|
||||
@@ -338,7 +338,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
AssertFatal(((format < 2)&&(nr_bit<3)&&(actual_payload<4)) ||
|
||||
((format == 2)&&(nr_bit>2)&&(nr_bit<12)),"illegal combination format %d, nr_bit %d\n",
|
||||
((format == 2)&&(nr_bit>2)&&(nr_bit<65)),"illegal combination format %d, nr_bit %d\n",
|
||||
format,nr_bit);
|
||||
|
||||
actual_payload &= ((1<<nr_bit)-1);
|
||||
@@ -459,6 +459,8 @@ int main(int argc, char **argv)
|
||||
pucch_GroupHopping_t PUCCH_GroupHopping=UE->pucch_config_common_nr->pucch_GroupHopping;
|
||||
uint32_t hopping_id=UE->pucch_config_common_nr->hoppingId;
|
||||
uint32_t dmrs_scrambling_id = 0, data_scrambling_id=0;
|
||||
//t_nrPolar_params *currentPtr;
|
||||
|
||||
if(format==0){
|
||||
// for now we are not considering SR just HARQ-ACK
|
||||
if (nr_bit ==0)
|
||||
@@ -469,7 +471,8 @@ int main(int argc, char **argv)
|
||||
mcs=table2_mcs[actual_payload];
|
||||
else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag);
|
||||
}
|
||||
|
||||
else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL);
|
||||
|
||||
for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
|
||||
ack_nack_errors=0;
|
||||
n_errors = 0;
|
||||
@@ -500,7 +503,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
int rxlev = signal_energy(&rxdataF[aa][startingSymbolIndex*frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
// printf("rxlev %d (%d dB), sigma2 %f dB, SNR %f, TX %f\n",rxlev,dB_fixed(rxlev),sigma2_dB,SNR,10*log10((double)txlev*UE->frame_parms.ofdm_symbol_size/12));
|
||||
if (n_trials==1) printf("rxlev %d (%d dB), sigma2 %f dB, SNR %f, TX %f\n",rxlev,dB_fixed(rxlev),sigma2_dB,SNR,10*log10((double)txlev*UE->frame_parms.ofdm_symbol_size/12));
|
||||
if(format==0){
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t uci_pdu;
|
||||
nfapi_nr_pucch_pdu_t pucch_pdu;
|
||||
@@ -508,6 +511,8 @@ int main(int argc, char **argv)
|
||||
pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1;
|
||||
pucch_pdu.sequence_hop_flag = (PUCCH_GroupHopping>>1)&1;
|
||||
pucch_pdu.bit_len_harq = nr_bit;
|
||||
pucch_pdu.bit_len_csi_part1 = 0;
|
||||
pucch_pdu.bit_len_csi_part2 = 0;
|
||||
pucch_pdu.sr_flag = sr_flag;
|
||||
pucch_pdu.nr_of_symbols = nrofSymbols;
|
||||
pucch_pdu.hopping_id = hopping_id;
|
||||
@@ -536,7 +541,9 @@ int main(int argc, char **argv)
|
||||
pucch_pdu.subcarrier_spacing = 1;
|
||||
pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1;
|
||||
pucch_pdu.sequence_hop_flag = (PUCCH_GroupHopping>>1)&1;
|
||||
pucch_pdu.bit_len_harq = nr_bit;
|
||||
pucch_pdu.bit_len_csi_part1 = nr_bit;
|
||||
pucch_pdu.bit_len_harq = 0;
|
||||
pucch_pdu.bit_len_csi_part2 = 0;
|
||||
pucch_pdu.sr_flag = 0;
|
||||
pucch_pdu.nr_of_symbols = nrofSymbols;
|
||||
pucch_pdu.hopping_id = hopping_id;
|
||||
@@ -547,14 +554,15 @@ int main(int argc, char **argv)
|
||||
pucch_pdu.dmrs_scrambling_id = dmrs_scrambling_id;
|
||||
pucch_pdu.data_scrambling_id = data_scrambling_id;
|
||||
nr_decode_pucch2(gNB,nr_tti_tx,&uci_pdu,&pucch_pdu);
|
||||
int harq_bytes=pucch_pdu.bit_len_harq>>3;
|
||||
if ((pucch_pdu.bit_len_harq&7) > 0) harq_bytes++;
|
||||
for (int i=0;i<harq_bytes;i++)
|
||||
if (uci_pdu.harq.harq_payload[i] != ((int8_t*)&actual_payload)[i]) {
|
||||
int csi_part1_bytes=pucch_pdu.bit_len_csi_part1>>3;
|
||||
if ((pucch_pdu.bit_len_csi_part1&7) > 0) csi_part1_bytes++;
|
||||
for (int i=0;i<csi_part1_bytes;i++) {
|
||||
if (uci_pdu.csi_part1.csi_part1_payload[i] != ((uint8_t*)&actual_payload)[i]) {
|
||||
ack_nack_errors++;
|
||||
break;
|
||||
}
|
||||
free(uci_pdu.harq.harq_payload);
|
||||
}
|
||||
free(uci_pdu.csi_part1.csi_part1_payload);
|
||||
|
||||
}
|
||||
n_errors=((actual_payload^payload_received)&1)+(((actual_payload^payload_received)&2)>>1)+(((actual_payload^payload_received)&4)>>2)+n_errors;
|
||||
|
||||
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
|
||||
int trial, n_trials = 1, n_errors = 0, n_false_positive = 0, delay = 0;
|
||||
uint8_t n_tx = 1, n_rx = 1;
|
||||
//uint8_t transmission_mode = 1;
|
||||
uint16_t Nid_cell = 0;
|
||||
//uint16_t Nid_cell = 0;
|
||||
channel_desc_t *gNB2UE;
|
||||
uint8_t extended_prefix_flag = 0;
|
||||
//int8_t interf1 = -21, interf2 = -21;
|
||||
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
|
||||
int frame_length_complex_samples,frame_length_complex_samples_no_prefix;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
int loglvl = OAILOG_WARNING;
|
||||
uint64_t SSB_positions=0x01;
|
||||
//uint64_t SSB_positions=0x01;
|
||||
uint16_t nb_symb_sch = 12;
|
||||
int start_symbol = 2;
|
||||
uint16_t nb_rb = 50;
|
||||
@@ -377,6 +377,7 @@ int main(int argc, char **argv)
|
||||
printf("-P Print ULSCH performances\n");
|
||||
exit(-1);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user