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
canghaiwuhen
OpenXG-RAN
Commits
ce0b6266
Commit
ce0b6266
authored
Sep 10, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PBCH bitfield changes
parent
a80f1cf2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+11
-11
openair1/PHY/NR_TRANSPORT/nr_transport.h
openair1/PHY/NR_TRANSPORT/nr_transport.h
+1
-1
No files found.
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
ce0b6266
...
...
@@ -136,7 +136,7 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
uint8_t
nushift
,
uint16_t
M
,
uint16_t
length
,
uint8_t
bitwise
)
uint8_t
encoded
)
{
uint8_t
reset
,
offset
;
uint32_t
x1
,
x2
,
s
=
0
;
...
...
@@ -168,12 +168,12 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
#ifdef DEBUG_PBCH_ENCODING
printf
(
"s: %04x
\t
"
,
s
);
#endif
if
(
bitwise
)
{
if
(
!
encoded
)
{
(
*
pbch_a_prime
)
^=
((
unscrambling_mask
>>
i
)
&
1
)
?
(((
*
pbch_a_interleaved
)
>>
i
)
&
1
)
<<
i
:
((((
*
pbch_a_interleaved
)
>>
i
)
&
1
)
^
((
s
>>
((
i
+
offset
)
&
0x1f
))
&
1
))
<<
i
;
}
else
pbch_e
[
i
]
=
(
pbch_e
[
i
]
&
1
)
^
((
s
>>
((
i
+
offset
)
&
0x1f
))
&
1
);
pbch_e
[
i
>>
5
]
^=
(((
s
>>
((
i
+
offset
)
&
0x1f
))
&
1
)
<<
(
i
&
0x1f
)
);
}
}
...
...
@@ -276,7 +276,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
// Scrambling
M
=
(
Lmax
==
64
)
?
(
NR_POLAR_PBCH_PAYLOAD_BITS
-
6
)
:
(
NR_POLAR_PBCH_PAYLOAD_BITS
-
3
);
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
,
0
);
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Payload scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
...
...
@@ -284,7 +284,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
#endif
for
(
int
m
=
0
;
m
<
32
;
m
++
){
pbch_a_b
[
m
]
=
((
pbch
->
pbch_a_prime
[
m
/
8
]
>>
(
m
&
7
))
&
0
1
);
pbch_a_b
[
m
]
=
((
pbch
->
pbch_a_prime
[
m
>>
3
]
>>
(
m
&
7
))
&
1
);
//printf("pbch_a_b[%d] %d\n", m, pbch_a_b[m] );
}
...
...
@@ -292,25 +292,25 @@ pbch_a_b[m] = ((pbch->pbch_a_prime[m/8]>>(m&7))&01);
polar_encoder
(
pbch
->
pbch_a_prime
,
pbch
->
pbch_e
,
polar_params
);
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Channel coding:
\n
"
);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
printf
(
"pbch_e[%d]: 0x%0
2
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
for
(
int
i
=
0
;
i
<
(
uint16_t
)
ceil
((
NR_POLAR_PBCH_E
>>
3
)
/
32
)
;
i
++
)
printf
(
"pbch_e[%d]: 0x%0
8
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"
\n
"
);
#endif
/// Scrambling
M
=
NR_POLAR_PBCH_E
;
nushift
=
(
Lmax
==
4
)
?
ssb_index
&
3
:
ssb_index
&
7
;
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
,
1
);
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
3
;
i
++
)
printf
(
"pbch_e[%d]: 0x%0
2
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
for
(
int
i
=
0
;
i
<
(
uint16_t
)
ceil
((
NR_POLAR_PBCH_E
>>
3
)
/
32
)
;
i
++
)
printf
(
"pbch_e[%d]: 0x%0
8
x
\t
"
,
i
,
pbch
->
pbch_e
[
i
]);
printf
(
"
\n
"
);
#endif
/// QPSK modulation
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
>>
1
;
i
++
){
idx
=
((
pbch
->
pbch_e
[
i
<<
1
]
&
1
)
<<
1
)
^
(
pbch
->
pbch_e
[(
i
<<
1
)
+
1
]
&
1
);
idx
=
((
(
pbch
->
pbch_e
[(
i
<<
1
)
>>
5
]
>>
((
i
<<
1
)
&
0x1f
))
&
1
)
<<
1
)
^
((
pbch
->
pbch_e
[((
i
<<
1
)
+
1
)
>>
5
]
>>
(((
i
<<
1
)
+
1
)
&
0x1f
))
&
1
);
mod_pbch_e
[
i
<<
1
]
=
nr_mod_table
[(
NR_MOD_TABLE_QPSK_OFFSET
+
idx
)
<<
1
];
mod_pbch_e
[(
i
<<
1
)
+
1
]
=
nr_mod_table
[((
NR_MOD_TABLE_QPSK_OFFSET
+
idx
)
<<
1
)
+
1
];
...
...
openair1/PHY/NR_TRANSPORT/nr_transport.h
View file @
ce0b6266
...
...
@@ -75,7 +75,7 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
uint8_t
nushift
,
uint16_t
M
,
uint16_t
length
,
uint8_t
bitwise
);
uint8_t
encoded
);
/*!
\fn int nr_generate_pbch
...
...
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