Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openairinterface-6g
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
OpenXG
openairinterface-6g
Commits
42b6576d
Commit
42b6576d
authored
Sep 27, 2025
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix RSRP computation at UE (let the higher layers compute the index)
parent
55a56002
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
29 deletions
+22
-29
common/utils/nr/nr_common.h
common/utils/nr/nr_common.h
+0
-2
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+1
-2
openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
+1
-1
openair1/SIMULATION/NR_PHY/nr_unitary_common.c
openair1/SIMULATION/NR_PHY/nr_unitary_common.c
+1
-1
openair2/COMMON/mac_messages_types.h
openair2/COMMON/mac_messages_types.h
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+14
-18
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+1
-1
openair2/RRC/NR_UE/L2_interface_ue.h
openair2/RRC/NR_UE/L2_interface_ue.h
+1
-1
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+2
-2
No files found.
common/utils/nr/nr_common.h
View file @
42b6576d
...
...
@@ -88,8 +88,6 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
#define NR_NUMBER_OF_SYMBOLS_PER_SLOT_EXTENDED_CP 12
#define NR_MAX_NB_LAYERS 4 // 8
#define BOUNDED_EVAL(a, b, c) (min(c, max(a, b)))
// Since the IQ samples are represented by SQ15 R+I (see https://en.wikipedia.org/wiki/Q_(number_format)) we need to compensate when
// calcualting signal energy. Instead of shifting each sample right by 15, we can normalize the result in dB scale once its
// calcualted. Signal energy is calculated using RMS^2, where each sample is squared before taking the average of the sum, therefore
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
View file @
42b6576d
...
...
@@ -236,11 +236,10 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
.
gNB_index
=
proc
->
gNB_id
,
.
meas_type
=
NFAPI_NR_SS_MEAS
,
.
Nid_cell
=
ue
->
frame_parms
.
Nid_cell
,
.
rsrp_dBm
=
ue
->
measurements
.
ssb_rsrp_dBm
[
ssb_index
],
.
ssb_index
=
ssb_index
,
.
is_neighboring_cell
=
false
,
};
int
ssb_rsrp_dBm
=
ue
->
measurements
.
ssb_rsrp_dBm
[
ssb_index
];
l1_measurements
.
rsrp_dBm
=
BOUNDED_EVAL
(
16
,
ssb_rsrp_dBm
+
157
,
113
);
// TS 38.133 - Table 10.1.6.1-1
nr_downlink_indication_t
dl_indication
=
{
0
};
fapi_nr_rx_indication_t
rx_ind
=
{
0
};
nr_fill_dl_indication
(
&
dl_indication
,
NULL
,
&
rx_ind
,
proc
,
ue
,
NULL
);
...
...
openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
View file @
42b6576d
...
...
@@ -987,7 +987,7 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
.
meas_type
=
NFAPI_NR_CSI_MEAS
,
.
Nid_cell
=
frame_parms
->
Nid_cell
,
.
is_neighboring_cell
=
false
,
.
rsrp_dBm
=
BOUNDED_EVAL
(
16
,
rsrp_dBm
+
157
,
113
),
// TS 38.133 - Table 10.1.6.1-1
.
rsrp_dBm
=
rsrp_dBm
,
.
rank_indicator
=
rank_indicator
,
.
i1
=
*
i1
,
.
i2
=
*
i2
,
...
...
openair1/SIMULATION/NR_PHY/nr_unitary_common.c
View file @
42b6576d
...
...
@@ -184,6 +184,6 @@ void nr_mac_rrc_meas_ind_ue(module_id_t module_id,
uint16_t
Nid_cell
,
bool
csi_meas
,
bool
is_neighboring_cell
,
uint8_
t
rsrp_dBm
)
in
t
rsrp_dBm
)
{
}
openair2/COMMON/mac_messages_types.h
View file @
42b6576d
...
...
@@ -146,7 +146,7 @@ typedef struct NRRrcMacSBcchDataInd_s {
typedef
struct
NRRrcMacMeasDataInd_s
{
uint8_t
gnb_index
;
uint8_
t
rsrp_dBm
;
in
t
rsrp_dBm
;
uint16_t
Nid_cell
;
bool
is_csi_meas
;
bool
is_neighboring_cell
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
42b6576d
...
...
@@ -139,7 +139,6 @@ static csi_payload_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
struct
NR_CSI_ReportConfig
*
csi_reportconfig
,
NR_CSI_ResourceConfigId_t
csi_ResourceConfigId
,
const
NR_CSI_MeasConfig_t
*
csi_MeasConfig
);
static
uint8_t
get_rsrp_index
(
int
rsrp
);
static
uint8_t
get_rsrp_diff_index
(
int
best_rsrp
,
int
current_rsrp
);
...
...
@@ -2917,6 +2916,18 @@ static int compare_ssb_rsrp(const void *a, const void *b)
return
mb
->
ssb_rsrp_dBm
-
ma
->
ssb_rsrp_dBm
;
}
// returns index from RSRP
// according to Table 10.1.6.1-1 in 38.133
static
uint8_t
get_rsrp_index
(
int
rsrp
)
{
int
index
=
rsrp
+
157
;
if
(
rsrp
>
-
44
)
index
=
113
;
if
(
rsrp
<
-
140
)
index
=
16
;
return
index
;
}
static
csi_payload_t
get_ssb_rsrp_payload
(
NR_UE_MAC_INST_t
*
mac
,
struct
NR_CSI_ReportConfig
*
csi_reportconfig
,
NR_CSI_ResourceConfigId_t
csi_ResourceConfigId
,
...
...
@@ -3126,15 +3137,14 @@ static csi_payload_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
}
// TODO: Improvements will be needed to cri_ssbri_bitlen>0
temp_payload
=
reverse_bits
(
mac
->
l1_measurements
.
rsrp_dBm
,
n_bits
);
// rsrp_dBm as in TS 38.133 - Table 10.1.6.1-1
temp_payload
=
get_rsrp_index
(
mac
->
l1_measurements
.
rsrp_dBm
);
temp_payload
=
reverse_bits
(
temp_payload
,
n_bits
);
LOG_D
(
NR_MAC
,
"cri_ssbri_bitlen = %d
\n
"
,
cri_ssbri_bitlen
);
LOG_D
(
NR_MAC
,
"rsrp_bitlen = %d
\n
"
,
rsrp_bitlen
);
LOG_D
(
NR_MAC
,
"diff_rsrp_bitlen = %d
\n
"
,
diff_rsrp_bitlen
);
LOG_D
(
NR_MAC
,
"n_bits = %d
\n
"
,
n_bits
);
LOG_D
(
NR_MAC
,
"csi_part1_payload = 0x%lx
\n
"
,
temp_payload
);
break
;
}
}
...
...
@@ -3145,20 +3155,6 @@ static csi_payload_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
return
csi
;
}
// returns index from RSRP
// according to Table 10.1.6.1-1 in 38.133
static
uint8_t
get_rsrp_index
(
int
rsrp
)
{
int
index
=
rsrp
+
157
;
if
(
rsrp
>-
44
)
index
=
113
;
if
(
rsrp
<-
140
)
index
=
16
;
return
index
;
}
// returns index from differential RSRP
// according to Table 10.1.6.1-2 in 38.133
static
uint8_t
get_rsrp_diff_index
(
int
best_rsrp
,
int
current_rsrp
)
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
42b6576d
...
...
@@ -37,7 +37,7 @@
typedef
uint32_t
channel_t
;
void
nr_mac_rrc_meas_ind_ue
(
module_id_t
module_id
,
uint32_t
gNB_index
,
uint16_t
Nid_cell
,
bool
csi_meas
,
bool
is_neighboring_cell
,
uint8_
t
rsrp_dBm
)
void
nr_mac_rrc_meas_ind_ue
(
module_id_t
module_id
,
uint32_t
gNB_index
,
uint16_t
Nid_cell
,
bool
csi_meas
,
bool
is_neighboring_cell
,
in
t
rsrp_dBm
)
{
MessageDef
*
message_p
=
itti_alloc_new_message
(
TASK_MAC_UE
,
0
,
NR_RRC_MAC_MEAS_DATA_IND
);
NR_RRC_MAC_MEAS_DATA_IND
(
message_p
).
gnb_index
=
gNB_index
;
...
...
openair2/RRC/NR_UE/L2_interface_ue.h
View file @
42b6576d
...
...
@@ -42,7 +42,7 @@ void nr_mac_rrc_meas_ind_ue(module_id_t module_id,
uint16_t
Nid_cell
,
bool
csi_meas
,
bool
is_neighboring_cell
,
uint8_
t
rsrp_dBm
);
in
t
rsrp_dBm
);
void
nr_mac_rrc_inactivity_timer_ind
(
const
module_id_t
mod_id
);
void
nr_mac_rrc_msg3_ind
(
const
module_id_t
mod_id
,
const
int
rnti
,
bool
prepare_payload
);
void
nr_ue_rrc_timer_trigger
(
int
instance
,
int
frame
,
int
gnb_id
);
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
42b6576d
...
...
@@ -2589,14 +2589,14 @@ void *rrc_nrue(void *notUsed)
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
is_neighboring_cell
?
"Neighboring cell"
:
"Active cell"
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
Nid_cell
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
is_csi_meas
?
"CSI meas"
:
"SSB meas"
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
rsrp_dBm
-
157
);
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
rsrp_dBm
);
rrcPerNB_t
*
rrcNB
=
rrc
->
perNB
+
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
gnb_index
;
nr_ue_meas_filtering
(
rrcNB
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
is_neighboring_cell
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
Nid_cell
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
is_csi_meas
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
rsrp_dBm
-
157
);
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
rsrp_dBm
);
nr_ue_check_meas_report
(
rrc
,
NR_RRC_MAC_MEAS_DATA_IND
(
msg_p
).
gnb_index
);
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