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
wangjie
OpenXG-RAN
Commits
48b847cb
Commit
48b847cb
authored
Apr 23, 2021
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reworking extraction of csi meas report (first version)
parent
773ebbb6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
152 additions
and
82 deletions
+152
-82
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+2
-4
openair1/SCHED_NR/fapi_nr_l1.c
openair1/SCHED_NR/fapi_nr_l1.c
+2
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+146
-75
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+2
-1
No files found.
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
48b847cb
...
...
@@ -1571,8 +1571,7 @@ typedef struct
{
uint8_t
csi_part1_crc
;
uint16_t
csi_part1_bit_len
;
//! fixme
uint8_t
*
csi_part1_payload
;
//uint8_t[ceil(csiPart1BitLen/8)]
uint8_t
*
csi_part1_payload
;
}
nfapi_nr_csi_part1_pdu_t
;
...
...
@@ -1581,8 +1580,7 @@ typedef struct
{
uint8_t
csi_part2_crc
;
uint16_t
csi_part2_bit_len
;
//! fixme
uint8_t
*
csi_part2_payload
;
//uint8_t[ceil(csiPart2BitLen/8)]
uint8_t
*
csi_part2_payload
;
}
nfapi_nr_csi_part2_pdu_t
;
//table 3-63
...
...
openair1/SCHED_NR/fapi_nr_l1.c
View file @
48b847cb
...
...
@@ -137,7 +137,7 @@ void handle_nfapi_nr_csirs_pdu(PHY_VARS_gNB *gNB,
for
(
int
id
=
0
;
id
<
NUMBER_OF_NR_CSIRS_MAX
;
id
++
)
{
NR_gNB_CSIRS_t
*
csirs
=
&
gNB
->
csirs_pdu
[
id
];
if
(
csirs
->
active
==
0
)
{
LOG_
I
(
PHY
,
"Frame %d Slot %d CSI_RS with ID %d is now active
\n
"
,
frame
,
slot
,
id
);
LOG_
D
(
PHY
,
"Frame %d Slot %d CSI_RS with ID %d is now active
\n
"
,
frame
,
slot
,
id
);
csirs
->
frame
=
frame
;
csirs
->
slot
=
slot
;
csirs
->
active
=
1
;
...
...
@@ -219,7 +219,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
break
;
case
NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE
:
LOG_
I
(
PHY
,
"frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d
\n
"
,
frame
,
slot
,
DL_req
->
SFN
,
DL_req
->
Slot
);
LOG_
D
(
PHY
,
"frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d
\n
"
,
frame
,
slot
,
DL_req
->
SFN
,
DL_req
->
Slot
);
handle_nfapi_nr_csirs_pdu
(
gNB
,
frame
,
slot
,
&
dl_tti_pdu
->
csi_rs_pdu
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
48b847cb
...
...
@@ -375,7 +375,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
if
(
csi_MeasConfig
->
csi_SSB_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
csi_SSB_ResourceSetId
==
*
(
csi_resourceconfig
->
csi_RS_ResourceSetList
.
choice
.
nzp_CSI_RS_SSB
->
csi_SSB_ResourceSetList
->
list
.
array
[
0
])){
//We can configure only one SSB resource set from spec 38.331 IE CSI-ResourceConfig
nb_resources
=
csi_MeasConfig
->
csi_SSB_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
csi_SSB_ResourceList
.
list
.
count
;
nb_resources
=
csi_MeasConfig
->
csi_SSB_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
csi_SSB_ResourceList
.
list
.
count
;
csi_report
->
SSB_Index_list
=
csi_MeasConfig
->
csi_SSB_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
csi_SSB_ResourceList
.
list
.
array
;
csi_report
->
CSI_Index_list
=
NULL
;
break
;
...
...
@@ -388,7 +388,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
if
(
csi_MeasConfig
->
nzp_CSI_RS_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
nzp_CSI_ResourceSetId
==
*
(
csi_resourceconfig
->
csi_RS_ResourceSetList
.
choice
.
nzp_CSI_RS_SSB
->
nzp_CSI_RS_ResourceSetList
->
list
.
array
[
0
]))
{
//For periodic and semi-persistent CSI Resource Settings, the number of CSI-RS Resource Sets configured is limited to S=1 for spec 38.212
nb_resources
=
csi_MeasConfig
->
nzp_CSI_RS_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
nzp_CSI_RS_Resources
.
list
.
count
;
nb_resources
=
csi_MeasConfig
->
nzp_CSI_RS_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
nzp_CSI_RS_Resources
.
list
.
count
;
csi_report
->
CSI_Index_list
=
csi_MeasConfig
->
nzp_CSI_RS_ResourceSetToAddModList
->
list
.
array
[
csi_idx
]
->
nzp_CSI_RS_Resources
.
list
.
array
;
csi_report
->
SSB_Index_list
=
NULL
;
break
;
...
...
@@ -850,34 +850,14 @@ void reverse_n_bits(uint8_t *value, uint16_t bitlen) {
}
}
void
extract_pucch_csi_report
(
NR_CSI_MeasConfig_t
*
csi_MeasConfig
,
const
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
uci_pdu
,
frame_t
frame
,
slot_t
slot
,
int
UE_id
,
module_id_t
Mod_idP
)
{
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
uint8_t
idx
=
0
;
uint8_t
payload_size
=
ceil
(((
double
)
uci_pdu
->
csi_part1
.
csi_part1_bit_len
)
/
8
);
uint8_t
*
payload
=
uci_pdu
->
csi_part1
.
csi_part1_payload
;
NR_CSI_ReportConfig__reportQuantity_PR
reportQuantity_type
=
NR_CSI_ReportConfig__reportQuantity_PR_NOTHING
;
NR_UE_info_t
*
UE_info
=
&
(
RC
.
nrmac
[
Mod_idP
]
->
UE_info
);
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
uint8_t
csi_report_id
=
0
;
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
nb_of_csi_ssb_report
=
0
;
for
(
csi_report_id
=
0
;
csi_report_id
<
csi_MeasConfig
->
csi_ReportConfigToAddModList
->
list
.
count
;
csi_report_id
++
)
{
//Has to implement according to reportSlotConfig type
/*reportQuantity must be considered according to the current scheduled
CSI-ReportConfig if multiple CSI-ReportConfigs present*/
reportQuantity_type
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
reportQuantity_type
;
LOG_D
(
PHY
,
"SFN/SF:%d/%d reportQuantity type = %d
\n
"
,
frame
,
slot
,
reportQuantity_type
);
void
evaluate_rsrp_report
(
NR_UE_info_t
*
UE_info
,
NR_UE_sched_ctrl_t
*
sched_ctrl
,
int
UE_id
,
uint8_t
csi_report_id
,
uint8_t
*
payload
,
NR_CSI_ReportConfig__reportQuantity_PR
reportQuantity_type
){
if
(
NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP
==
reportQuantity_type
||
NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP
==
reportQuantity_type
)
{
uint8_t
csi_ssb_idx
=
0
;
uint8_t
diff_rsrp_idx
=
0
;
uint8_t
cri_ssbri_bitlen
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_report_bitlen
.
cri_ssbri_bitlen
;
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
...
...
@@ -898,10 +878,10 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
multiple simultaneous spatial domain receive filter
*/
idx
=
0
;
//Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config
int
idx
=
0
;
//Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
nr_ssbri_cri
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_report_bitlen
.
nb_ssbri_cri
;
for
(
csi_ssb_idx
=
0
;
csi_ssb_idx
<
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
nr_ssbri_cri
;
csi_ssb_idx
++
)
{
for
(
int
csi_ssb_idx
=
0
;
csi_ssb_idx
<
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
nr_ssbri_cri
;
csi_ssb_idx
++
)
{
if
(
cri_ssbri_bitlen
>
1
)
reverse_n_bits
(
payload
,
cri_ssbri_bitlen
);
...
...
@@ -913,29 +893,120 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
*
(
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_Index_list
[
cri_ssbri_bitlen
>
0
?
((
*
payload
)
&~
(
~
1
<<
(
cri_ssbri_bitlen
-
1
)))
:
cri_ssbri_bitlen
]);
*
payload
>>=
cri_ssbri_bitlen
;
LOG_D
(
PHY
,
"SSB_index = %d
\n
"
,
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
CRI_SSBRI
[
csi_ssb_idx
]);
LOG_D
(
MAC
,
"SSB_index = %d
\n
"
,
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
CRI_SSBRI
[
csi_ssb_idx
]);
}
reverse_n_bits
(
payload
,
7
);
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
RSRP
=
(
*
payload
)
&
0x7f
;
*
payload
>>=
7
;
for
(
diff_rsrp_idx
=
0
;
diff_rsrp_idx
<
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
nr_ssbri_cri
-
1
;
diff_rsrp_idx
++
)
{
for
(
int
diff_rsrp_idx
=
0
;
diff_rsrp_idx
<
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
nr_ssbri_cri
-
1
;
diff_rsrp_idx
++
)
{
reverse_n_bits
(
payload
,
4
);
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
diff_RSRP
[
diff_rsrp_idx
]
=
(
*
payload
)
&
0x0f
;
*
payload
>>=
4
;
}
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
nb_of_csi_ssb_report
++
;
LOG_I
(
MAC
,
"csi_payload size = %d, rsrp_id = %d rsrp = %d
\n
"
,
payload_size
,
LOG_D
(
MAC
,
"rsrp_id = %d rsrp = %d
\n
"
,
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
RSRP
,
get_measured_rsrp
(
sched_ctrl
->
CSI_report
[
idx
].
choice
.
ssb_cri_report
.
RSRP
));
}
void
evaluate_cri_report
(
uint8_t
*
payload
,
uint8_t
cri_bitlen
,
NR_UE_sched_ctrl_t
*
sched_ctrl
){
int
idx
=
0
;
// FIXME not sure about this index. Should it be the same as csi_report_id?
uint8_t
temp_cri
=
*
payload
&
((
1
<<
cri_bitlen
)
-
1
);
reverse_n_bits
(
&
temp_cri
,
cri_bitlen
);
sched_ctrl
->
CSI_report
[
idx
].
choice
.
cri_ri_li_pmi_cqi_report
.
cri
=
temp_cri
;
*
payload
>>=
cri_bitlen
;
}
void
evaluate_ri_report
(
uint8_t
*
payload
,
uint8_t
ri_bitlen
,
NR_UE_sched_ctrl_t
*
sched_ctrl
){
AssertFatal
(
1
==
0
,
"Evaluation of RI report not yet implemented
\n
"
);
}
void
evaluate_cqi_report
(
uint8_t
*
payload
,
uint8_t
cqi_bitlen
,
NR_UE_sched_ctrl_t
*
sched_ctrl
){
//TODO sub-band CQI report not yet implemented
int
idx
=
0
;
// FIXME not sure about this index. Should it be the same as csi_report_id?
uint8_t
temp_cqi
=
*
payload
&
((
1
<<
4
)
-
1
);
reverse_n_bits
(
&
temp_cqi
,
4
);
sched_ctrl
->
CSI_report
[
idx
].
choice
.
cri_ri_li_pmi_cqi_report
.
wb_cqi_1tb
=
temp_cqi
;
*
payload
>>=
4
;
LOG_I
(
MAC
,
"Wide-band CQI for the first TB %d
\n
"
,
temp_cqi
);
if
(
cqi_bitlen
>
4
)
{
temp_cqi
=
*
payload
&
((
1
<<
4
)
-
1
);
reverse_n_bits
(
&
temp_cqi
,
4
);
sched_ctrl
->
CSI_report
[
idx
].
choice
.
cri_ri_li_pmi_cqi_report
.
wb_cqi_2tb
=
temp_cqi
;
*
payload
>>=
4
;
LOG_D
(
MAC
,
"Wide-band CQI for the second TB %d
\n
"
,
temp_cqi
);
}
}
}
if
(
!
(
reportQuantity_type
))
AssertFatal
(
reportQuantity_type
,
"reportQuantity is not configured"
);
void
extract_pucch_csi_report
(
NR_CSI_MeasConfig_t
*
csi_MeasConfig
,
const
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
uci_pdu
,
frame_t
frame
,
slot_t
slot
,
int
UE_id
,
module_id_t
Mod_idP
)
{
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
NR_ServingCellConfigCommon_t
*
scc
=
RC
.
nrmac
[
Mod_idP
]
->
common_channels
->
ServingCellConfigCommon
;
const
int
n_slots_frame
=
nr_slots_per_frame
[
*
scc
->
ssbSubcarrierSpacing
];
uint8_t
*
payload
=
uci_pdu
->
csi_part1
.
csi_part1_payload
;
NR_CSI_ReportConfig__reportQuantity_PR
reportQuantity_type
=
NR_CSI_ReportConfig__reportQuantity_PR_NOTHING
;
NR_UE_info_t
*
UE_info
=
&
(
RC
.
nrmac
[
Mod_idP
]
->
UE_info
);
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
uint8_t
csi_report_id
=
0
;
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
nb_of_csi_ssb_report
=
0
;
for
(
csi_report_id
=
0
;
csi_report_id
<
csi_MeasConfig
->
csi_ReportConfigToAddModList
->
list
.
count
;
csi_report_id
++
)
{
uint8_t
cri_bitlen
=
0
;
uint8_t
ri_bitlen
=
0
;
uint8_t
cqi_bitlen
=
0
;
NR_CSI_ReportConfig_t
*
csirep
=
csi_MeasConfig
->
csi_ReportConfigToAddModList
->
list
.
array
[
csi_report_id
];
int
period
,
offset
;
csi_period_offset
(
csirep
,
NULL
,
&
period
,
&
offset
);
// verify if report with current id has been scheduled for this frame and slot
// -1 because this is processed 1 slot after the reception
if
((
n_slots_frame
*
frame
+
slot
-
offset
-
1
)
%
period
==
0
)
{
reportQuantity_type
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
reportQuantity_type
;
LOG_I
(
MAC
,
"SFN/SF:%d/%d reportQuantity type = %d
\n
"
,
frame
,
slot
,
reportQuantity_type
);
switch
(
reportQuantity_type
){
case
NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP
:
evaluate_rsrp_report
(
UE_info
,
sched_ctrl
,
UE_id
,
csi_report_id
,
payload
,
reportQuantity_type
);
break
;
case
NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP
:
evaluate_rsrp_report
(
UE_info
,
sched_ctrl
,
UE_id
,
csi_report_id
,
payload
,
reportQuantity_type
);
break
;
case
NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI
:
cri_bitlen
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
csi_meas_bitlen
.
cri_bitlen
;
if
(
cri_bitlen
)
evaluate_cri_report
(
payload
,
cri_bitlen
,
sched_ctrl
);
ri_bitlen
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
csi_meas_bitlen
.
ri_bitlen
;
if
(
ri_bitlen
)
evaluate_ri_report
(
payload
,
ri_bitlen
,
sched_ctrl
);
//TODO add zero padding bits when needed
cqi_bitlen
=
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
csi_meas_bitlen
.
cqi_bitlen
;
if
(
cqi_bitlen
)
evaluate_cqi_report
(
payload
,
ri_bitlen
,
sched_ctrl
);
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid or not supported CSI measurement report
\n
"
);
}
}
}
}
void
handle_nr_uci_pucch_0_1
(
module_id_t
mod_id
,
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
48b847cb
...
...
@@ -387,7 +387,8 @@ struct CRI_RI_LI_PMI_CQI {
uint8_t
li
;
uint8_t
pmi_x1
;
uint8_t
pmi_x2
;
uint8_t
cqi
;
uint8_t
wb_cqi_1tb
;
uint8_t
wb_cqi_2tb
;
};
typedef
struct
CRI_SSB_RSRP
{
...
...
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