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
b1a3bad1
Commit
b1a3bad1
authored
Dec 20, 2018
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop-nr' into nr-polar-encoder-optimizations
parents
214b1e86
457f7355
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
21 deletions
+51
-21
maketags
maketags
+1
-1
openair1/PHY/NR_REFSIG/nr_gold.c
openair1/PHY/NR_REFSIG/nr_gold.c
+1
-1
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+1
-2
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+16
-11
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+9
-0
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+23
-6
No files found.
maketags
View file @
b1a3bad1
#!/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
openair1/PHY/NR_REFSIG/nr_gold.c
View file @
b1a3bad1
...
...
@@ -24,7 +24,7 @@
void
nr_init_pbch_dmrs
(
PHY_VARS_gNB
*
gNB
)
{
unsigned
int
x1
,
x2
;
u
nsigned
char
Nid
,
i_ssb
,
i_ssb2
;
u
int16_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
;
...
...
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
b1a3bad1
...
...
@@ -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 helpful
l
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
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
b1a3bad1
...
...
@@ -458,22 +458,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
)
{
/*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
if
(
i
<
8
)
printf
(
"s: %04x
\t
"
,
s
);
printf
(
"pbch_a_interleaved 0x%08x
\n
"
,
pbch
->
pbch_a_interleaved
);
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
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
(((
i
+
offset
)
&
0x1f
)
==
0
)
{
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
reset
=
0
;
}
if
(((
s
>>
((
i
+
offset
)
&
0x1f
))
&
1
)
==
1
)
demod_pbch_e
[
i
]
=
-
demod_pbch_e
[
i
];
#ifdef DEBUG_PBCH_ENCODING
...
...
@@ -508,7 +514,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
,
...
...
@@ -670,14 +676,13 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
if
(
decoderState
>
0
)
return
(
decoderState
);
printf
(
"polar decoder output 0x%08x
\n
"
,
nr_ue_pbch_vars
->
pbch_a_prime
);
//
printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime);
//payload un-scrambling
memset
(
&
nr_ue_pbch_vars
->
pbch_a_interleaved
,
0
,
sizeof
(
uint32_t
)
);
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"
,
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;
...
...
openair1/PHY/defs_gNB.h
View file @
b1a3bad1
...
...
@@ -47,6 +47,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
;
...
...
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
b1a3bad1
...
...
@@ -99,7 +99,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_errors
2
,
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
;
...
...
@@ -128,7 +128,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
;
...
...
@@ -499,8 +499,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
++
)
{
...
...
@@ -567,13 +566,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
;
}
...
...
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