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
spbro
OpenXG-RAN
Commits
53001d0d
Commit
53001d0d
authored
Feb 15, 2022
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove-NR_UE_PBCH scope to finish
parent
af6836d9
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
286 additions
and
263 deletions
+286
-263
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+0
-19
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
+3
-2
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+59
-61
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+6
-1
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+9
-4
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+95
-90
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+4
-1
openair1/PHY/TOOLS/nr_phy_scope.c
openair1/PHY/TOOLS/nr_phy_scope.c
+52
-26
openair1/PHY/TOOLS/phy_scope_interface.h
openair1/PHY/TOOLS/phy_scope_interface.h
+11
-1
openair1/PHY/defs_UE.h
openair1/PHY/defs_UE.h
+1
-0
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+2
-36
openair1/SCHED_NR_UE/defs.h
openair1/SCHED_NR_UE/defs.h
+7
-1
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+22
-14
openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
+3
-1
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+12
-6
No files found.
openair1/PHY/INIT/nr_init_ue.c
View file @
53001d0d
...
...
@@ -416,30 +416,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
}
// PBCH
pbch_vars
[
gNB_id
]
->
rxdataF_ext
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
gNB_id
]
->
rxdataF_comp
=
(
int32_t
**
)
malloc16_clear
(
4
*
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
gNB_id
]
->
dl_ch_estimates
=
(
int32_t
**
)
malloc16_clear
(
4
*
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_ext
=
(
int32_t
**
)
malloc16_clear
(
4
*
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_time
=
(
int32_t
**
)
malloc16_clear
(
4
*
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
gNB_id
]
->
llr
=
(
int16_t
*
)
malloc16_clear
(
1920
);
//
prach_vars
[
gNB_id
]
->
prachF
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int
)
*
(
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
*
12
))
);
prach_vars
[
gNB_id
]
->
prach
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int
)
*
(
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
*
12
))
);
for
(
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
pbch_vars
[
gNB_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
20
*
12
*
4
);
for
(
j
=
0
;
j
<
4
;
j
++
)
{
//fp->nb_antennas_tx;j++) {
int
idx
=
(
j
*
fp
->
nb_antennas_rx
)
+
i
;
pbch_vars
[
gNB_id
]
->
rxdataF_comp
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
20
*
12
*
4
);
pbch_vars
[
gNB_id
]
->
dl_ch_estimates
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
)
);
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_time
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
)
);
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
20
*
12
*
4
);
}
}
}
pbch_vars
[
gNB_id
]
->
decoded_output
=
(
uint8_t
*
)
malloc16_clear
(
64
);
}
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
View file @
53001d0d
...
...
@@ -36,6 +36,7 @@
void
nr_adjust_synch_ue
(
NR_DL_FRAME_PARMS
*
frame_parms
,
PHY_VARS_NR_UE
*
ue
,
module_id_t
gNB_id
,
const
int
estimateSz
,
struct
complex16
dl_ch_estimates_time
[][
estimateSz
],
uint8_t
frame
,
uint8_t
subframe
,
unsigned
char
clear
,
...
...
@@ -60,8 +61,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
int
j
=
(
i
<
0
)
?
(
i
+
frame_parms
->
ofdm_symbol_size
)
:
i
;
for
(
int
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
int
Re
=
((
int16_t
*
)
ue
->
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_time
[
aa
])[(
j
<<
1
)]
;
int
Im
=
((
int16_t
*
)
ue
->
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_time
[
aa
])[
1
+
(
j
<<
1
)]
;
int
Re
=
dl_ch_estimates_time
[
aa
][
j
].
r
;
int
Im
=
dl_ch_estimates_time
[
aa
][
j
].
i
;
temp
+=
(
Re
*
Re
/
2
)
+
(
Im
*
Im
/
2
);
}
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
53001d0d
...
...
@@ -29,6 +29,7 @@
#include "PHY/NR_REFSIG/ptrs_nr.h"
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
#include "filt16a_32.h"
#include <openair1/PHY/TOOLS/phy_scope_interface.h>
//#define DEBUG_PDSCH
//#define DEBUG_PDCCH
...
...
@@ -43,7 +44,6 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
NR_UE_SSB
*
current_ssb
)
{
int
pilot
[
200
]
__attribute__
((
aligned
(
16
)));
unsigned
char
aarx
;
unsigned
short
k
;
unsigned
int
pilot_cnt
;
int16_t
ch
[
2
],
*
pil
,
*
rxF
;
...
...
@@ -77,7 +77,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
// generate pilot
nr_pbch_dmrs_rx
(
dmrss
,
ue
->
nr_gold_pbch
[
n_hf
][
ssb_index
],
&
pilot
[
0
]);
for
(
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
for
(
int
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
int
re_offset
=
ssb_offset
;
pil
=
(
int16_t
*
)
&
pilot
[
0
];
...
...
@@ -197,6 +197,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
int
nr_pbch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
int
estimateSz
,
struct
complex16
dl_ch_estimates
[][
estimateSz
],
struct
complex16
dl_ch_estimates_time
[][
estimateSz
],
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
,
unsigned
char
Ns
,
...
...
@@ -206,15 +209,13 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t
n_hf
)
{
int
pilot
[
200
]
__attribute__
((
aligned
(
16
)));
unsigned
char
aarx
,
p
;
unsigned
short
k
;
unsigned
int
pilot_cnt
;
int16_t
ch
[
2
],
*
pil
,
*
rxF
,
*
dl_ch
,
*
fl
,
*
fm
,
*
fr
;
int16_t
*
pil
,
*
rxF
,
*
dl_ch
,
*
fl
,
*
fm
,
*
fr
;
int
ch_offset
,
symbol_offset
;
//int slot_pbch;
uint8_t
nushift
;
int
**
dl_ch_estimates
=
ue
->
pbch_vars
[
gNB_id
]
->
dl_ch_estimates
;
int
**
rxdataF
=
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
proc
->
thread_id
].
rxdataF
;
nushift
=
ue
->
frame_parms
.
Nid_cell
%
4
;
...
...
@@ -269,17 +270,57 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
break
;
}
idft_size_idx_t
idftsizeidx
;
switch
(
ue
->
frame_parms
.
ofdm_symbol_size
)
{
case
128
:
idftsizeidx
=
IDFT_128
;
break
;
case
256
:
idftsizeidx
=
IDFT_256
;
break
;
case
512
:
idftsizeidx
=
IDFT_512
;
break
;
case
1024
:
idftsizeidx
=
IDFT_1024
;
break
;
case
1536
:
idftsizeidx
=
IDFT_1536
;
break
;
case
2048
:
idftsizeidx
=
IDFT_2048
;
break
;
case
3072
:
idftsizeidx
=
IDFT_3072
;
break
;
case
4096
:
idftsizeidx
=
IDFT_4096
;
break
;
default:
printf
(
"unsupported ofdm symbol size
\n
"
);
assert
(
0
);
}
// generate pilot
nr_pbch_dmrs_rx
(
dmrss
,
ue
->
nr_gold_pbch
[
n_hf
][
ssb_index
],
&
pilot
[
0
]);
for
(
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
for
(
int
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
int
re_offset
=
ssb_offset
;
pil
=
(
int16_t
*
)
&
pilot
[
0
];
rxF
=
(
int16_t
*
)
&
rxdataF
[
aarx
][(
symbol_offset
+
k
+
re_offset
)];
dl_ch
=
(
int16_t
*
)
&
dl_ch_estimates
[
aarx
][
ch_offset
];
memset
(
dl_ch
,
0
,
4
*
(
ue
->
frame_parms
.
ofdm_symbol_size
));
memset
(
dl_ch
,
0
,
sizeof
(
*
dl_ch
)
*
(
ue
->
frame_parms
.
ofdm_symbol_size
));
#ifdef DEBUG_CH
printf
(
"pbch ch est pilot addr %p RB_DL %d
\n
"
,
&
pilot
[
0
],
ue
->
frame_parms
.
N_RB_DL
);
...
...
@@ -289,6 +330,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
#endif
// Treat first 2 pilots specially (left edge)
int16_t
ch
[
2
];
ch
[
0
]
=
(
int16_t
)(((
int32_t
)
pil
[
0
]
*
rxF
[
0
]
-
(
int32_t
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
ch
[
1
]
=
(
int16_t
)(((
int32_t
)
pil
[
0
]
*
rxF
[
1
]
+
(
int32_t
)
pil
[
1
]
*
rxF
[
0
])
>>
15
);
...
...
@@ -402,62 +444,18 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
}
idft_size_idx_t
idftsizeidx
;
switch
(
ue
->
frame_parms
.
ofdm_symbol_size
)
{
case
128
:
idftsizeidx
=
IDFT_128
;
break
;
case
256
:
idftsizeidx
=
IDFT_256
;
break
;
case
512
:
idftsizeidx
=
IDFT_512
;
break
;
case
1024
:
idftsizeidx
=
IDFT_1024
;
break
;
case
1536
:
idftsizeidx
=
IDFT_1536
;
break
;
case
2048
:
idftsizeidx
=
IDFT_2048
;
break
;
case
3072
:
idftsizeidx
=
IDFT_3072
;
break
;
case
4096
:
idftsizeidx
=
IDFT_4096
;
break
;
default:
printf
(
"unsupported ofdm symbol size
\n
"
);
assert
(
0
);
}
if
(
dmrss
==
2
)
// update time statistics for last PBCH symbol
{
// do ifft of channel estimate
for
(
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
for
(
p
=
0
;
p
<
ue
->
frame_parms
.
nb_antenna_ports_gNB
;
p
++
)
{
if
(
ue
->
pbch_vars
[
gNB_id
]
->
dl_ch_estimates
[(
p
*
ue
->
frame_parms
.
nb_antennas_rx
)
+
aarx
])
{
LOG_D
(
PHY
,
"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d
\n
"
,
Ns
,
proc
->
thread_id
,
symbol
,
ch_offset
);
LOG_D
(
PHY
,
"Channel Impulse Computation Slot %d Symbol %d ch_offset %d
\n
"
,
Ns
,
symbol
,
ch_offset
);
idft
(
idftsizeidx
,
(
int16_t
*
)
&
ue
->
pbch_vars
[
gNB_id
]
->
dl_ch_estimates
[(
p
*
ue
->
frame_parms
.
nb_antennas_rx
)
+
aarx
][
ch_offset
],
(
int16_t
*
)
ue
->
pbch_vars
[
gNB_id
]
->
dl_ch_estimates_time
[(
p
*
ue
->
frame_parms
.
nb_antennas_rx
)
+
aarx
],
1
);
}
}
}
}
(
int16_t
*
)
&
dl_ch_estimates
[
aarx
][
ch_offset
],
(
int16_t
*
)
dl_ch_estimates_time
[
aarx
],
1
);
}
}
if
(
dmrss
==
2
)
scopeCopy
(
ue
,
pbchDlChEstimateTime
,
dl_ch_estimates_time
,
sizeof
(
struct
complex16
),
idftsizeidx
,
ue
->
frame_parms
.
nb_antennas_rx
);
return
(
0
);
}
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
View file @
53001d0d
...
...
@@ -56,6 +56,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
NR_UE_SSB
*
current_ssb
);
int
nr_pbch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
int
estimateSz
,
struct
complex16
dl_ch_estimates
[][
estimateSz
],
struct
complex16
dl_ch_estimates_time
[][
estimateSz
],
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
,
unsigned
char
Ns
,
...
...
@@ -78,6 +81,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
void
nr_adjust_synch_ue
(
NR_DL_FRAME_PARMS
*
frame_parms
,
PHY_VARS_NR_UE
*
ue
,
module_id_t
gNB_id
,
int
estimateSz
,
struct
complex16
dl_ch_estimates_time
[][
estimateSz
],
uint8_t
frame
,
uint8_t
subframe
,
unsigned
char
clear
,
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
View file @
53001d0d
...
...
@@ -149,17 +149,22 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
start_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
// computing channel estimation for selected best ssb
const
int
estimateSz
=
7
*
2
*
sizeof
(
int
)
*
frame_parms
->
ofdm_symbol_size
;
struct
complex16
dl_ch_estimates
[
frame_parms
->
nb_antennas_rx
][
estimateSz
];
struct
complex16
dl_ch_estimates_time
[
frame_parms
->
nb_antennas_rx
][
estimateSz
];
for
(
int
i
=
pbch_initial_symbol
;
i
<
pbch_initial_symbol
+
3
;
i
++
)
nr_pbch_channel_estimation
(
ue
,
proc
,
0
,
0
,
i
,
i
-
pbch_initial_symbol
,
temp_ptr
->
i_ssb
,
temp_ptr
->
n_hf
);
nr_pbch_channel_estimation
(
ue
,
estimateSz
,
dl_ch_estimates
,
dl_ch_estimates_time
,
proc
,
0
,
0
,
i
,
i
-
pbch_initial_symbol
,
temp_ptr
->
i_ssb
,
temp_ptr
->
n_hf
);
stop_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
fapiPbch_t
result
;
ret
=
nr_rx_pbch
(
ue
,
proc
,
estimateSz
,
dl_ch_estimates
,
ue
->
pbch_vars
[
0
],
frame_parms
,
0
,
temp_ptr
->
i_ssb
,
SISO
);
SISO
,
&
result
);
temp_ptr
=
temp_ptr
->
next_ssb
;
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
53001d0d
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
View file @
53001d0d
...
...
@@ -1153,11 +1153,14 @@ int rx_sss(PHY_VARS_NR_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uin
*/
int
nr_rx_pbch
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
const
int
estimateSz
,
struct
complex16
dl_ch_estimates
[][
estimateSz
],
NR_UE_PBCH
*
nr_ue_pbch_vars
,
NR_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
eNB_id
,
uint8_t
i_ssb
,
MIMO_mode_t
mimo_mode
);
MIMO_mode_t
mimo_mode
,
fapiPbch_t
*
result
);
int
nr_pbch_detection
(
UE_nr_rxtx_proc_t
*
proc
,
PHY_VARS_NR_UE
*
ue
,
...
...
openair1/PHY/TOOLS/nr_phy_scope.c
View file @
53001d0d
This diff is collapsed.
Click to expand it.
openair1/PHY/TOOLS/phy_scope_interface.h
View file @
53001d0d
...
...
@@ -32,6 +32,7 @@
#ifndef __PHY_SCOPE_INTERFACE_H__
#define __PHY_SCOPE_INTERFACE_H__
#include <openair1/PHY/defs_gNB.h>
typedef
struct
{
int
*
argc
;
char
**
argv
;
...
...
@@ -39,16 +40,25 @@ typedef struct {
PHY_VARS_gNB
*
gNB
;
}
scopeParms_t
;
enum
UEdataType
{
pbchDlChEstimateTime
,
pbchLlr
,
pbchRxdataF_comp
,
UEdataTypeNumberOfItems
};
typedef
struct
scopeData_s
{
int
*
argc
;
char
**
argv
;
RU_t
*
ru
;
PHY_VARS_gNB
*
gNB
;
int32_t
*
rxdataF
;
void
*
liveData
;
void
(
*
slotFunc
)(
int32_t
*
data
,
int
slot
,
void
*
scopeData
);
void
(
*
copyData
)(
enum
UEdataType
,
void
*
data
,
int
elementSz
,
int
colSz
,
int
lineSz
);
}
scopeData_t
;
int
load_softscope
(
char
*
exectype
,
void
*
initarg
);
int
end_forms
(
void
)
;
#define scopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(type, ##__VA_ARGS__);
#endif
openair1/PHY/defs_UE.h
View file @
53001d0d
...
...
@@ -839,6 +839,7 @@ typedef struct {
/// RF and Interface devices per CC
openair0_device
rfdevice
;
void
*
scopeData
;
}
PHY_VARS_UE
;
/* this structure is used to pass both UE phy vars and
...
...
openair1/PHY/defs_nr_UE.h
View file @
53001d0d
...
...
@@ -655,40 +655,6 @@ typedef struct {
#define PBCH_A 24
typedef
struct
{
/// \brief Pointers to extracted PBCH symbols in frequency-domain.
/// - first index: rx antenna [0..nb_antennas_rx[
/// - second index: ? [0..287] (hard coded)
int32_t
**
rxdataF_ext
;
/// \brief Pointers to extracted and compensated PBCH symbols in frequency-domain.
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..287] (hard coded)
int32_t
**
rxdataF_comp
;
/// \brief Hold the channel estimates in frequency domain.
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
int32_t
**
dl_ch_estimates
;
/// \brief Pointers to downlink channel estimates in frequency-domain extracted in PRBS.
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..287] (hard coded)
int32_t
**
dl_ch_estimates_ext
;
/// \brief Hold the channel estimates in time domain (used for tracking).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: samples? [0..2*ofdm_symbol_size[
int32_t
**
dl_ch_estimates_time
;
int
log2_maxh
;
uint8_t
pbch_a
[
NR_POLAR_PBCH_PAYLOAD_BITS
>>
3
];
uint32_t
pbch_a_interleaved
;
uint32_t
pbch_a_prime
;
uint8_t
pbch_e
[
NR_POLAR_PBCH_E
];
int16_t
demod_pbch_e
[
NR_POLAR_PBCH_E
];
/// \brief Pointer to PBCH llrs.
/// - first index: ? [0..1919] (hard coded)
int16_t
*
llr
;
/// \brief Pointer to PBCH decoded output.
/// - first index: ? [0..63] (hard coded)
uint8_t
*
decoded_output
;
/// \brief PBCH additional bits
uint8_t
xtra_byte
;
/// \brief Total number of PDU errors.
uint32_t
pdu_errors
;
/// \brief Total number of PDU errors 128 frames ago.
...
...
@@ -696,7 +662,7 @@ typedef struct {
/// \brief Total number of consecutive PDU errors.
uint32_t
pdu_errors_conseq
;
/// \brief FER (in percent) .
uint32_t
pdu_fer
;
//
uint32_t pdu_fer;
}
NR_UE_PBCH
;
typedef
struct
{
...
...
@@ -1075,7 +1041,7 @@ typedef struct {
#endif
int
dl_stats
[
5
];
void
*
scopeData
;
}
PHY_VARS_NR_UE
;
/* this structure is used to pass both UE phy vars and
...
...
openair1/SCHED_NR_UE/defs.h
View file @
53001d0d
...
...
@@ -82,6 +82,11 @@
#define DAQ_AGC_OFF 0
typedef
struct
{
uint8_t
decoded_output
[
64
];
uint8_t
xtra_byte
;
}
fapiPbch_t
;
/** @addtogroup _PHY_PROCEDURES_
* @{
*/
...
...
@@ -398,7 +403,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
NR_UE_DLSCH_t
*
dlsch0
,
NR_UE_DLSCH_t
*
dlsch1
,
uint16_t
n_pdus
,
UE_nr_rxtx_proc_t
*
proc
);
UE_nr_rxtx_proc_t
*
proc
,
void
*
typeSpecific
);
bool
nr_ue_dlsch_procedures
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
53001d0d
...
...
@@ -118,7 +118,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
NR_UE_DLSCH_t
*
dlsch0
,
NR_UE_DLSCH_t
*
dlsch1
,
uint16_t
n_pdus
,
UE_nr_rxtx_proc_t
*
proc
){
UE_nr_rxtx_proc_t
*
proc
,
void
*
typeSpecific
){
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
...
...
@@ -162,8 +163,11 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
pdsch_pdu
.
pdu_length
=
dlsch0
->
harq_processes
[
dlsch0
->
current_harq_pid
]
->
TBS
/
8
;
break
;
case
FAPI_NR_RX_PDU_TYPE_SSB
:
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
pdu
=
ue
->
pbch_vars
[
gNB_id
]
->
decoded_output
;
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
additional_bits
=
ue
->
pbch_vars
[
gNB_id
]
->
xtra_byte
;
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
pdu
=
malloc
(
sizeof
(((
fapiPbch_t
*
)
typeSpecific
)
->
decoded_output
));
memcpy
(
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
pdu
,
((
fapiPbch_t
*
)
typeSpecific
)
->
decoded_output
,
sizeof
(((
fapiPbch_t
*
)
typeSpecific
)
->
decoded_output
));
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
additional_bits
=
((
fapiPbch_t
*
)
typeSpecific
)
->
xtra_byte
;
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
ssb_index
=
(
frame_parms
->
ssb_index
)
&
0x7
;
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
ssb_length
=
frame_parms
->
Lmax
;
rx_ind
->
rx_indication_body
[
n_pdus
-
1
].
ssb_pdu
.
cell_id
=
frame_parms
->
Nid_cell
;
...
...
@@ -353,10 +357,9 @@ void nr_ue_measurement_procedures(uint16_t l,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES
,
VCD_FUNCTION_OUT
);
}
void
nr_ue_pbch_procedures
(
uint8_t
gNB_id
,
static
void
nr_ue_pbch_procedures
(
uint8_t
gNB_id
,
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
abstraction_flag
)
UE_nr_rxtx_proc_t
*
proc
,
int
estimateSz
,
struct
complex16
dl_ch_estimates
[][
estimateSz
])
{
int
ret
=
0
;
...
...
@@ -368,13 +371,15 @@ void nr_ue_pbch_procedures(uint8_t gNB_id,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES
,
VCD_FUNCTION_IN
);
LOG_D
(
PHY
,
"[UE %d] Frame %d Slot %d, Trying PBCH (NidCell %d, gNB_id %d)
\n
"
,
ue
->
Mod_id
,
frame_rx
,
nr_slot_rx
,
ue
->
frame_parms
.
Nid_cell
,
gNB_id
);
fapiPbch_t
result
;
ret
=
nr_rx_pbch
(
ue
,
proc
,
estimateSz
,
dl_ch_estimates
,
ue
->
pbch_vars
[
gNB_id
],
&
ue
->
frame_parms
,
gNB_id
,
(
ue
->
frame_parms
.
ssb_index
)
&
7
,
SISO
);
SISO
,
&
result
);
if
(
ret
==
0
)
{
...
...
@@ -444,7 +449,6 @@ void nr_ue_pbch_procedures(uint8_t gNB_id,
}
if
(
frame_rx
%
100
==
0
)
{
ue
->
pbch_vars
[
gNB_id
]
->
pdu_fer
=
ue
->
pbch_vars
[
gNB_id
]
->
pdu_errors
-
ue
->
pbch_vars
[
gNB_id
]
->
pdu_errors_last
;
ue
->
pbch_vars
[
gNB_id
]
->
pdu_errors_last
=
ue
->
pbch_vars
[
gNB_id
]
->
pdu_errors
;
}
...
...
@@ -794,16 +798,16 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
switch
(
pdsch
)
{
case
RA_PDSCH
:
nr_fill_dl_indication
(
&
dl_indication
,
NULL
,
rx_ind
,
proc
,
ue
,
gNB_id
);
nr_fill_rx_indication
(
rx_ind
,
FAPI_NR_RX_PDU_TYPE_RAR
,
gNB_id
,
ue
,
dlsch0
,
NULL
,
number_pdus
,
proc
);
nr_fill_rx_indication
(
rx_ind
,
FAPI_NR_RX_PDU_TYPE_RAR
,
gNB_id
,
ue
,
dlsch0
,
NULL
,
number_pdus
,
proc
,
NULL
);
ue
->
UE_mode
[
gNB_id
]
=
RA_RESPONSE
;
break
;
case
PDSCH
:
nr_fill_dl_indication
(
&
dl_indication
,
NULL
,
rx_ind
,
proc
,
ue
,
gNB_id
);
nr_fill_rx_indication
(
rx_ind
,
FAPI_NR_RX_PDU_TYPE_DLSCH
,
gNB_id
,
ue
,
dlsch0
,
NULL
,
number_pdus
,
proc
);
nr_fill_rx_indication
(
rx_ind
,
FAPI_NR_RX_PDU_TYPE_DLSCH
,
gNB_id
,
ue
,
dlsch0
,
NULL
,
number_pdus
,
proc
,
NULL
);
break
;
case
SI_PDSCH
:
nr_fill_dl_indication
(
&
dl_indication
,
NULL
,
rx_ind
,
proc
,
ue
,
gNB_id
);
nr_fill_rx_indication
(
rx_ind
,
FAPI_NR_RX_PDU_TYPE_SIB
,
gNB_id
,
ue
,
dlsch0
,
NULL
,
number_pdus
,
proc
);
nr_fill_rx_indication
(
rx_ind
,
FAPI_NR_RX_PDU_TYPE_SIB
,
gNB_id
,
ue
,
dlsch0
,
NULL
,
number_pdus
,
proc
,
NULL
);
break
;
default:
break
;
...
...
@@ -1399,6 +1403,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if
(
slot_ssb
)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH
,
VCD_FUNCTION_IN
);
LOG_D
(
PHY
,
" ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------
\n
"
,
frame_rx
%
1024
,
nr_slot_rx
);
const
int
estimateSz
=
7
*
2
*
sizeof
(
int
)
*
fp
->
ofdm_symbol_size
;
struct
complex16
dl_ch_estimates
[
fp
->
nb_antennas_rx
][
estimateSz
];
struct
complex16
dl_ch_estimates_time
[
fp
->
nb_antennas_rx
][
estimateSz
];
for
(
int
i
=
1
;
i
<
4
;
i
++
)
{
nr_slot_fep
(
ue
,
...
...
@@ -1408,7 +1415,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
start_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
nr_pbch_channel_estimation
(
ue
,
proc
,
gNB_id
,
nr_slot_rx
,(
ue
->
symbol_offset
+
i
)
%
(
fp
->
symbols_per_slot
),
i
-
1
,(
fp
->
ssb_index
)
&
7
,
fp
->
half_frame_bit
);
nr_pbch_channel_estimation
(
ue
,
estimateSz
,
dl_ch_estimates
,
dl_ch_estimates_time
,
proc
,
gNB_id
,
nr_slot_rx
,(
ue
->
symbol_offset
+
i
)
%
(
fp
->
symbols_per_slot
),
i
-
1
,(
fp
->
ssb_index
)
&
7
,
fp
->
half_frame_bit
);
stop_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
}
...
...
@@ -1417,13 +1424,14 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if
((
ue
->
decode_MIB
==
1
)
&&
slot_pbch
)
{
LOG_D
(
PHY
,
" ------ Decode MIB: frame.slot %d.%d ------
\n
"
,
frame_rx
%
1024
,
nr_slot_rx
);
nr_ue_pbch_procedures
(
gNB_id
,
ue
,
proc
,
0
);
nr_ue_pbch_procedures
(
gNB_id
,
ue
,
proc
,
estimateSz
,
dl_ch_estimates
);
if
(
ue
->
no_timing_correction
==
0
)
{
LOG_D
(
PHY
,
"start adjust sync slot = %d no timing %d
\n
"
,
nr_slot_rx
,
ue
->
no_timing_correction
);
nr_adjust_synch_ue
(
fp
,
ue
,
gNB_id
,
estimateSz
,
dl_ch_estimates_time
,
frame_rx
,
nr_slot_rx
,
0
,
...
...
openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
View file @
53001d0d
#include "nfapi/oai_integration/vendor_ext.h"
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);
}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
...
...
@@ -35,4 +36,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
NR_UE_DLSCH_t
*
dlsch0
,
NR_UE_DLSCH_t
*
dlsch1
,
uint16_t
n_pdus
,
UE_nr_rxtx_proc_t
*
proc
)
{}
UE_nr_rxtx_proc_t
*
proc
,
void
*
typeSpecific
)
{}
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
53001d0d
...
...
@@ -720,6 +720,9 @@ int main(int argc, char **argv)
UE_nr_rxtx_proc_t
proc
=
{
0
};
UE
->
rx_offset
=
0
;
uint8_t
ssb_index
=
0
;
const
int
estimateSz
=
7
*
2
*
sizeof
(
int
)
*
frame_parms
->
ofdm_symbol_size
;
struct
complex16
dl_ch_estimates
[
frame_parms
->
nb_antennas_rx
][
estimateSz
];
struct
complex16
dl_ch_estimates_time
[
frame_parms
->
nb_antennas_rx
][
estimateSz
];
while
(
!
((
SSB_positions
>>
ssb_index
)
&
0x01
))
ssb_index
++
;
// to select the first transmitted ssb
UE
->
symbol_offset
=
nr_get_ssb_start_symbol
(
frame_parms
,
ssb_index
);
...
...
@@ -730,17 +733,20 @@ int main(int argc, char **argv)
i
%
frame_parms
->
symbols_per_slot
,
ssb_slot
);
nr_pbch_channel_estimation
(
UE
,
&
proc
,
0
,
ssb_slot
,
i
%
frame_parms
->
symbols_per_slot
,
i
-
(
UE
->
symbol_offset
+
1
),
ssb_index
%
8
,
n_hf
);
nr_pbch_channel_estimation
(
UE
,
estimateSz
,
dl_ch_estimates
,
dl_ch_estimates_time
,
&
proc
,
0
,
ssb_slot
,
i
%
frame_parms
->
symbols_per_slot
,
i
-
(
UE
->
symbol_offset
+
1
),
ssb_index
%
8
,
n_hf
);
}
fapiPbch_t
result
;
ret
=
nr_rx_pbch
(
UE
,
&
proc
,
estimateSz
,
dl_ch_estimates
,
UE
->
pbch_vars
[
0
],
frame_parms
,
0
,
ssb_index
%
8
,
SISO
);
SISO
,
&
result
);
if
(
ret
==
0
)
{
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
...
...
@@ -749,9 +755,9 @@ int main(int argc, char **argv)
for
(
int
i
=
0
;
i
<
8
;
i
++
)
gNB_xtra_byte
|=
((
gNB
->
pbch
.
pbch_a
>>
(
31
-
i
))
&
1
)
<<
(
7
-
i
);
payload_ret
=
(
UE
->
pbch_vars
[
0
]
->
xtra_byte
==
gNB_xtra_byte
);
payload_ret
=
(
result
.
xtra_byte
==
gNB_xtra_byte
);
for
(
i
=
0
;
i
<
3
;
i
++
){
payload_ret
+=
(
UE
->
pbch_vars
[
0
]
->
decoded_output
[
i
]
==
((
msgDataTx
.
ssb
[
ssb_index
].
ssb_pdu
.
ssb_pdu_rel15
.
bchPayload
>>
(
8
*
i
))
&
0xff
));
payload_ret
+=
(
result
.
decoded_output
[
i
]
==
((
msgDataTx
.
ssb
[
ssb_index
].
ssb_pdu
.
ssb_pdu_rel15
.
bchPayload
>>
(
8
*
i
))
&
0xff
));
}
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte);
//printf("ret %d\n", payload_ret);
...
...
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