Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
7561f09c
Commit
7561f09c
authored
Dec 17, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Payload check in pbchsim
parent
619f00d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
12 deletions
+25
-12
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+2
-1
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+4
-5
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+19
-6
No files found.
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
7561f09c
...
...
@@ -277,7 +277,8 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
else
pbch
->
pbch_a
|=
((
config
->
sch_config
.
ssb_subcarrier_offset
.
value
>>
4
)
&
1
)
<<
29
;
//MSB of k_SSB (bit index 4)
LOG_I
(
PHY
,
"After extra byte: pbch_a = 0x%08x
\n
"
,
pbch
->
pbch_a
);
//LOG_I(PHY,"After extra byte: pbch_a = 0x%08x\n",pbch->pbch_a);
printf
(
"After extra byte: pbch_a = 0x%08x
\n
"
,
pbch
->
pbch_a
);
// Payload interleaving
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
7561f09c
...
...
@@ -36,7 +36,7 @@
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_PBCH 1
#define DEBUG_PBCH_ENCODING
//
#define DEBUG_PBCH_ENCODING
#ifdef OPENAIR2
//#include "PHY_INTERFACE/defs.h"
...
...
@@ -508,7 +508,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
,
...
...
@@ -673,16 +673,15 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
M
=
(
Lmax
==
64
)
?
(
NR_POLAR_PBCH_PAYLOAD_BITS
-
6
)
:
(
NR_POLAR_PBCH_PAYLOAD_BITS
-
3
);
nushift
=
((
nr_ue_pbch_vars
->
pbch_a_prime
>>
24
)
&
1
)
^
(((
nr_ue_pbch_vars
->
pbch_a_prime
>>
6
)
&
1
)
<<
1
);
nr_pbch_unscrambling
(
nr_ue_pbch_vars
,
frame_parms
->
Nid_cell
,
nushift
,
M
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
1
,
unscrambling_mask
);
printf
(
"nushift %d sfn 3rd %d 2nd %d
\n
"
,
nushift
,((
nr_ue_pbch_vars
->
pbch_a_prime
>>
6
)
&
1
),
((
nr_ue_pbch_vars
->
pbch_a_prime
>>
24
)
&
1
)
);
//payload deinterleaving
//uint32_t in=0;
uint32_t
out
=
0
;
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
out
|=
((
nr_ue_pbch_vars
->
pbch_a_interleaved
>>
i
)
&
1
)
<<
(
pbch_deinterleaving_pattern
[
i
]);
#ifdef DEBUG_PBCH
//
#ifdef DEBUG_PBCH
printf
(
"i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x
\n
"
,
i
,
nr_ue_pbch_vars
->
pbch_a_interleaved
,
out
,
pbch_deinterleaving_pattern
[
i
],
(
nr_ue_pbch_vars
->
pbch_a_interleaved
>>
i
)
&
1
);
#endif
//
#endif
}
uint32_t
payload
=
0
;
...
...
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
7561f09c
...
...
@@ -122,13 +122,13 @@ int main(int argc, char **argv)
unsigned
char
frame_type
=
0
;
unsigned
char
pbch_phase
=
0
;
int
frame
=
0
,
subframe
=
0
;
int
frame
=
8
,
subframe
=
0
;
int
frame_length_complex_samples
;
int
frame_length_complex_samples_no_prefix
;
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
;
...
...
@@ -570,9 +570,17 @@ int main(int argc, char **argv)
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
for
(
i
=
0
;
i
<
3
;
i
++
)
printf
(
"pdu byte %d gNB: 0x%02x UE: 0x%02x
\n
"
,
i
,((
uint8_t
*
)
&
gNB
->
pbch
.
pbch_a
)[
i
],
UE
->
rx_ind
.
rx_indication_body
->
mib_pdu
.
pdu
[
i
]);
printf
(
"xtra byte gNB: 0x%02x UE: 0x%02x
\n
"
,((
uint8_t
*
)
&
gNB
->
pbch
.
pbch_a
)[
3
],
UE
->
rx_ind
.
rx_indication_body
->
mib_pdu
.
additional_bits
);
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
(
ret
<
0
)
n_errors
++
;
...
...
@@ -582,7 +590,12 @@ int main(int argc, char **argv)
printf
(
"SNR %f : n_errors (negative CRC) = %d/%d
\n
"
,
SNR
,
n_errors
,
n_trials
);
if
((
float
)
n_errors
/
(
float
)
n_trials
<=
target_error_rate
)
{
printf
(
"PBCH test OK
\n
"
);
if
(
payload_ret
==
4
)
{
printf
(
"Payload OK
\n
"
);
printf
(
"PBCH test OK
\n
"
);
}
else
printf
(
"Payload NOK
\n
"
);
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment