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
aeb298d0
Commit
aeb298d0
authored
Jul 11, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interleaving update
parent
b5e227be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+18
-12
No files found.
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
aeb298d0
...
@@ -183,7 +183,7 @@ uint8_t nr_pbch_payload_interleaving_pattern[32] = {16, 23, 18, 17, 8, 30, 10, 6
...
@@ -183,7 +183,7 @@ uint8_t nr_pbch_payload_interleaving_pattern[32] = {16, 23, 18, 17, 8, 30, 10, 6
uint8_t
nr_pbch_payload_interleaver
(
uint8_t
i
)
{
uint8_t
nr_pbch_payload_interleaver
(
uint8_t
i
)
{
uint8_t
j_sfn
=
0
,
j_hrf
=
10
,
j_ssb
=
11
,
j_other
=
14
;
uint8_t
j_sfn
=
0
,
j_hrf
=
10
,
j_ssb
=
11
,
j_other
=
14
;
if
(
24
<=
i
&&
i
<=
27
)
//Sfn bits
if
(
18
<=
i
&&
i
<=
27
)
//Sfn bits
return
nr_pbch_payload_interleaving_pattern
[
j_sfn
+
i
-
24
];
return
nr_pbch_payload_interleaving_pattern
[
j_sfn
+
i
-
24
];
else
if
(
i
==
28
)
// Hrf bit
else
if
(
i
==
28
)
// Hrf bit
return
nr_pbch_payload_interleaving_pattern
[
j_hrf
];
return
nr_pbch_payload_interleaving_pattern
[
j_hrf
];
...
@@ -206,7 +206,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -206,7 +206,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
NR_DL_FRAME_PARMS
*
frame_parms
)
NR_DL_FRAME_PARMS
*
frame_parms
)
{
{
int
k
,
l
,
m
;
int
j
,
k
,
l
,
m
;
int16_t
a
;
int16_t
a
;
int16_t
mod_pbch_e
[
NR_POLAR_PBCH_E
];
int16_t
mod_pbch_e
[
NR_POLAR_PBCH_E
];
uint8_t
idx
=
0
;
uint8_t
idx
=
0
;
...
@@ -225,7 +225,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -225,7 +225,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Byte endian fix:
\n
"
);
printf
(
"Byte endian fix:
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
printf
(
"pbch_a[%d]: 0x%0
4x
\n
"
,
i
,
pbch
->
pbch_a
[
i
]);
printf
(
"pbch_a[%d]: 0x%0
2x
\n
"
,
i
,
pbch
->
pbch_a
[
i
]);
#endif
#endif
// Extra byte generation
// Extra byte generation
...
@@ -242,18 +242,24 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -242,18 +242,24 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Extra byte:
\n
"
);
printf
(
"Extra byte:
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
printf
(
"pbch_a[%d]: 0x%0
4
x
\n
"
,
i
,
pbch
->
pbch_a
[
i
]);
printf
(
"pbch_a[%d]: 0x%0
2
x
\n
"
,
i
,
pbch
->
pbch_a
[
i
]);
#endif
#endif
// Payload interleaving
// Payload interleaving
uint32_t
*
input
=
(
uint32_t
*
)
pbch
->
pbch_a
;
uint8_t
*
in
=
&
pbch
->
pbch_a
[
3
];
uint32_t
*
output
=
(
uint32_t
*
)
pbch
->
pbch_a_interleaved
;
uint8_t
*
out
=
&
pbch
->
pbch_a_interleaved
[
3
];
for
(
int
i
=
0
;
i
<
32
;
i
++
)
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
(
*
output
)
|=
(((
*
input
)
>>
i
)
&
1
)
<<
(
nr_pbch_payload_interleaver
(
i
));
j
=
i
&
7
;
if
(
!
j
)
{
in
--
;
out
--
;
}
(
*
out
)
|=
(((
*
in
)
>>
j
)
&
1
)
<<
((
nr_pbch_payload_interleaver
(
i
))
&
7
);
}
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Interleaving:
\n
"
);
printf
(
"Interleaving:
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
printf
(
"pbch_a_interleaved[%d]: 0x%0
4
x
\n
"
,
i
,
pbch
->
pbch_a_interleaved
[
i
]);
printf
(
"pbch_a_interleaved[%d]: 0x%0
2
x
\n
"
,
i
,
pbch
->
pbch_a_interleaved
[
i
]);
#endif
#endif
// Scrambling
// Scrambling
...
@@ -263,7 +269,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -263,7 +269,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Payload scrambling:
\n
"
);
printf
(
"Payload scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
printf
(
"pbch_a_prime[%d]: 0x%0
4
x
\n
"
,
i
,
pbch
->
pbch_a_prime
[
i
]);
printf
(
"pbch_a_prime[%d]: 0x%0
2
x
\n
"
,
i
,
pbch
->
pbch_a_prime
[
i
]);
#endif
#endif
...
@@ -272,7 +278,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -272,7 +278,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Channel coding:
\n
"
);
printf
(
"Channel coding:
\n
"
);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
printf
(
"pbch_e[%d]: 0x%0
4
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"pbch_e[%d]: 0x%0
2
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
#endif
#endif
...
@@ -283,7 +289,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
...
@@ -283,7 +289,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
#ifdef DEBUG_PBCH_ENCODING
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Scrambling:
\n
"
);
printf
(
"Scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
printf
(
"pbch_e[%d]: 0x%0
4
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"pbch_e[%d]: 0x%0
2
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
#endif
#endif
...
...
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