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
lizhongxiao
OpenXG-RAN
Commits
cf552b7b
Commit
cf552b7b
authored
Jun 05, 2020
by
Hongzhi Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding rsrp measurement
parent
5a5f5039
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
2 deletions
+118
-2
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+4
-0
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+99
-1
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+13
-1
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+2
-0
No files found.
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
View file @
cf552b7b
...
...
@@ -86,6 +86,10 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
unsigned
char
rank_adaptation
,
uint8_t
subframe
);
void
nr_ue_rrc_measurements
(
PHY_VARS_NR_UE
*
ue
,
uint8_t
slot
,
uint8_t
abstraction_flag
);
void
phy_adjust_gain_nr
(
PHY_VARS_NR_UE
*
ue
,
uint32_t
rx_power_fil_dB
,
uint8_t
eNB_id
);
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
View file @
cf552b7b
...
...
@@ -23,6 +23,7 @@
#include "PHY/phy_extern_nr_ue.h"
#include "common/utils/LOG/log.h"
#include "PHY/sse_intrin.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
//#define k1 1000
#define k1 ((long long int) 1000)
...
...
@@ -75,7 +76,33 @@ int16_t get_nr_PL(PHY_VARS_NR_UE *ue,uint8_t gNB_index)
//(ue->frame_parms.pdsch_config_common.referenceSignalPower*10))/10));
}
uint32_t
get_nr_rx_total_gain_dB
(
module_id_t
Mod_id
,
uint8_t
CC_id
)
{
PHY_VARS_NR_UE
*
ue
=
PHY_vars_UE_g
[
Mod_id
][
CC_id
];
if
(
ue
)
return
ue
->
rx_total_gain_dB
;
return
0xFFFFFFFF
;
}
double
get_nr_RSRP
(
module_id_t
Mod_id
,
uint8_t
CC_id
,
uint8_t
gNB_index
)
{
AssertFatal
(
PHY_vars_UE_g
!=
NULL
,
"PHY_vars_UE_g is null
\n
"
);
AssertFatal
(
PHY_vars_UE_g
[
Mod_id
]
!=
NULL
,
"PHY_vars_UE_g[%d] is null
\n
"
,
Mod_id
);
AssertFatal
(
PHY_vars_UE_g
[
Mod_id
][
CC_id
]
!=
NULL
,
"PHY_vars_UE_g[%d][%d] is null
\n
"
,
Mod_id
,
CC_id
);
PHY_VARS_NR_UE
*
ue
=
PHY_vars_UE_g
[
Mod_id
][
CC_id
];
if
(
ue
)
return
((
dB_fixed_times10
(
ue
->
measurements
.
rsrp
[
gNB_index
]))
/
10
.
0
-
get_nr_rx_total_gain_dB
(
Mod_id
,
0
)
-
10
*
log10
(
20
*
12
));
return
-
140
.
0
;
}
void
nr_ue_measurements
(
PHY_VARS_NR_UE
*
ue
,
...
...
@@ -194,3 +221,74 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
_m_empty
();
#endif
}
void
nr_ue_rrc_measurements
(
PHY_VARS_NR_UE
*
ue
,
uint8_t
slot
,
uint8_t
abstraction_flag
)
{
int
aarx
,
rb
;
int16_t
*
rxF
;
uint16_t
Nid_cell
=
ue
->
frame_parms
.
Nid_cell
;
uint8_t
eNB_offset
=
0
,
l
,
nushift
;
uint16_t
off
,
nb_rb
;
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
0
);
nushift
=
ue
->
frame_parms
.
Nid_cell
%
4
;
ue
->
frame_parms
.
nushift
=
nushift
;
unsigned
int
ssb_offset
=
ue
->
frame_parms
.
first_carrier_offset
+
ue
->
frame_parms
.
ssb_start_subcarrier
;
if
(
ssb_offset
>=
ue
->
frame_parms
.
ofdm_symbol_size
)
ssb_offset
-=
ue
->
frame_parms
.
ofdm_symbol_size
;
ue
->
measurements
.
rsrp
[
eNB_offset
]
=
0
;
if
(
mac
->
csirc
->
reportQuantity
.
choice
.
ssb_Index_RSRP
){
nb_rb
=
60
;
}
else
{
LOG_E
(
PHY
,
"report quantity not supported
\n
"
);
}
if
(
abstraction_flag
==
0
)
{
for
(
l
=
0
;
l
<
1
;
l
++
)
{
LOG_D
(
PHY
,
"[UE %d] slot %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, l %d)
\n
"
,
ue
->
Mod_id
,
slot
,
Nid_cell
,
nushift
,
eNB_offset
,
l
);
for
(
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
rxF
=
(
int16_t
*
)
&
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
slot
]].
rxdataF
[
aarx
][(
l
*
ue
->
frame_parms
.
ofdm_symbol_size
)];
off
=
ssb_offset
+
nushift
;
if
(
l
==
0
)
{
for
(
rb
=
0
;
rb
<
nb_rb
;
rb
++
)
{
ue
->
measurements
.
rsrp
[
eNB_offset
]
+=
(((
int32_t
)(
rxF
[
off
])
*
rxF
[
off
])
+
((
int32_t
)(
rxF
[
off
+
1
])
*
rxF
[
off
+
1
]));
// printf("rb %d, off %d : %d\n",rb,off,((((int32_t)rxF[off])*rxF[off])+((int32_t)(rxF[off+1])*rxF[off+1])));
off
=
(
off
+
4
)
%
ue
->
frame_parms
.
ofdm_symbol_size
;
}
}
}
}
ue
->
measurements
.
rsrp
[
eNB_offset
]
/=
nb_rb
;
LOG_I
(
PHY
,
"eNB: %d, RSRP: %d
\n
"
,
eNB_offset
,
ue
->
measurements
.
rsrp
[
eNB_offset
]);
}
else
{
ue
->
measurements
.
rsrp
[
eNB_offset
]
=
-
93
;
}
if
(
eNB_offset
==
0
)
LOG_I
(
PHY
,
"[UE %d] slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f dBm/RE (%d), rsrq: %3.1f dB
\n
"
,
ue
->
Mod_id
,
slot
,
eNB_offset
,
(
eNB_offset
>
0
)
?
ue
->
measurements
.
adj_cell_id
[
eNB_offset
-
1
]
:
ue
->
frame_parms
.
Nid_cell
,
10
*
log10
(
ue
->
measurements
.
rsrp
[
eNB_offset
])
-
ue
->
rx_total_gain_dB
,
ue
->
measurements
.
rsrp
[
eNB_offset
],
(
10
*
log10
(
ue
->
measurements
.
rsrq
[
eNB_offset
])));
}
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
cf552b7b
...
...
@@ -53,6 +53,7 @@
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
//#define DEBUG_PHY_PROC
...
...
@@ -4208,6 +4209,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
uint8_t
nb_symb_pdcch
=
pdcch_vars
->
nb_search_space
>
0
?
pdcch_vars
->
pdcch_config
[
0
].
coreset
.
duration
:
0
;
uint8_t
dci_cnt
=
0
;
NR_DL_FRAME_PARMS
*
fp
=
&
ue
->
frame_parms
;
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX
,
VCD_FUNCTION_IN
);
...
...
@@ -4248,8 +4251,17 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
#endif
}
if
(
mac
->
csirc
->
reportQuantity
.
choice
.
ssb_Index_RSRP
){
printf
(
"first measurement ue->symbol_offset %d
\n
"
,
ue
->
symbol_offset
);
nr_ue_rrc_measurements
(
ue
,
nr_tti_rx
,
0
);
}
nr_ue_pbch_procedures
(
eNB_id
,
ue
,
proc
,
0
);
if
(
ue
->
no_timing_correction
==
0
)
{
LOG_I
(
PHY
,
"start adjust sync slot = %d no timing %d
\n
"
,
nr_tti_rx
,
ue
->
no_timing_correction
);
nr_adjust_synch_ue
(
fp
,
...
...
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
cf552b7b
...
...
@@ -48,6 +48,7 @@
#include "NR_PhysicalCellGroupConfig.h"
#include "NR_CellGroupConfig.h"
#include "NR_ServingCellConfig.h"
#include "NR_MeasConfig.h"
#include "fapi_nr_ue_interface.h"
#include "NR_IF_Module.h"
#include "../NR_MAC_gNB/nr_mac_common.h"
...
...
@@ -143,6 +144,7 @@ typedef struct {
NR_ServingCellConfigCommon_t
*
scc
;
NR_CellGroupConfig_t
*
scg
;
int
servCellIndex
;
NR_CSI_ReportConfig_t
*
csirc
;
//// MAC config
NR_DRX_Config_t
*
drx_Config
;
NR_SchedulingRequestConfig_t
*
schedulingRequestConfig
;
...
...
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