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
alex037yang
OpenXG-RAN
Commits
6e2b7e4c
Commit
6e2b7e4c
authored
Feb 23, 2021
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate PDSCH scheduling variables into dynamic, semi-static
parent
8e50489f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
106 deletions
+124
-106
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+17
-17
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+26
-65
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+11
-18
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+41
-0
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+7
-0
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+22
-6
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
View file @
6e2b7e4c
...
...
@@ -254,8 +254,8 @@ void schedule_control_sib1(module_id_t module_id,
}
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_AdditionalPosition
=
NULL
;
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
time_domain_allocation
=
time_domain_allocation
;
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
=
mcsTableIdx
;
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
time_domain_allocation
=
time_domain_allocation
;
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
=
mcsTableIdx
;
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
=
mcs
;
gNB_mac
->
sched_ctrlCommon
->
num_total_bytes
=
num_total_bytes
;
...
...
@@ -278,18 +278,18 @@ void schedule_control_sib1(module_id_t module_id,
// Calculate number of symbols
struct
NR_PDSCH_TimeDomainResourceAllocationList
*
tdaList
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
;
const
int
startSymbolAndLength
=
tdaList
->
list
.
array
[
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
time_domain_allocation
]
->
startSymbolAndLength
;
tdaList
->
list
.
array
[
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
time_domain_allocation
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
if
(
nrOfSymbols
==
2
)
{
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
numDmrsCdmGrpsNoData
=
1
;
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
numDmrsCdmGrpsNoData
=
1
;
}
else
{
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
numDmrsCdmGrpsNoData
=
2
;
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
numDmrsCdmGrpsNoData
=
2
;
}
// Calculate number of PRB_DMRS
uint8_t
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
numDmrsCdmGrpsNoData
*
6
;
uint8_t
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
numDmrsCdmGrpsNoData
*
6
;
uint16_t
dlDmrsSymbPos
=
fill_dmrs_mask
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
gNB_mac
->
common_channels
->
ServingCellConfigCommon
->
dmrs_TypeA_Position
,
startSymbolIndex
+
nrOfSymbols
);
uint16_t
dmrs_length
=
get_num_dmrs
(
dlDmrsSymbPos
);
...
...
@@ -298,9 +298,9 @@ void schedule_control_sib1(module_id_t module_id,
do
{
rbSize
++
;
TBS
=
nr_compute_tbs
(
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
,
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
),
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
,
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
),
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
*
dmrs_length
,
0
,
0
,
1
)
>>
3
;
}
while
(
rbStart
+
rbSize
<
bwpSize
&&
!
vrb_map
[
rbStart
+
rbSize
]
&&
TBS
<
gNB_mac
->
sched_ctrlCommon
->
num_total_bytes
);
...
...
@@ -379,16 +379,16 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
pdsch_pdu_rel15
->
dmrsConfigType
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NULL
?
0
:
1
;
pdsch_pdu_rel15
->
dlDmrsScramblingId
=
*
scc
->
physCellId
;
pdsch_pdu_rel15
->
SCID
=
0
;
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
numDmrsCdmGrpsNoData
;
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
=
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
numDmrsCdmGrpsNoData
;
pdsch_pdu_rel15
->
dmrsPorts
=
1
;
pdsch_pdu_rel15
->
resourceAlloc
=
1
;
pdsch_pdu_rel15
->
rbStart
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
rbStart
;
pdsch_pdu_rel15
->
rbSize
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
rbSize
;
pdsch_pdu_rel15
->
VRBtoPRBMapping
=
0
;
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
,
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
);
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
,
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
);
pdsch_pdu_rel15
->
TBSize
[
0
]
=
TBS
;
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
;
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
;
pdsch_pdu_rel15
->
StartSymbolIndex
=
StartSymbolIndex
;
pdsch_pdu_rel15
->
NrOfSymbols
=
NrOfSymbols
;
...
...
@@ -417,7 +417,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
dci_payload
.
frequency_domain_assignment
.
val
=
PRBalloc_to_locationandbandwidth0
(
pdsch_pdu_rel15
->
rbSize
,
pdsch_pdu_rel15
->
rbStart
,
gNB_mac
->
type0_PDCCH_CSS_config
.
num_rbs
);
dci_payload
.
time_domain_assignment
.
val
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
time_domain_allocation
;
dci_payload
.
time_domain_assignment
.
val
=
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
time_domain_allocation
;
dci_payload
.
mcs
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
;
dci_payload
.
rv
=
pdsch_pdu_rel15
->
rvIndex
[
0
];
dci_payload
.
harq_pid
=
0
;
...
...
@@ -489,18 +489,18 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
int
startSymbolIndex
,
nrOfSymbols
;
struct
NR_PDSCH_TimeDomainResourceAllocationList
*
tdaList
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
;
const
int
startSymbolAndLength
=
tdaList
->
list
.
array
[
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
time_domain_allocation
]
->
startSymbolAndLength
;
tdaList
->
list
.
array
[
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
time_domain_allocation
]
->
startSymbolAndLength
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
// Calculate number of PRB_DMRS
uint8_t
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
numDmrsCdmGrpsNoData
*
6
;
uint8_t
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
numDmrsCdmGrpsNoData
*
6
;
uint16_t
dlDmrsSymbPos
=
fill_dmrs_mask
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
gNB_mac
->
common_channels
->
ServingCellConfigCommon
->
dmrs_TypeA_Position
,
startSymbolIndex
+
nrOfSymbols
);
uint16_t
dmrs_length
=
get_num_dmrs
(
dlDmrsSymbPos
);
const
uint32_t
TBS
=
nr_compute_tbs
(
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
,
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
),
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcs
,
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
pdsch_semi_static
.
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
sched_pdsch
.
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
*
dmrs_length
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
6e2b7e4c
...
...
@@ -302,35 +302,6 @@ int nr_write_ce_dlsch_pdu(module_id_t module_idP,
return
offset
;
}
int
getNrOfSymbols
(
NR_BWP_Downlink_t
*
bwp
,
int
tda
)
{
struct
NR_PDSCH_TimeDomainResourceAllocationList
*
tdaList
=
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
;
AssertFatal
(
tda
<
tdaList
->
list
.
count
,
"time_domain_allocation %d>=%d
\n
"
,
tda
,
tdaList
->
list
.
count
);
const
int
startSymbolAndLength
=
tdaList
->
list
.
array
[
tda
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
return
nrOfSymbols
;
}
nfapi_nr_dmrs_type_e
getDmrsConfigType
(
NR_BWP_Downlink_t
*
bwp
)
{
return
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NULL
?
0
:
1
;
}
uint8_t
getN_PRB_DMRS
(
NR_BWP_Downlink_t
*
bwp
,
int
numDmrsCdmGrpsNoData
)
{
const
nfapi_nr_dmrs_type_e
dmrsConfigType
=
getDmrsConfigType
(
bwp
);
if
(
dmrsConfigType
==
NFAPI_NR_DMRS_TYPE1
)
{
// if no data in dmrs cdm group is 1 only even REs have no data
// if no data in dmrs cdm group is 2 both odd and even REs have no data
return
numDmrsCdmGrpsNoData
*
6
;
}
else
{
return
numDmrsCdmGrpsNoData
*
4
;
}
}
void
nr_store_dlsch_buffer
(
module_id_t
module_id
,
frame_t
frame
,
sub_frame_t
slot
)
{
...
...
@@ -458,6 +429,7 @@ void pf_dl(module_id_t module_id,
for
(
int
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
NR_sched_pdsch_t
*
sched_pdsch
=
&
sched_ctrl
->
sched_pdsch
;
NR_pdsch_semi_static_t
*
ps
=
&
sched_ctrl
->
pdsch_semi_static
;
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
sched_pdsch
->
dl_harq_pid
=
sched_ctrl
->
retrans_dl_harq
.
head
;
...
...
@@ -484,9 +456,8 @@ void pf_dl(module_id_t module_id,
continue
;
/* Calculate coeff */
sched_pdsch
->
mcsTableIdx
=
0
;
sched_pdsch
->
mcs
=
9
;
uint32_t
tbs
=
pf_tbs
[
sched_pdsch
->
mcsTableIdx
][
sched_pdsch
->
mcs
];
uint32_t
tbs
=
pf_tbs
[
ps
->
mcsTableIdx
][
sched_pdsch
->
mcs
];
coeff_ue
[
UE_id
]
=
(
float
)
tbs
/
thr_ue
[
UE_id
];
LOG_D
(
MAC
,
"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f
\n
"
,
b
,
UE_id
,
thr_ue
[
UE_id
],
tbs
,
UE_id
,
coeff_ue
[
UE_id
]);
...
...
@@ -553,15 +524,15 @@ void pf_dl(module_id_t module_id,
while
(
rbStart
<
bwpSize
&&
!
rballoc_mask
[
rbStart
])
rbStart
++
;
/* MCS has been set above */
const
uint8_t
num_dmrs_cdm_grps_no_data
=
1
;
const
int
tda
=
2
;
NR_sched_pdsch_t
*
sched_pdsch
=
&
sched_ctrl
->
sched_pdsch
;
sched_pdsch
->
time_domain_allocation
=
2
;
sched_pdsch
->
numDmrsCdmGrpsNoData
=
1
;
sched_pdsch
->
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
sched_pdsch
->
mcsTableIdx
);
sched_pdsch
->
R
=
nr_get_code_rate_dl
(
sched_pdsch
->
mcs
,
sched_pdsch
->
mcsTableIdx
);
const
int
nrOfSymbols
=
getNrOfSymbols
(
sched_ctrl
->
active_bwp
,
sched_ctrl
->
sched_pdsch
.
time_domain_allocation
);
const
uint8_t
N_PRB_DMRS
=
getN_PRB_DMRS
(
sched_ctrl
->
active_bwp
,
sched_pdsch
->
numDmrsCdmGrpsNoData
);
const
uint8_t
N_DMRS_SLOT
=
get_num_dmrs_symbols
(
sched_ctrl
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
scc
->
dmrs_TypeA_Position
,
nrOfSymbols
);
NR_pdsch_semi_static_t
*
ps
=
&
sched_ctrl
->
pdsch_semi_static
;
if
(
ps
->
time_domain_allocation
!=
tda
||
ps
->
numDmrsCdmGrpsNoData
!=
num_dmrs_cdm_grps_no_data
)
nr_set_pdsch_semi_static
(
scc
,
UE_info
->
secondaryCellGroup
[
UE_id
],
sched_ctrl
->
active_bwp
,
tda
,
num_dmrs_cdm_grps_no_data
,
ps
);
sched_pdsch
->
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
ps
->
mcsTableIdx
);
sched_pdsch
->
R
=
nr_get_code_rate_dl
(
sched_pdsch
->
mcs
,
ps
->
mcsTableIdx
);
int
rbSize
=
0
;
uint32_t
TBS
=
0
;
...
...
@@ -572,8 +543,8 @@ void pf_dl(module_id_t module_id,
TBS
=
nr_compute_tbs
(
sched_pdsch
->
Qm
,
sched_pdsch
->
R
,
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
*
N_DMRS_SLOT
,
ps
->
nrOfSymbols
,
ps
->
N_PRB_DMRS
*
ps
->
N_DMRS_SLOT
,
0
/* N_PRB_oh, 0 for initialBWP */
,
0
/* tb_scaling */
,
1
/* nrOfLayers */
)
...
...
@@ -691,23 +662,16 @@ void nr_schedule_ue_spec(module_id_t module_id,
const
rnti_t
rnti
=
UE_info
->
rnti
[
UE_id
];
/* POST processing */
struct
NR_PDSCH_TimeDomainResourceAllocationList
*
tdaList
=
sched_ctrl
->
active_bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
;
AssertFatal
(
sched_pdsch
->
time_domain_allocation
<
tdaList
->
list
.
count
,
"time_domain_allocation %d>=%d
\n
"
,
sched_pdsch
->
time_domain_allocation
,
tdaList
->
list
.
count
);
const
int
startSymbolAndLength
=
tdaList
->
list
.
array
[
sched_pdsch
->
time_domain_allocation
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
const
nfapi_nr_dmrs_type_e
dmrsConfigType
=
getDmrsConfigType
(
sched_ctrl
->
active_bwp
);
const
int
nrOfLayers
=
1
;
const
uint16_t
R
=
sched_pdsch
->
R
;
const
uint8_t
Qm
=
sched_pdsch
->
Qm
;
const
uint32_t
TBS
=
sched_pdsch
->
tb_size
;
/* pre-computed PDSCH values that only change if time domain
* allocation/DMRS parameters change. Updated in the preprocessor through
* nr_set_pdsch_semi_static() */
NR_pdsch_semi_static_t
*
ps
=
&
sched_ctrl
->
pdsch_semi_static
;
int8_t
current_harq_pid
=
sched_pdsch
->
dl_harq_pid
;
if
(
current_harq_pid
<
0
)
{
/* PP has not selected a specific HARQ Process, get a new one */
...
...
@@ -742,8 +706,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
rnti
,
sched_pdsch
->
rbStart
,
sched_pdsch
->
rbSize
,
startSymbolIndex
,
nrOfSymbols
,
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
,
sched_pdsch
->
mcs
,
TBS
,
current_harq_pid
,
...
...
@@ -801,7 +765,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu
->
targetCodeRate
[
0
]
=
R
;
pdsch_pdu
->
qamModOrder
[
0
]
=
Qm
;
pdsch_pdu
->
mcsIndex
[
0
]
=
sched_pdsch
->
mcs
;
pdsch_pdu
->
mcsTable
[
0
]
=
sched_pdsch
->
mcsTableIdx
;
pdsch_pdu
->
mcsTable
[
0
]
=
ps
->
mcsTableIdx
;
pdsch_pdu
->
rvIndex
[
0
]
=
nr_rv_round_map
[
harq
->
round
];
pdsch_pdu
->
TBSize
[
0
]
=
TBS
;
...
...
@@ -811,14 +775,11 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu
->
refPoint
=
0
;
// Point A
// DMRS
pdsch_pdu
->
dlDmrsSymbPos
=
fill_dmrs_mask
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
scc
->
dmrs_TypeA_Position
,
nrOfSymbols
);
pdsch_pdu
->
dmrsConfigType
=
dmrsConfigType
;
pdsch_pdu
->
dlDmrsSymbPos
=
ps
->
dl_dmrs_symb_pos
;
pdsch_pdu
->
dmrsConfigType
=
ps
->
dmrsConfigType
;
pdsch_pdu
->
dlDmrsScramblingId
=
*
scc
->
physCellId
;
pdsch_pdu
->
SCID
=
0
;
pdsch_pdu
->
numDmrsCdmGrpsNoData
=
sched_pdsch
->
numDmrsCdmGrpsNoData
;
pdsch_pdu
->
numDmrsCdmGrpsNoData
=
ps
->
numDmrsCdmGrpsNoData
;
pdsch_pdu
->
dmrsPorts
=
1
;
// Pdsch Allocation in frequency domain
...
...
@@ -828,8 +789,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu
->
VRBtoPRBMapping
=
1
;
// non-interleaved, check if this is ok for initialBWP
// Resource Allocation in time domain
pdsch_pdu
->
StartSymbolIndex
=
startSymbolIndex
;
pdsch_pdu
->
NrOfSymbols
=
nrOfSymbols
;
pdsch_pdu
->
StartSymbolIndex
=
ps
->
startSymbolIndex
;
pdsch_pdu
->
NrOfSymbols
=
ps
->
nrOfSymbols
;
/* Check and validate PTRS values */
struct
NR_SetupRelease_PTRS_DownlinkConfig
*
phaseTrackingRS
=
...
...
@@ -883,7 +844,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu
->
rbSize
,
pdsch_pdu
->
rbStart
,
pdsch_pdu
->
BWPSize
);
dci_payload
.
time_domain_assignment
.
val
=
sched_pdsch
->
time_domain_allocation
;
dci_payload
.
time_domain_assignment
.
val
=
ps
->
time_domain_allocation
;
dci_payload
.
mcs
=
sched_pdsch
->
mcs
;
dci_payload
.
rv
=
pdsch_pdu
->
rvIndex
[
0
];
dci_payload
.
harq_pid
=
current_harq_pid
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
View file @
6e2b7e4c
...
...
@@ -355,30 +355,23 @@ void nr_preprocessor_phytest(module_id_t module_id,
rnti
,
frame
,
slot
);
NR_sched_pdsch_t
*
sched_pdsch
=
&
sched_ctrl
->
sched_pdsch
;
NR_pdsch_semi_static_t
*
ps
=
&
sched_ctrl
->
pdsch_semi_static
;
sched_pdsch
->
rbStart
=
rbStart
;
sched_pdsch
->
rbSize
=
rbSize
;
sched_pdsch
->
time_domain_allocation
=
2
;
if
(
!
UE_info
->
secondaryCellGroup
[
UE_id
]
->
spCellConfig
->
spCellConfigDedicated
->
initialDownlinkBWP
->
pdsch_Config
->
choice
.
setup
->
mcs_Table
)
sched_pdsch
->
mcsTableIdx
=
0
;
else
{
if
(
*
UE_info
->
secondaryCellGroup
[
UE_id
]
->
spCellConfig
->
spCellConfigDedicated
->
initialDownlinkBWP
->
pdsch_Config
->
choice
.
setup
->
mcs_Table
==
0
)
sched_pdsch
->
mcsTableIdx
=
1
;
else
sched_pdsch
->
mcsTableIdx
=
2
;
}
const
int
tda
=
2
;
const
uint8_t
num_dmrs_cdm_grps_no_data
=
1
;
if
(
ps
->
time_domain_allocation
!=
tda
||
ps
->
numDmrsCdmGrpsNoData
!=
num_dmrs_cdm_grps_no_data
)
nr_set_pdsch_semi_static
(
scc
,
UE_info
->
secondaryCellGroup
[
UE_id
],
sched_ctrl
->
active_bwp
,
tda
,
num_dmrs_cdm_grps_no_data
,
ps
);
sched_pdsch
->
mcs
=
target_dl_mcs
;
sched_pdsch
->
numDmrsCdmGrpsNoData
=
1
;
sched_pdsch
->
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
sched_pdsch
->
mcsTableIdx
);
sched_pdsch
->
R
=
nr_get_code_rate_dl
(
sched_pdsch
->
mcs
,
sched_pdsch
->
mcsTableIdx
);
const
int
nrOfSymbols
=
getNrOfSymbols
(
sched_ctrl
->
active_bwp
,
sched_pdsch
->
time_domain_allocation
);
const
uint8_t
N_PRB_DMRS
=
getN_PRB_DMRS
(
sched_ctrl
->
active_bwp
,
sched_ctrl
->
sched_pdsch
.
numDmrsCdmGrpsNoData
);
const
uint8_t
N_DMRS_SLOT
=
get_num_dmrs_symbols
(
sched_ctrl
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
scc
->
dmrs_TypeA_Position
,
nrOfSymbols
);
sched_pdsch
->
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
ps
->
mcsTableIdx
);
sched_pdsch
->
R
=
nr_get_code_rate_dl
(
sched_pdsch
->
mcs
,
ps
->
mcsTableIdx
);
sched_pdsch
->
tb_size
=
nr_compute_tbs
(
sched_pdsch
->
Qm
,
sched_pdsch
->
R
,
sched_pdsch
->
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
*
N_DMRS_SLOT
,
ps
->
nrOfSymbols
,
ps
->
N_PRB_DMRS
*
ps
->
N_DMRS_SLOT
,
0
/* N_PRB_oh, 0 for initialBWP */
,
0
/* tb_scaling */
,
1
/* nrOfLayers */
)
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
6e2b7e4c
...
...
@@ -212,6 +212,46 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
}
void
nr_set_pdsch_semi_static
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
NR_CellGroupConfig_t
*
secondaryCellGroup
,
const
NR_BWP_Downlink_t
*
bwp
,
int
tda
,
uint8_t
num_dmrs_cdm_grps_no_data
,
NR_pdsch_semi_static_t
*
ps
)
{
ps
->
time_domain_allocation
=
tda
;
const
struct
NR_PDSCH_TimeDomainResourceAllocationList
*
tdaList
=
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
;
AssertFatal
(
tda
<
tdaList
->
list
.
count
,
"time_domain_allocation %d>=%d
\n
"
,
tda
,
tdaList
->
list
.
count
);
const
int
startSymbolAndLength
=
tdaList
->
list
.
array
[
tda
]
->
startSymbolAndLength
;
SLIV2SL
(
startSymbolAndLength
,
&
ps
->
startSymbolIndex
,
&
ps
->
nrOfSymbols
);
if
(
!
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
initialDownlinkBWP
->
pdsch_Config
->
choice
.
setup
->
mcs_Table
)
ps
->
mcsTableIdx
=
0
;
else
if
(
*
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
initialDownlinkBWP
->
pdsch_Config
->
choice
.
setup
->
mcs_Table
==
0
)
ps
->
mcsTableIdx
=
1
;
else
ps
->
mcsTableIdx
=
2
;
ps
->
numDmrsCdmGrpsNoData
=
num_dmrs_cdm_grps_no_data
;
ps
->
dmrsConfigType
=
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NULL
?
0
:
1
;
// if no data in dmrs cdm group is 1 only even REs have no data
// if no data in dmrs cdm group is 2 both odd and even REs have no data
ps
->
N_PRB_DMRS
=
num_dmrs_cdm_grps_no_data
*
(
ps
->
dmrsConfigType
==
NFAPI_NR_DMRS_TYPE1
?
6
:
4
);
ps
->
N_DMRS_SLOT
=
get_num_dmrs_symbols
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
scc
->
dmrs_TypeA_Position
,
ps
->
nrOfSymbols
);
ps
->
dl_dmrs_symb_pos
=
fill_dmrs_mask
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
scc
->
dmrs_TypeA_Position
,
ps
->
nrOfSymbols
);
}
void
nr_save_pusch_fields
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
NR_BWP_Uplink_t
*
ubwp
,
long
dci_format
,
...
...
@@ -1645,6 +1685,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
sched_ctrl
->
ta_update
=
31
;
sched_ctrl
->
ta_apply
=
false
;
/* set illegal time domain allocation to force recomputation of all fields */
sched_ctrl
->
pdsch_semi_static
.
time_domain_allocation
=
-
1
;
sched_ctrl
->
pusch_save
.
time_domain_allocation
=
-
1
;
const
NR_ServingCellConfig_t
*
servingCellConfig
=
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
;
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
6e2b7e4c
...
...
@@ -262,6 +262,13 @@ NR_SearchSpace_t *get_searchspace(
long
get_K2
(
NR_BWP_Uplink_t
*
ubwp
,
int
time_domain_assignment
,
int
mu
);
void
nr_set_pdsch_semi_static
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
NR_CellGroupConfig_t
*
secondaryCellGroup
,
const
NR_BWP_Downlink_t
*
bwp
,
int
tda
,
uint8_t
num_dmrs_cdm_grps_no_data
,
NR_pdsch_semi_static_t
*
ps
);
void
nr_save_pusch_fields
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
NR_BWP_Uplink_t
*
ubwp
,
long
dci_format
,
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
6e2b7e4c
...
...
@@ -352,18 +352,32 @@ typedef struct NR_sched_pusch {
int8_t
ul_harq_pid
;
}
NR_sched_pusch_t
;
/* PDSCH semi-static configuratio: as long as the TDA/DMRS/mcsTable remains the
* same, there is no need to recalculate all S/L or DMRS-related parameters
* over and over again. Hence, we store them in this struct for easy
* reference. */
typedef
struct
NR_pdsch_semi_static
{
int
time_domain_allocation
;
uint8_t
numDmrsCdmGrpsNoData
;
int
startSymbolIndex
;
int
nrOfSymbols
;
uint8_t
mcsTableIdx
;
uint8_t
N_PRB_DMRS
;
uint8_t
N_DMRS_SLOT
;
uint16_t
dl_dmrs_symb_pos
;
nfapi_nr_dmrs_type_e
dmrsConfigType
;
}
NR_pdsch_semi_static_t
;
typedef
struct
NR_sched_pdsch
{
/// RB allocation within active BWP
uint16_t
rbSize
;
uint16_t
rbStart
;
// time-domain allocation for scheduled RBs
int
time_domain_allocation
;
/// MCS-related infos
uint8_t
mcsTableIdx
;
uint8_t
mcs
;
uint8_t
numDmrsCdmGrpsNoData
;
/// TBS-related info
uint16_t
R
;
...
...
@@ -522,6 +536,9 @@ typedef struct {
/// PHR info: nominal UE transmit power levels (dBm)
int
pcmax
;
/// PDSCH semi-static configuration: is not cleared across TTIs
NR_pdsch_semi_static_t
pdsch_semi_static
;
/// Sched PDSCH: scheduling decisions, copied into HARQ and cleared every TTI
NR_sched_pdsch_t
sched_pdsch
;
/// total amount of data awaiting for this UE
...
...
@@ -555,7 +572,6 @@ typedef struct {
NR_list_t
feedback_ul_harq
;
/// UL HARQ processes that await retransmission
NR_list_t
retrans_ul_harq
;
int
dummy
;
NR_UE_mac_ce_ctrl_t
UE_mac_ce_ctrl
;
// MAC CE related information
}
NR_UE_sched_ctrl_t
;
...
...
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