Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
alex037yang
OpenXG-RAN
Commits
b0b11a92
Commit
b0b11a92
authored
Jul 10, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encoding debug data
parent
3716e921
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+19
-2
No files found.
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
b0b11a92
...
@@ -156,12 +156,18 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
...
@@ -156,12 +156,18 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
}
}
// Scrambling is now done with offset (nushift*M)%32
// Scrambling is now done with offset (nushift*M)%32
offset
=
(
nushift
*
M
)
&
0x1f
;
offset
=
(
nushift
*
M
)
&
0x1f
;
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Scrambling params: nushift %d M %d length %d bitwise %d offset %d
\n
"
,
nushift
,
M
,
length
,
bitwise
,
offset
);
#endif
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
if
(((
i
+
offset
)
&
0x1f
)
==
0
)
{
if
(((
i
+
offset
)
&
0x1f
)
==
0
)
{
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
reset
=
0
;
reset
=
0
;
}
}
#ifdef DEBUG_PBCH_ENCODING
printf
(
"s: %04x
\n
"
,
s
);
#endif
if
(
bitwise
)
{
if
(
bitwise
)
{
(
*
pbch_a_prime
)
^=
((
unscrambling_mask
>>
i
)
&
1
)
?
(((
*
pbch_a_interleaved
)
>>
i
)
&
1
)
<<
i
:
((((
*
pbch_a_interleaved
)
>>
i
)
&
1
)
^
((
s
>>
((
i
+
offset
)
&
0x1f
))
&
1
))
<<
i
;
(
*
pbch_a_prime
)
^=
((
unscrambling_mask
>>
i
)
&
1
)
?
(((
*
pbch_a_interleaved
)
>>
i
)
&
1
)
<<
i
:
((((
*
pbch_a_interleaved
)
>>
i
)
&
1
)
^
((
s
>>
((
i
+
offset
)
&
0x1f
))
&
1
))
<<
i
;
}
}
...
@@ -256,20 +262,31 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -256,20 +262,31 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
nushift
=
(((
sfn
>>
2
)
&
1
)
<<
1
)
^
((
sfn
>>
1
)
&
1
);
nushift
=
(((
sfn
>>
2
)
&
1
)
<<
1
)
^
((
sfn
>>
1
)
&
1
);
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
sch_config
.
physical_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
1
);
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
sch_config
.
physical_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
1
);
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Payload scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
printf
(
"pbch_a_prime[%d]: 0x%04x
\n
"
,
i
,
pbch
->
pbch_a_prime
[
i
]);
#endif
#endif
/// CRC, coding and rate matching
/// CRC, coding and rate matching
polar_encoder
(
pbch
->
pbch_a_prime
,
pbch
->
pbch_e
,
&
frame_parms
->
pbch_polar_params
);
polar_encoder
(
pbch
->
pbch_a_prime
,
pbch
->
pbch_e
,
&
frame_parms
->
pbch_polar_params
);
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Channel coding:
\n
"
);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
printf
(
"pbch_e[%d]: 0x%04x"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"
\n
"
);
#endif
#endif
/// Scrambling
/// Scrambling
M
=
NR_POLAR_PBCH_E
;
M
=
NR_POLAR_PBCH_E
;
nushift
=
config
->
sch_config
.
physical_cell_id
.
value
&
3
;;
nushift
=
config
->
sch_config
.
physical_cell_id
.
value
&
3
;;
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
sch_config
.
physical_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_E
,
0
);
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
sch_config
.
physical_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_E
,
0
);
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
printf
(
"pbch_e[%d]: 0x%04x"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"
\n
"
);
#endif
/// QPSK modulation
/// QPSK modulation
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
1
;
i
++
){
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
1
;
i
++
){
...
...
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