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
Michael Black
OpenXG-RAN
Commits
0ec09ea9
Commit
0ec09ea9
authored
Jan 17, 2023
by
General ABS
Committed by
rmagueta
Jun 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move nr_ue_meas_neighboring_cell() function to a new thread
parent
baba58df
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
7 deletions
+111
-7
openair1/PHY/MODULATION/modulation_UE.h
openair1/PHY/MODULATION/modulation_UE.h
+8
-0
openair1/PHY/MODULATION/slot_fep_nr.c
openair1/PHY/MODULATION/slot_fep_nr.c
+57
-0
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+1
-1
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+16
-3
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+4
-1
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+25
-2
No files found.
openair1/PHY/MODULATION/modulation_UE.h
View file @
0ec09ea9
...
...
@@ -60,6 +60,14 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
bool
pbch_decoded
,
c16_t
rxdataF
[][
ue
->
frame_parms
.
samples_per_slot_wCP
]);
int
nr_slot_fep_meas
(
PHY_VARS_NR_UE
*
ue
,
int
Ns
,
unsigned
char
symbol
,
int
sample_offset
,
uint32_t
rxdata_size
,
int
rxdata
[][
rxdata_size
],
c16_t
rxdataF
[][
ue
->
frame_parms
.
samples_per_slot_wCP
]);
int
slot_fep_mbsfn
(
PHY_VARS_UE
*
phy_vars_ue
,
unsigned
char
l
,
int
subframe
,
...
...
openair1/PHY/MODULATION/slot_fep_nr.c
View file @
0ec09ea9
...
...
@@ -250,6 +250,63 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
return
0
;
}
int
nr_slot_fep_meas
(
PHY_VARS_NR_UE
*
ue
,
int
Ns
,
unsigned
char
symbol
,
int
sample_offset
,
uint32_t
rxdata_size
,
int
rxdata
[][
rxdata_size
],
c16_t
rxdataF
[][
ue
->
frame_parms
.
samples_per_slot_wCP
])
{
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
AssertFatal
(
symbol
<
frame_parms
->
symbols_per_slot
,
"slot_fep: symbol must be between 0 and %d
\n
"
,
frame_parms
->
symbols_per_slot
-
1
);
AssertFatal
(
Ns
<
frame_parms
->
slots_per_frame
,
"slot_fep: Ns must be between 0 and %d
\n
"
,
frame_parms
->
slots_per_frame
-
1
);
unsigned
int
nb_prefix_samples
=
frame_parms
->
nb_prefix_samples
;
unsigned
int
nb_prefix_samples0
=
frame_parms
->
nb_prefix_samples
;
unsigned
int
frame_length_samples
=
frame_parms
->
samples_per_frame
;
dft_size_idx_t
dftsize
=
get_dft
(
frame_parms
->
ofdm_symbol_size
);
unsigned
int
slot_offset
=
frame_parms
->
get_samples_slot_timestamp
(
Ns
,
frame_parms
,
0
);
unsigned
int
abs_symbol
=
Ns
*
frame_parms
->
symbols_per_slot
+
symbol
;
unsigned
int
rx_offset
=
sample_offset
+
slot_offset
;
for
(
int
idx_symb
=
Ns
*
frame_parms
->
symbols_per_slot
;
idx_symb
<=
abs_symbol
;
idx_symb
++
)
{
rx_offset
+=
(
abs_symbol
%
(
0x7
<<
frame_parms
->
numerology_index
))
?
nb_prefix_samples
:
nb_prefix_samples0
;
}
rx_offset
+=
frame_parms
->
ofdm_symbol_size
*
symbol
;
int32_t
tmp_dft_in
[
8192
]
__attribute__
((
aligned
(
32
)));
for
(
unsigned
char
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
int16_t
*
rxdata_ptr
;
rx_offset
%=
frame_length_samples
*
2
;
if
(
rx_offset
+
frame_parms
->
ofdm_symbol_size
>
frame_length_samples
*
2
)
{
memcpy
((
void
*
)
&
tmp_dft_in
[
0
],
(
void
*
)
&
rxdata
[
aa
][
rx_offset
],
(
frame_length_samples
*
2
-
rx_offset
)
*
sizeof
(
int32_t
));
memcpy
((
void
*
)
&
tmp_dft_in
[
frame_length_samples
*
2
-
rx_offset
],
(
void
*
)
&
rxdata
[
aa
][
0
],
(
frame_parms
->
ofdm_symbol_size
-
(
frame_length_samples
*
2
-
rx_offset
))
*
sizeof
(
int32_t
));
rxdata_ptr
=
(
int16_t
*
)
tmp_dft_in
;
}
else
if
((
rx_offset
&
7
)
!=
0
)
{
// if input to dft is not 256-bit aligned
memcpy
((
void
*
)
&
tmp_dft_in
[
0
],
(
void
*
)
&
rxdata
[
aa
][
rx_offset
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
rxdata_ptr
=
(
int16_t
*
)
tmp_dft_in
;
}
else
{
// use dft input from RX buffer directly
rxdata_ptr
=
(
int16_t
*
)
&
rxdata
[
aa
][
rx_offset
];
}
start_meas
(
&
ue
->
rx_dft_stats
);
dft
(
dftsize
,
rxdata_ptr
,
(
int16_t
*
)
&
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
stop_meas
(
&
ue
->
rx_dft_stats
);
int
symb_offset
=
(
Ns
%
frame_parms
->
slots_per_subframe
)
*
frame_parms
->
symbols_per_slot
;
c16_t
rot2
=
frame_parms
->
symbol_rotation
[
0
][
symbol
+
symb_offset
];
rot2
.
i
=
-
rot2
.
i
;
c16_t
*
this_symbol
=
&
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
];
rotate_cpx_vector
(
this_symbol
,
&
rot2
,
this_symbol
,
frame_parms
->
ofdm_symbol_size
,
15
);
}
return
0
;
}
int
nr_slot_fep_ul
(
NR_DL_FRAME_PARMS
*
frame_parms
,
int32_t
*
rxdata
,
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
View file @
0ec09ea9
...
...
@@ -115,7 +115,7 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t
*
proc
,
c16_t
rxdataF
[][
ue
->
frame_parms
.
samples_per_slot_wCP
]);
void
nr_ue_meas_neighboring_cell
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
);
void
*
nr_ue_meas_neighboring_cell
(
void
*
param
);
void
nr_ue_rrc_measurements
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
View file @
0ec09ea9
...
...
@@ -263,11 +263,20 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
}
}
void
nr_ue_meas_neighboring_cell
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
)
void
*
nr_ue_meas_neighboring_cell
(
void
*
param
)
{
PHY_VARS_NR_UE
*
ue
=
(
PHY_VARS_NR_UE
*
)
param
;
UE_nr_rxtx_proc_t
*
proc
=
ue
->
measurements
.
meas_proc
;
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
int
**
rxdata
=
ue
->
common_vars
.
rxdata
;
// Copy rxdata, because this function is running in a separate thread, and rxdata will be changed in another thread, before this function finishes measuring.
uint32_t
rxdata_size
=
(
2
*
(
frame_parms
->
samples_per_frame
)
+
frame_parms
->
ofdm_symbol_size
);
int
rxdata
[
frame_parms
->
nb_antennas_rx
][
rxdata_size
];
for
(
int
i
=
0
;
i
<
frame_parms
->
nb_antennas_rx
;
i
++
)
{
memcpy
(
rxdata
[
i
],
ue
->
common_vars
.
rxdata
[
i
],
rxdata_size
*
sizeof
(
int32_t
));
}
const
uint32_t
rxdataF_sz
=
ue
->
frame_parms
.
samples_per_slot_wCP
;
for
(
int
cell_idx
=
0
;
cell_idx
<
NUMBER_OF_NEIGHBORING_CELLs_MAX
;
cell_idx
++
)
{
...
...
@@ -276,6 +285,7 @@ void nr_ue_meas_neighboring_cell(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc)
if
(
nr_neighboring_cell
->
active
==
0
)
{
continue
;
}
ue
->
measurements
.
meas_running
=
true
;
__attribute__
((
aligned
(
32
)))
c16_t
rxdataF
[
ue
->
frame_parms
.
nb_antennas_rx
][
rxdataF_sz
];
neighboring_cell_info_t
*
neighboring_cell_info
=
&
ue
->
measurements
.
neighboring_cell_info
[
cell_idx
];
...
...
@@ -333,7 +343,7 @@ void nr_ue_meas_neighboring_cell(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc)
unsigned
int
k
=
0
;
uint8_t
sss_symbol
=
SSS_SYMBOL_NB
-
PSS_SYMBOL_NB
;
nr_slot_fep_
init_sync
(
ue
,
proc
,
sss_symbol
,
ssb_offset
,
false
,
rxdataF
);
nr_slot_fep_
meas
(
ue
,
0
,
sss_symbol
,
ssb_offset
,
rxdata_size
,
rxdata
,
rxdataF
);
c16_t
*
sss_rx
=
&
rxdataF
[
0
][
frame_parms
->
ofdm_symbol_size
*
sss_symbol
];
if
(
nr_neighboring_cell
->
perform_validation
==
1
)
{
...
...
@@ -438,6 +448,9 @@ void nr_ue_meas_neighboring_cell(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc)
free
(
rx_ind
);
}
}
ue
->
measurements
.
meas_running
=
false
;
pthread_detach
(
ue
->
measurements
.
meas_thread
);
return
NULL
;
}
// This function computes the received noise power
...
...
openair1/PHY/defs_nr_UE.h
View file @
0ec09ea9
...
...
@@ -217,8 +217,11 @@ typedef struct {
unsigned
char
nb_antennas_rx
;
/// DLSCH error counter
// short dlsch_errors;
/// Info about neighboring cells to per
morme
the measurements
/// Info about neighboring cells to per
form
the measurements
neighboring_cell_info_t
neighboring_cell_info
[
NUMBER_OF_NEIGHBORING_CELLs_MAX
];
UE_nr_rxtx_proc_t
*
meas_proc
;
pthread_t
meas_thread
;
bool
meas_running
;
}
PHY_NR_MEASUREMENTS
;
typedef
struct
{
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
0ec09ea9
...
...
@@ -858,6 +858,26 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
return
dec
;
}
bool
check_meas_to_perform
(
PHY_VARS_NR_UE
*
ue
,
int
nr_slot_rx
)
{
if
(
nr_slot_rx
!=
0
)
{
return
false
;
}
if
(
ue
->
measurements
.
meas_running
==
true
)
{
return
false
;
}
for
(
int
cell_idx
=
0
;
cell_idx
<
NUMBER_OF_NEIGHBORING_CELLs_MAX
;
cell_idx
++
)
{
fapi_nr_neighboring_cell_t
*
nr_neighboring_cell
=
&
PHY_vars_UE_g
[
ue
->
Mod_id
][
ue
->
CC_id
]
->
nrUE_config
.
meas_config
.
nr_neighboring_cell
[
cell_idx
];
if
(
nr_neighboring_cell
->
active
==
1
)
{
return
true
;
}
}
return
false
;
}
void
pbch_pdcch_processing
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
nr_phy_data_t
*
phy_data
)
{
...
...
@@ -982,8 +1002,11 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue,
}
// for rsc_id
}
// for gNB_id
if
(
nr_slot_rx
==
0
)
{
nr_ue_meas_neighboring_cell
(
ue
,
proc
);
PHY_NR_MEASUREMENTS
*
measurements
=
&
ue
->
measurements
;
if
(
check_meas_to_perform
(
ue
,
nr_slot_rx
)
==
true
)
{
measurements
->
meas_proc
=
proc
;
int
ret
=
pthread_create
(
&
measurements
->
meas_thread
,
NULL
,
nr_ue_meas_neighboring_cell
,
(
void
*
)
ue
);
AssertFatal
(
ret
==
0
,
"%s: Thread for neighboring measurements was not created, errno: %d
\n
"
,
__FUNCTION__
,
errno
);
}
if
((
frame_rx
%
64
==
0
)
&&
(
nr_slot_rx
==
0
))
{
...
...
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