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
50d4d3e8
Commit
50d4d3e8
authored
Feb 24, 2022
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressing review comments
parent
ddfb131f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
203 additions
and
205 deletions
+203
-205
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+36
-36
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+167
-169
No files found.
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
View file @
50d4d3e8
...
...
@@ -224,43 +224,43 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
LOG_D
(
PHY
,
"current_harq_pid = %d
\n
"
,
current_harq_pid
);
NR_DL_UE_HARQ_t
*
dlsch0_harq
=
dlsch0
->
harq_processes
[
current_harq_pid
];
if
(
dlsch0_harq
){
dlsch0_harq
->
BWPStart
=
dlsch_config_pdu
->
BWPStart
;
dlsch0_harq
->
BWPSize
=
dlsch_config_pdu
->
BWPSize
;
dlsch0_harq
->
nb_rb
=
dlsch_config_pdu
->
number_rbs
;
dlsch0_harq
->
start_rb
=
dlsch_config_pdu
->
start_rb
;
dlsch0_harq
->
nb_symbols
=
dlsch_config_pdu
->
number_symbols
;
dlsch0_harq
->
start_symbol
=
dlsch_config_pdu
->
start_symbol
;
dlsch0_harq
->
dlDmrsSymbPos
=
dlsch_config_pdu
->
dlDmrsSymbPos
;
dlsch0_harq
->
dmrsConfigType
=
dlsch_config_pdu
->
dmrsConfigType
;
dlsch0_harq
->
n_dmrs_cdm_groups
=
dlsch_config_pdu
->
n_dmrs_cdm_groups
;
dlsch0_harq
->
dmrs_ports
=
dlsch_config_pdu
->
dmrs_ports
;
dlsch0_harq
->
mcs
=
dlsch_config_pdu
->
mcs
;
dlsch0_harq
->
rvidx
=
dlsch_config_pdu
->
rv
;
dlsch0
->
g_pucch
=
dlsch_config_pdu
->
accumulated_delta_PUCCH
;
//get nrOfLayers from DCI info
uint8_t
Nl
=
0
;
for
(
int
i
=
0
;
i
<
12
;
i
++
)
{
// max 12 ports
if
((
dlsch_config_pdu
->
dmrs_ports
>>
i
)
&
0x01
)
Nl
+=
1
;
}
dlsch0_harq
->
Nl
=
Nl
;
dlsch0_harq
->
mcs_table
=
dlsch_config_pdu
->
mcs_table
;
downlink_harq_process
(
dlsch0_harq
,
dlsch0
->
current_harq_pid
,
dlsch_config_pdu
->
ndi
,
dlsch_config_pdu
->
rv
,
dlsch0
->
rnti_type
);
if
(
dlsch0_harq
->
status
!=
ACTIVE
)
{
// dlsch0_harq->status not ACTIVE due to false retransmission
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
dlsch0
->
active
=
0
;
update_harq_status
(
module_id
,
dlsch0
->
current_harq_pid
,
dlsch0_harq
->
ack
);
}
/* PTRS */
dlsch0_harq
->
PTRSFreqDensity
=
dlsch_config_pdu
->
PTRSFreqDensity
;
dlsch0_harq
->
PTRSTimeDensity
=
dlsch_config_pdu
->
PTRSTimeDensity
;
dlsch0_harq
->
PTRSPortIndex
=
dlsch_config_pdu
->
PTRSPortIndex
;
dlsch0_harq
->
nEpreRatioOfPDSCHToPTRS
=
dlsch_config_pdu
->
nEpreRatioOfPDSCHToPTRS
;
dlsch0_harq
->
PTRSReOffset
=
dlsch_config_pdu
->
PTRSReOffset
;
dlsch0_harq
->
pduBitmap
=
dlsch_config_pdu
->
pduBitmap
;
LOG_D
(
MAC
,
">>>>
\t
dlsch0->g_pucch = %d
\t
dlsch0_harq.mcs = %d
\n
"
,
dlsch0
->
g_pucch
,
dlsch0_harq
->
mcs
);
AssertFatal
(
dlsch0_harq
,
"no harq_process for HARQ PID %d
\n
"
,
current_harq_pid
);
dlsch0_harq
->
BWPStart
=
dlsch_config_pdu
->
BWPStart
;
dlsch0_harq
->
BWPSize
=
dlsch_config_pdu
->
BWPSize
;
dlsch0_harq
->
nb_rb
=
dlsch_config_pdu
->
number_rbs
;
dlsch0_harq
->
start_rb
=
dlsch_config_pdu
->
start_rb
;
dlsch0_harq
->
nb_symbols
=
dlsch_config_pdu
->
number_symbols
;
dlsch0_harq
->
start_symbol
=
dlsch_config_pdu
->
start_symbol
;
dlsch0_harq
->
dlDmrsSymbPos
=
dlsch_config_pdu
->
dlDmrsSymbPos
;
dlsch0_harq
->
dmrsConfigType
=
dlsch_config_pdu
->
dmrsConfigType
;
dlsch0_harq
->
n_dmrs_cdm_groups
=
dlsch_config_pdu
->
n_dmrs_cdm_groups
;
dlsch0_harq
->
dmrs_ports
=
dlsch_config_pdu
->
dmrs_ports
;
dlsch0_harq
->
mcs
=
dlsch_config_pdu
->
mcs
;
dlsch0_harq
->
rvidx
=
dlsch_config_pdu
->
rv
;
dlsch0
->
g_pucch
=
dlsch_config_pdu
->
accumulated_delta_PUCCH
;
//get nrOfLayers from DCI info
uint8_t
Nl
=
0
;
for
(
int
i
=
0
;
i
<
12
;
i
++
)
{
// max 12 ports
if
((
dlsch_config_pdu
->
dmrs_ports
>>
i
)
&
0x01
)
Nl
+=
1
;
}
dlsch0_harq
->
Nl
=
Nl
;
dlsch0_harq
->
mcs_table
=
dlsch_config_pdu
->
mcs_table
;
downlink_harq_process
(
dlsch0_harq
,
dlsch0
->
current_harq_pid
,
dlsch_config_pdu
->
ndi
,
dlsch_config_pdu
->
rv
,
dlsch0
->
rnti_type
);
if
(
dlsch0_harq
->
status
!=
ACTIVE
)
{
// dlsch0_harq->status not ACTIVE due to false retransmission
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
dlsch0
->
active
=
0
;
update_harq_status
(
module_id
,
dlsch0
->
current_harq_pid
,
dlsch0_harq
->
ack
);
}
/* PTRS */
dlsch0_harq
->
PTRSFreqDensity
=
dlsch_config_pdu
->
PTRSFreqDensity
;
dlsch0_harq
->
PTRSTimeDensity
=
dlsch_config_pdu
->
PTRSTimeDensity
;
dlsch0_harq
->
PTRSPortIndex
=
dlsch_config_pdu
->
PTRSPortIndex
;
dlsch0_harq
->
nEpreRatioOfPDSCHToPTRS
=
dlsch_config_pdu
->
nEpreRatioOfPDSCHToPTRS
;
dlsch0_harq
->
PTRSReOffset
=
dlsch_config_pdu
->
PTRSReOffset
;
dlsch0_harq
->
pduBitmap
=
dlsch_config_pdu
->
pduBitmap
;
LOG_D
(
MAC
,
">>>>
\t
dlsch0->g_pucch = %d
\t
dlsch0_harq.mcs = %d
\n
"
,
dlsch0
->
g_pucch
,
dlsch0_harq
->
mcs
);
}
int8_t
nr_ue_scheduled_response
(
nr_scheduled_response_t
*
scheduled_response
){
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
50d4d3e8
...
...
@@ -2339,199 +2339,197 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
void
nr_schedule_csi_for_im
(
NR_UE_MAC_INST_t
*
mac
,
int
frame
,
int
slot
)
{
if
(
mac
->
ra
.
ra_state
==
RA_SUCCEEDED
||
get_softmodem_params
()
->
phy_test
==
1
)
{
if
(
mac
->
ra
.
ra_state
!=
RA_SUCCEEDED
&&
get_softmodem_params
()
->
phy_test
==
0
)
return
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
return
;
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
return
;
NR_CSI_MeasConfig_t
*
csi_measconfig
=
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
->
choice
.
setup
;
NR_CSI_MeasConfig_t
*
csi_measconfig
=
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
->
choice
.
setup
;
if
(
csi_measconfig
->
csi_IM_ResourceToAddModList
==
NULL
)
return
;
if
(
csi_measconfig
->
csi_IM_ResourceToAddModList
==
NULL
)
return
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
NR_CSI_IM_Resource_t
*
imcsi
;
int
period
,
offset
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
for
(
int
id
=
0
;
id
<
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
count
;
id
++
){
imcsi
=
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
array
[
id
];
csi_period_offset
(
NULL
,
imcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
if
((
frame
*
nr_slots_per_frame
[
mu
]
+
slot
-
offset
)
%
period
==
0
)
{
fapi_nr_dl_config_csiim_pdu_rel15_t
*
csiim_config_pdu
=
&
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
csiim_config_pdu
.
csiim_config_rel15
;
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
const
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
csiim_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
subcarrier_spacing
=
mu
;
csiim_config_pdu
->
start_rb
=
imcsi
->
freqBand
->
startingRB
;
csiim_config_pdu
->
nr_of_rbs
=
imcsi
->
freqBand
->
nrofRBs
;
// As specified in 5.2.2.4 of 38.214
switch
(
imcsi
->
csi_IM_ResourceElementPattern
->
present
)
{
case
NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0
:
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
csiim_config_pdu
->
k_csiim
[
i
]
=
(
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern0
->
subcarrierLocation_p0
<<
1
)
+
(
i
>>
1
);
csiim_config_pdu
->
l_csiim
[
i
]
=
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern0
->
symbolLocation_p0
+
(
i
%
2
);
}
break
;
case
NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1
:
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
csiim_config_pdu
->
k_csiim
[
i
]
=
(
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern1
->
subcarrierLocation_p1
<<
2
)
+
i
;
csiim_config_pdu
->
l_csiim
[
i
]
=
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern1
->
symbolLocation_p1
;
}
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid CSI-IM pattern
\n
"
);
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
NR_CSI_IM_Resource_t
*
imcsi
;
int
period
,
offset
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
for
(
int
id
=
0
;
id
<
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
count
;
id
++
){
imcsi
=
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
array
[
id
];
csi_period_offset
(
NULL
,
imcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
if
((
frame
*
nr_slots_per_frame
[
mu
]
+
slot
-
offset
)
%
period
!=
0
)
continue
;
fapi_nr_dl_config_csiim_pdu_rel15_t
*
csiim_config_pdu
=
&
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
csiim_config_pdu
.
csiim_config_rel15
;
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
const
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
csiim_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
subcarrier_spacing
=
mu
;
csiim_config_pdu
->
start_rb
=
imcsi
->
freqBand
->
startingRB
;
csiim_config_pdu
->
nr_of_rbs
=
imcsi
->
freqBand
->
nrofRBs
;
// As specified in 5.2.2.4 of 38.214
switch
(
imcsi
->
csi_IM_ResourceElementPattern
->
present
)
{
case
NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0
:
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
csiim_config_pdu
->
k_csiim
[
i
]
=
(
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern0
->
subcarrierLocation_p0
<<
1
)
+
(
i
>>
1
);
csiim_config_pdu
->
l_csiim
[
i
]
=
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern0
->
symbolLocation_p0
+
(
i
%
2
);
}
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
=
FAPI_NR_DL_CONFIG_TYPE_CSI_IM
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
}
break
;
case
NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1
:
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
csiim_config_pdu
->
k_csiim
[
i
]
=
(
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern1
->
subcarrierLocation_p1
<<
2
)
+
i
;
csiim_config_pdu
->
l_csiim
[
i
]
=
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern1
->
symbolLocation_p1
;
}
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid CSI-IM pattern
\n
"
);
}
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
=
FAPI_NR_DL_CONFIG_TYPE_CSI_IM
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
}
}
void
nr_schedule_csirs_reception
(
NR_UE_MAC_INST_t
*
mac
,
int
frame
,
int
slot
)
{
if
(
mac
->
ra
.
ra_state
==
RA_SUCCEEDED
||
get_softmodem_params
()
->
phy_test
==
1
)
{
if
(
mac
->
ra
.
ra_state
!=
RA_SUCCEEDED
&&
get_softmodem_params
()
->
phy_test
==
0
)
return
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
return
;
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
return
;
NR_CSI_MeasConfig_t
*
csi_measconfig
=
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
->
choice
.
setup
;
NR_CSI_MeasConfig_t
*
csi_measconfig
=
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
->
choice
.
setup
;
if
(
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
==
NULL
)
return
;
if
(
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
==
NULL
)
return
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
NR_NZP_CSI_RS_Resource_t
*
nzpcsi
;
int
period
,
offset
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
for
(
int
id
=
0
;
id
<
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
count
;
id
++
){
nzpcsi
=
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
array
[
id
];
csi_period_offset
(
NULL
,
nzpcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
if
((
frame
*
nr_slots_per_frame
[
mu
]
+
slot
-
offset
)
%
period
==
0
)
{
LOG_D
(
MAC
,
"Scheduling reception of CSI-RS in frame %d slot %d
\n
"
,
frame
,
slot
);
fapi_nr_dl_config_csirs_pdu_rel15_t
*
csirs_config_pdu
=
&
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
csirs_config_pdu
.
csirs_config_rel15
;
NR_CSI_RS_ResourceMapping_t
resourceMapping
=
nzpcsi
->
resourceMapping
;
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
const
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
csirs_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
subcarrier_spacing
=
mu
;
csirs_config_pdu
->
start_rb
=
resourceMapping
.
freqBand
.
startingRB
;
csirs_config_pdu
->
nr_of_rbs
=
resourceMapping
.
freqBand
.
nrofRBs
;
csirs_config_pdu
->
csi_type
=
1
;
// NZP-CSI-RS
csirs_config_pdu
->
symb_l0
=
resourceMapping
.
firstOFDMSymbolInTimeDomain
;
if
(
resourceMapping
.
firstOFDMSymbolInTimeDomain2
)
csirs_config_pdu
->
symb_l1
=
*
resourceMapping
.
firstOFDMSymbolInTimeDomain2
;
csirs_config_pdu
->
cdm_type
=
resourceMapping
.
cdm_Type
;
csirs_config_pdu
->
freq_density
=
resourceMapping
.
density
.
present
;
if
((
resourceMapping
.
density
.
present
==
NR_CSI_RS_ResourceMapping__density_PR_dot5
)
&&
(
resourceMapping
.
density
.
choice
.
dot5
==
NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs
))
csirs_config_pdu
->
freq_density
--
;
csirs_config_pdu
->
scramb_id
=
nzpcsi
->
scramblingID
;
switch
(
resourceMapping
.
frequencyDomainAllocation
.
present
){
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1
:
csirs_config_pdu
->
row
=
1
;
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row1
.
buf
[
0
])
>>
4
)
&
0x0f
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
NR_NZP_CSI_RS_Resource_t
*
nzpcsi
;
int
period
,
offset
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
for
(
int
id
=
0
;
id
<
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
count
;
id
++
){
nzpcsi
=
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
array
[
id
];
csi_period_offset
(
NULL
,
nzpcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
if
((
frame
*
nr_slots_per_frame
[
mu
]
+
slot
-
offset
)
%
period
!=
0
)
continue
;
LOG_D
(
MAC
,
"Scheduling reception of CSI-RS in frame %d slot %d
\n
"
,
frame
,
slot
);
fapi_nr_dl_config_csirs_pdu_rel15_t
*
csirs_config_pdu
=
&
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
csirs_config_pdu
.
csirs_config_rel15
;
NR_CSI_RS_ResourceMapping_t
resourceMapping
=
nzpcsi
->
resourceMapping
;
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
const
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
csirs_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
subcarrier_spacing
=
mu
;
csirs_config_pdu
->
start_rb
=
resourceMapping
.
freqBand
.
startingRB
;
csirs_config_pdu
->
nr_of_rbs
=
resourceMapping
.
freqBand
.
nrofRBs
;
csirs_config_pdu
->
csi_type
=
1
;
// NZP-CSI-RS
csirs_config_pdu
->
symb_l0
=
resourceMapping
.
firstOFDMSymbolInTimeDomain
;
if
(
resourceMapping
.
firstOFDMSymbolInTimeDomain2
)
csirs_config_pdu
->
symb_l1
=
*
resourceMapping
.
firstOFDMSymbolInTimeDomain2
;
csirs_config_pdu
->
cdm_type
=
resourceMapping
.
cdm_Type
;
csirs_config_pdu
->
freq_density
=
resourceMapping
.
density
.
present
;
if
((
resourceMapping
.
density
.
present
==
NR_CSI_RS_ResourceMapping__density_PR_dot5
)
&&
(
resourceMapping
.
density
.
choice
.
dot5
==
NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs
))
csirs_config_pdu
->
freq_density
--
;
csirs_config_pdu
->
scramb_id
=
nzpcsi
->
scramblingID
;
switch
(
resourceMapping
.
frequencyDomainAllocation
.
present
){
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1
:
csirs_config_pdu
->
row
=
1
;
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row1
.
buf
[
0
])
>>
4
)
&
0x0f
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2
:
csirs_config_pdu
->
row
=
2
;
csirs_config_pdu
->
freq_domain
=
(((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row2
.
buf
[
1
]
>>
4
)
&
0x0f
)
|
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row2
.
buf
[
0
]
<<
4
)
&
0xff0
));
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4
:
csirs_config_pdu
->
row
=
4
;
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row4
.
buf
[
0
])
>>
5
)
&
0x07
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other
:
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
other
.
buf
[
0
])
>>
2
)
&
0x3f
;
// determining the row of table 7.4.1.5.3-1 in 38.211
switch
(
resourceMapping
.
nrofPorts
){
case
NR_CSI_RS_ResourceMapping__nrofPorts_p1
:
AssertFatal
(
1
==
0
,
"Resource with 1 CSI port shouldn't be within other rows
\n
"
);
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2
:
csirs_config_pdu
->
row
=
2
;
csirs_config_pdu
->
freq_domain
=
(((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row2
.
buf
[
1
]
>>
4
)
&
0x0f
)
|
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row2
.
buf
[
0
]
<<
4
)
&
0xff0
));
case
NR_CSI_RS_ResourceMapping__nrofPorts_p2
:
csirs_config_pdu
->
row
=
3
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4
:
csirs_config_pdu
->
row
=
4
;
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row4
.
buf
[
0
])
>>
5
)
&
0x07
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p4
:
csirs_config_pdu
->
row
=
5
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other
:
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
other
.
buf
[
0
])
>>
2
)
&
0x3f
;
// determining the row of table 7.4.1.5.3-1 in 38.211
switch
(
resourceMapping
.
nrofPorts
){
case
NR_CSI_RS_ResourceMapping__nrofPorts_p1
:
AssertFatal
(
1
==
0
,
"Resource with 1 CSI port shouldn't be within other rows
\n
"
);
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p2
:
csirs_config_pdu
->
row
=
3
;
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p4
:
csirs_config_pdu
->
row
=
5
;
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p8
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
8
;
else
{
int
num_k
=
0
;
for
(
int
k
=
0
;
k
<
6
;
k
++
)
num_k
+=
(((
csirs_config_pdu
->
freq_domain
)
>>
k
)
&
0x01
);
if
(
num_k
==
4
)
csirs_config_pdu
->
row
=
6
;
else
csirs_config_pdu
->
row
=
7
;
}
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p12
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
10
;
else
csirs_config_pdu
->
row
=
9
;
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p16
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
12
;
else
csirs_config_pdu
->
row
=
11
;
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p24
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
14
;
else
{
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4
)
csirs_config_pdu
->
row
=
15
;
else
csirs_config_pdu
->
row
=
13
;
}
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p32
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
17
;
else
{
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4
)
csirs_config_pdu
->
row
=
18
;
else
csirs_config_pdu
->
row
=
16
;
}
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid number of ports in CSI-RS resource
\n
"
);
case
NR_CSI_RS_ResourceMapping__nrofPorts_p8
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
8
;
else
{
int
num_k
=
0
;
for
(
int
k
=
0
;
k
<
6
;
k
++
)
num_k
+=
(((
csirs_config_pdu
->
freq_domain
)
>>
k
)
&
0x01
);
if
(
num_k
==
4
)
csirs_config_pdu
->
row
=
6
;
else
csirs_config_pdu
->
row
=
7
;
}
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid freqency domain allocation in CSI-RS resource
\n
"
);
case
NR_CSI_RS_ResourceMapping__nrofPorts_p12
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
10
;
else
csirs_config_pdu
->
row
=
9
;
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p16
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
12
;
else
csirs_config_pdu
->
row
=
11
;
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p24
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
14
;
else
{
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4
)
csirs_config_pdu
->
row
=
15
;
else
csirs_config_pdu
->
row
=
13
;
}
break
;
case
NR_CSI_RS_ResourceMapping__nrofPorts_p32
:
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
csirs_config_pdu
->
row
=
17
;
else
{
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4
)
csirs_config_pdu
->
row
=
18
;
else
csirs_config_pdu
->
row
=
16
;
}
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid number of ports in CSI-RS resource
\n
"
);
}
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
=
FAPI_NR_DL_CONFIG_TYPE_CSI_RS
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
}
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid freqency domain allocation in CSI-RS resource
\n
"
);
}
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
=
FAPI_NR_DL_CONFIG_TYPE_CSI_RS
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
}
}
...
...
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