Merge remote-tracking branch 'origin/develop-nr' into nr_pdsch
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
echo "building ctags for openair1 and openair2 ..."
|
||||
ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair2/RRC/CELLULAR/ --exclude=openair2/NAS/DRIVER/CELLULAR/ --exclude=openair2/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 openair3 targets cmake_targets common
|
||||
ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair2/RRC/CELLULAR/ --exclude=openair2/NAS/DRIVER/CELLULAR/ --exclude=openair2/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 openair3 targets cmake_targets common nfapi
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB)
|
||||
{
|
||||
unsigned int x1, x2;
|
||||
unsigned char Nid, i_ssb, i_ssb2;
|
||||
uint16_t Nid, i_ssb, i_ssb2;
|
||||
unsigned char Lmax, l, n_hf, N_hf;
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
|
||||
@@ -25,7 +25,7 @@ void nr_gold_pbch(PHY_VARS_NR_UE* ue)
|
||||
{
|
||||
|
||||
unsigned int n, x1, x2;
|
||||
unsigned char Nid, i_ssb, i_ssb2;
|
||||
unsigned int Nid, i_ssb, i_ssb2;
|
||||
unsigned char Lmax, l, n_hf, N_hf;
|
||||
|
||||
Nid = ue->frame_parms.Nid_cell;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*! \file PHY/NR_TRANSPORT/nr_pbch.c
|
||||
* \brief Top-level routines for generating the PBCH/BCH physical/transport channel V15.1 03/2018
|
||||
* \author Guy De Souza
|
||||
* \thanks Special Thanks to Son Dang for helpfull contributions and testing
|
||||
* \thanks Special Thanks to Son Dang for helpful contributions and testing
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
@@ -190,7 +190,6 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
pbch->pbch_a_prime ^= (((pbch->pbch_a_interleaved>>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<<i;
|
||||
k++; /// k increase only when payload bit is not special bit
|
||||
}
|
||||
|
||||
@@ -459,22 +459,28 @@ void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
|
||||
offset = (nushift*M)&0x1f;
|
||||
|
||||
for (int i=0; i<length; i++) {
|
||||
/*if (((i+offset)&0x1f)==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}*/
|
||||
|
||||
if (bitwise) {
|
||||
if (((k+offset)&0x1f)==0 && (!((unscrambling_mask>>i)&1))) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
(pbch->pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_prime>>i)&1)<<i : (((pbch->pbch_a_prime>>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<<i;
|
||||
k += (!((unscrambling_mask>>i)&1));
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, pbch->pbch_a_interleaved, (!((unscrambling_mask>>i)&1)));
|
||||
#endif
|
||||
}
|
||||
|
||||
else {
|
||||
if (((i+offset)&0x1f)==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
if (i<8)
|
||||
printf("s: %04x\t", s);
|
||||
printf("pbch_a_interleaved 0x%08x\n", pbch->pbch_a_interleaved);
|
||||
#endif
|
||||
if (bitwise) {
|
||||
|
||||
(pbch->pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_prime>>i)&1)<<i : (((pbch->pbch_a_prime>>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<<i;
|
||||
k+=!((unscrambling_mask>>i)&1);
|
||||
}
|
||||
|
||||
else {
|
||||
if (((s>>((i+offset)&0x1f))&1)==1)
|
||||
demod_pbch_e[i] = -demod_pbch_e[i];
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
@@ -509,7 +515,7 @@ unsigned char sign(int8_t x) {
|
||||
}
|
||||
*/
|
||||
|
||||
uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11,12,13,1,4,3,14,15,16,17,2,26,18,19,20,21,22,30,23};
|
||||
uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11,12,13,1,4,3,14,15,16,17,2,26,18,19,20,21,22,6,23};
|
||||
|
||||
int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
|
||||
@@ -48,6 +48,15 @@ typedef struct {
|
||||
uint32_t pbch_e[NR_POLAR_PBCH_E_DWORD];
|
||||
} NR_gNB_PBCH;
|
||||
|
||||
typedef struct {
|
||||
uint8_t ssb_start_symbol;
|
||||
uint8_t n_hf;
|
||||
uint8_t Lmax;
|
||||
uint8_t ssb_index;
|
||||
int32_t sfn;
|
||||
} NR_PBCH_parms_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Length of DCI payload in bits
|
||||
uint16_t size;
|
||||
|
||||
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
|
||||
int freq_offset;
|
||||
// int subframe_offset;
|
||||
// char fname[40], vname[40];
|
||||
int trial,n_trials=1,n_errors,n_errors2,n_alamouti;
|
||||
int trial,n_trials=1,n_errors,n_errors_payload;
|
||||
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
|
||||
uint16_t Nid_cell=0;
|
||||
|
||||
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
nfapi_nr_config_request_t *gNB_config;
|
||||
|
||||
int ret;
|
||||
int ret, payload_ret=0;
|
||||
int run_initial_sync=0;
|
||||
|
||||
int loglvl=OAILOG_WARNING;
|
||||
@@ -500,8 +500,7 @@ int main(int argc, char **argv)
|
||||
for (SNR=snr0; SNR<snr1; SNR+=.2) {
|
||||
|
||||
n_errors = 0;
|
||||
n_errors2 = 0;
|
||||
n_alamouti = 0;
|
||||
n_errors_payload = 0;
|
||||
|
||||
for (trial=0; trial<n_trials; trial++) {
|
||||
|
||||
@@ -569,13 +568,31 @@ int main(int argc, char **argv)
|
||||
SISO,
|
||||
UE->high_speed_flag);
|
||||
|
||||
if (ret==0) {
|
||||
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
|
||||
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_length; //Lmax, not yet detected automatically
|
||||
uint8_t gNB_xtra_byte=0;
|
||||
for (int i=0; i<8; i++)
|
||||
gNB_xtra_byte |= ((gNB->pbch.pbch_a>>(31-i))&1)<<(7-i);
|
||||
|
||||
payload_ret = (UE->rx_ind.rx_indication_body->mib_pdu.additional_bits == gNB_xtra_byte);
|
||||
for (i=0;i<3;i++){
|
||||
payload_ret += (UE->rx_ind.rx_indication_body->mib_pdu.pdu[i] == gNB->pbch_pdu[2-i]);
|
||||
//printf("pdu byte %d gNB: 0x%02x UE: 0x%02x\n",i,gNB->pbch_pdu[i], UE->rx_ind.rx_indication_body->mib_pdu.pdu[i]);
|
||||
}
|
||||
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->rx_ind.rx_indication_body->mib_pdu.additional_bits);
|
||||
//printf("ret %d\n", payload_ret);
|
||||
if (payload_ret!=4)
|
||||
n_errors_payload++;
|
||||
}
|
||||
|
||||
if (ret<0) n_errors++;
|
||||
}
|
||||
} //noise trials
|
||||
|
||||
printf("SNR %f : n_errors (negative CRC) = %d/%d\n", SNR,n_errors,n_trials);
|
||||
printf("SNR %f: trials %d, n_errors_crc = %d, n_errors_payload %d\n", SNR,n_trials,n_errors,n_errors_payload);
|
||||
|
||||
if ((float)n_errors/(float)n_trials <= target_error_rate) {
|
||||
if (((float)n_errors/(float)n_trials <= target_error_rate) && (n_errors_payload==0)) {
|
||||
printf("PBCH test OK\n");
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user