Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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 UE
Commits
08498b0a
Commit
08498b0a
authored
Feb 24, 2022
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressing review comments
parent
9a6e2542
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 @
08498b0a
...
@@ -224,43 +224,43 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
...
@@ -224,43 +224,43 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
LOG_D
(
PHY
,
"current_harq_pid = %d
\n
"
,
current_harq_pid
);
LOG_D
(
PHY
,
"current_harq_pid = %d
\n
"
,
current_harq_pid
);
NR_DL_UE_HARQ_t
*
dlsch0_harq
=
dlsch0
->
harq_processes
[
current_harq_pid
];
NR_DL_UE_HARQ_t
*
dlsch0_harq
=
dlsch0
->
harq_processes
[
current_harq_pid
];
if
(
dlsch0_harq
){
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
->
BWPStart
=
dlsch_config_pdu
->
BWPStart
;
dlsch0_harq
->
nb_rb
=
dlsch_config_pdu
->
number_rbs
;
dlsch0_harq
->
BWPSize
=
dlsch_config_pdu
->
BWPSize
;
dlsch0_harq
->
start_rb
=
dlsch_config_pdu
->
start_rb
;
dlsch0_harq
->
nb_rb
=
dlsch_config_pdu
->
number_rbs
;
dlsch0_harq
->
nb_symbols
=
dlsch_config_pdu
->
number_symbols
;
dlsch0_harq
->
start_rb
=
dlsch_config_pdu
->
start_rb
;
dlsch0_harq
->
start_symbol
=
dlsch_config_pdu
->
start_symbol
;
dlsch0_harq
->
nb_symbols
=
dlsch_config_pdu
->
number_symbols
;
dlsch0_harq
->
dlDmrsSymbPos
=
dlsch_config_pdu
->
dlDmrsSymbPos
;
dlsch0_harq
->
start_symbol
=
dlsch_config_pdu
->
start_symbol
;
dlsch0_harq
->
dmrsConfigType
=
dlsch_config_pdu
->
dmrsConfigType
;
dlsch0_harq
->
dlDmrsSymbPos
=
dlsch_config_pdu
->
dlDmrsSymbPos
;
dlsch0_harq
->
n_dmrs_cdm_groups
=
dlsch_config_pdu
->
n_dmrs_cdm_groups
;
dlsch0_harq
->
dmrsConfigType
=
dlsch_config_pdu
->
dmrsConfigType
;
dlsch0_harq
->
dmrs_ports
=
dlsch_config_pdu
->
dmrs_ports
;
dlsch0_harq
->
n_dmrs_cdm_groups
=
dlsch_config_pdu
->
n_dmrs_cdm_groups
;
dlsch0_harq
->
mcs
=
dlsch_config_pdu
->
mcs
;
dlsch0_harq
->
dmrs_ports
=
dlsch_config_pdu
->
dmrs_ports
;
dlsch0_harq
->
rvidx
=
dlsch_config_pdu
->
rv
;
dlsch0_harq
->
mcs
=
dlsch_config_pdu
->
mcs
;
dlsch0
->
g_pucch
=
dlsch_config_pdu
->
accumulated_delta_PUCCH
;
dlsch0_harq
->
rvidx
=
dlsch_config_pdu
->
rv
;
//get nrOfLayers from DCI info
dlsch0
->
g_pucch
=
dlsch_config_pdu
->
accumulated_delta_PUCCH
;
uint8_t
Nl
=
0
;
//get nrOfLayers from DCI info
for
(
int
i
=
0
;
i
<
12
;
i
++
)
{
// max 12 ports
uint8_t
Nl
=
0
;
if
((
dlsch_config_pdu
->
dmrs_ports
>>
i
)
&
0x01
)
Nl
+=
1
;
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
;
dlsch0_harq
->
Nl
=
Nl
;
downlink_harq_process
(
dlsch0_harq
,
dlsch0
->
current_harq_pid
,
dlsch_config_pdu
->
ndi
,
dlsch_config_pdu
->
rv
,
dlsch0
->
rnti_type
);
dlsch0_harq
->
mcs_table
=
dlsch_config_pdu
->
mcs_table
;
if
(
dlsch0_harq
->
status
!=
ACTIVE
)
{
downlink_harq_process
(
dlsch0_harq
,
dlsch0
->
current_harq_pid
,
dlsch_config_pdu
->
ndi
,
dlsch_config_pdu
->
rv
,
dlsch0
->
rnti_type
);
// dlsch0_harq->status not ACTIVE due to false retransmission
if
(
dlsch0_harq
->
status
!=
ACTIVE
)
{
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
// dlsch0_harq->status not ACTIVE due to false retransmission
dlsch0
->
active
=
0
;
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
update_harq_status
(
module_id
,
dlsch0
->
current_harq_pid
,
dlsch0_harq
->
ack
);
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
);
}
}
/* 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
){
int8_t
nr_ue_scheduled_response
(
nr_scheduled_response_t
*
scheduled_response
){
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
08498b0a
...
@@ -2339,199 +2339,197 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
...
@@ -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
)
{
void
nr_schedule_csi_for_im
(
NR_UE_MAC_INST_t
*
mac
,
int
frame
,
int
slot
)
{
if
(
mac
->
ra
.
ra_state
==
RA_SUCCEEDED
||
if
(
mac
->
ra
.
ra_state
!=
RA_SUCCEEDED
&&
get_softmodem_params
()
->
phy_test
==
0
)
get_softmodem_params
()
->
phy_test
==
1
)
{
return
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
return
;
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
)
if
(
csi_measconfig
->
csi_IM_ResourceToAddModList
==
NULL
)
return
;
return
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
NR_CSI_IM_Resource_t
*
imcsi
;
NR_CSI_IM_Resource_t
*
imcsi
;
int
period
,
offset
;
int
period
,
offset
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
for
(
int
id
=
0
;
id
<
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
count
;
id
++
){
for
(
int
id
=
0
;
id
<
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
count
;
id
++
){
imcsi
=
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
array
[
id
];
imcsi
=
csi_measconfig
->
csi_IM_ResourceToAddModList
->
list
.
array
[
id
];
csi_period_offset
(
NULL
,
imcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
csi_period_offset
(
NULL
,
imcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
if
((
frame
*
nr_slots_per_frame
[
mu
]
+
slot
-
offset
)
%
period
==
0
)
{
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
;
continue
;
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
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
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
const
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
csiim_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
csiim_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
subcarrier_spacing
=
mu
;
csiim_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csiim_config_pdu
->
start_rb
=
imcsi
->
freqBand
->
startingRB
;
csiim_config_pdu
->
subcarrier_spacing
=
mu
;
csiim_config_pdu
->
nr_of_rbs
=
imcsi
->
freqBand
->
nrofRBs
;
csiim_config_pdu
->
start_rb
=
imcsi
->
freqBand
->
startingRB
;
// As specified in 5.2.2.4 of 38.214
csiim_config_pdu
->
nr_of_rbs
=
imcsi
->
freqBand
->
nrofRBs
;
switch
(
imcsi
->
csi_IM_ResourceElementPattern
->
present
)
{
// As specified in 5.2.2.4 of 38.214
case
NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0
:
switch
(
imcsi
->
csi_IM_ResourceElementPattern
->
present
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
case
NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0
:
csiim_config_pdu
->
k_csiim
[
i
]
=
(
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern0
->
subcarrierLocation_p0
<<
1
)
+
(
i
>>
1
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
csiim_config_pdu
->
l_csiim
[
i
]
=
imcsi
->
csi_IM_ResourceElementPattern
->
choice
.
pattern0
->
symbolLocation_p0
+
(
i
%
2
);
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
"
);
}
}
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
=
FAPI_NR_DL_CONFIG_TYPE_CSI_IM
;
break
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
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
)
{
void
nr_schedule_csirs_reception
(
NR_UE_MAC_INST_t
*
mac
,
int
frame
,
int
slot
)
{
if
(
mac
->
ra
.
ra_state
==
RA_SUCCEEDED
||
if
(
mac
->
ra
.
ra_state
!=
RA_SUCCEEDED
&&
get_softmodem_params
()
->
phy_test
==
0
)
get_softmodem_params
()
->
phy_test
==
1
)
{
return
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
NR_CellGroupConfig_t
*
CellGroup
=
mac
->
cg
;
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
if
(
!
CellGroup
||
!
CellGroup
->
spCellConfig
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
||
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
!
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
csi_MeasConfig
)
return
;
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
)
if
(
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
==
NULL
)
return
;
return
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
fapi_nr_dl_config_request_t
*
dl_config
=
&
mac
->
dl_config_request
;
NR_NZP_CSI_RS_Resource_t
*
nzpcsi
;
NR_NZP_CSI_RS_Resource_t
*
nzpcsi
;
int
period
,
offset
;
int
period
,
offset
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
int
mu
=
mac
->
DLbwp
[
dl_bwp_id
-
1
]
?
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
:
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
subcarrierSpacing
;
for
(
int
id
=
0
;
id
<
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
count
;
id
++
){
for
(
int
id
=
0
;
id
<
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
count
;
id
++
){
nzpcsi
=
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
array
[
id
];
nzpcsi
=
csi_measconfig
->
nzp_CSI_RS_ResourceToAddModList
->
list
.
array
[
id
];
csi_period_offset
(
NULL
,
nzpcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
csi_period_offset
(
NULL
,
nzpcsi
->
periodicityAndOffset
,
&
period
,
&
offset
);
if
((
frame
*
nr_slots_per_frame
[
mu
]
+
slot
-
offset
)
%
period
==
0
)
{
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
);
continue
;
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
;
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
;
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
:
const
NR_BWP_Downlink_t
*
dlbwp
=
mac
->
DLbwp
[
dl_bwp_id
-
1
];
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
const
int
locationAndBandwidth
=
dlbwp
!=
NULL
?
dlbwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
:
csirs_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
mac
->
scc_SIB
->
downlinkConfigCommon
.
initialDownlinkBWP
.
genericParameters
.
locationAndBandwidth
;
csirs_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
bwp_size
=
NRRIV2BW
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
subcarrier_spacing
=
mu
;
csirs_config_pdu
->
bwp_start
=
NRRIV2PRBOFFSET
(
locationAndBandwidth
,
MAX_BWP_SIZE
);
csirs_config_pdu
->
start_rb
=
resourceMapping
.
freqBand
.
startingRB
;
csirs_config_pdu
->
subcarrier_spacing
=
mu
;
csirs_config_pdu
->
nr_of_rbs
=
resourceMapping
.
freqBand
.
nrofRBs
;
csirs_config_pdu
->
start_rb
=
resourceMapping
.
freqBand
.
startingRB
;
csirs_config_pdu
->
csi_type
=
1
;
// NZP-CSI-RS
csirs_config_pdu
->
nr_of_rbs
=
resourceMapping
.
freqBand
.
nrofRBs
;
csirs_config_pdu
->
symb_l0
=
resourceMapping
.
firstOFDMSymbolInTimeDomain
;
csirs_config_pdu
->
csi_type
=
1
;
// NZP-CSI-RS
if
(
resourceMapping
.
firstOFDMSymbolInTimeDomain2
)
csirs_config_pdu
->
symb_l0
=
resourceMapping
.
firstOFDMSymbolInTimeDomain
;
csirs_config_pdu
->
symb_l1
=
*
resourceMapping
.
firstOFDMSymbolInTimeDomain2
;
if
(
resourceMapping
.
firstOFDMSymbolInTimeDomain2
)
csirs_config_pdu
->
cdm_type
=
resourceMapping
.
cdm_Type
;
csirs_config_pdu
->
symb_l1
=
*
resourceMapping
.
firstOFDMSymbolInTimeDomain2
;
csirs_config_pdu
->
freq_density
=
resourceMapping
.
density
.
present
;
csirs_config_pdu
->
cdm_type
=
resourceMapping
.
cdm_Type
;
if
((
resourceMapping
.
density
.
present
==
NR_CSI_RS_ResourceMapping__density_PR_dot5
)
csirs_config_pdu
->
freq_density
=
resourceMapping
.
density
.
present
;
&&
(
resourceMapping
.
density
.
choice
.
dot5
==
NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs
))
if
((
resourceMapping
.
density
.
present
==
NR_CSI_RS_ResourceMapping__density_PR_dot5
)
csirs_config_pdu
->
freq_density
--
;
&&
(
resourceMapping
.
density
.
choice
.
dot5
==
NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs
))
csirs_config_pdu
->
scramb_id
=
nzpcsi
->
scramblingID
;
csirs_config_pdu
->
freq_density
--
;
switch
(
resourceMapping
.
frequencyDomainAllocation
.
present
){
csirs_config_pdu
->
scramb_id
=
nzpcsi
->
scramblingID
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1
:
switch
(
resourceMapping
.
frequencyDomainAllocation
.
present
){
csirs_config_pdu
->
row
=
1
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1
:
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row1
.
buf
[
0
])
>>
4
)
&
0x0f
;
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
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2
:
case
NR_CSI_RS_ResourceMapping__nrofPorts_p2
:
csirs_config_pdu
->
row
=
2
;
csirs_config_pdu
->
row
=
3
;
csirs_config_pdu
->
freq_domain
=
(((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row2
.
buf
[
1
]
>>
4
)
&
0x0f
)
|
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row2
.
buf
[
0
]
<<
4
)
&
0xff0
));
break
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4
:
case
NR_CSI_RS_ResourceMapping__nrofPorts_p4
:
csirs_config_pdu
->
row
=
4
;
csirs_config_pdu
->
row
=
5
;
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
row4
.
buf
[
0
])
>>
5
)
&
0x07
;
break
;
break
;
case
NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other
:
case
NR_CSI_RS_ResourceMapping__nrofPorts_p8
:
csirs_config_pdu
->
freq_domain
=
((
resourceMapping
.
frequencyDomainAllocation
.
choice
.
other
.
buf
[
0
])
>>
2
)
&
0x3f
;
if
(
resourceMapping
.
cdm_Type
==
NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2
)
// determining the row of table 7.4.1.5.3-1 in 38.211
csirs_config_pdu
->
row
=
8
;
switch
(
resourceMapping
.
nrofPorts
){
else
{
case
NR_CSI_RS_ResourceMapping__nrofPorts_p1
:
int
num_k
=
0
;
AssertFatal
(
1
==
0
,
"Resource with 1 CSI port shouldn't be within other rows
\n
"
);
for
(
int
k
=
0
;
k
<
6
;
k
++
)
break
;
num_k
+=
(((
csirs_config_pdu
->
freq_domain
)
>>
k
)
&
0x01
);
case
NR_CSI_RS_ResourceMapping__nrofPorts_p2
:
if
(
num_k
==
4
)
csirs_config_pdu
->
row
=
3
;
csirs_config_pdu
->
row
=
6
;
break
;
else
case
NR_CSI_RS_ResourceMapping__nrofPorts_p4
:
csirs_config_pdu
->
row
=
7
;
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
"
);
}
}
break
;
break
;
default:
case
NR_CSI_RS_ResourceMapping__nrofPorts_p12
:
AssertFatal
(
1
==
0
,
"Invalid freqency domain allocation in CSI-RS resource
\n
"
);
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
;
break
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
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