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
86cf5e70
Commit
86cf5e70
authored
Aug 25, 2022
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reworking gNB PUCCH scheduling
parent
84611333
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
233 additions
and
367 deletions
+233
-367
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+4
-6
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+44
-8
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+175
-350
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+5
-2
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+5
-1
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
View file @
86cf5e70
...
@@ -215,9 +215,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
...
@@ -215,9 +215,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
// Schedule CSI-RS transmission
// Schedule CSI-RS transmission
nr_csirs_scheduling
(
module_idP
,
frame
,
slot
,
nr_slots_per_frame
[
*
scc
->
ssbSubcarrierSpacing
]);
nr_csirs_scheduling
(
module_idP
,
frame
,
slot
,
nr_slots_per_frame
[
*
scc
->
ssbSubcarrierSpacing
]);
// Schedule CSI measurement reporting: check in slot 0 for the whole frame
// Schedule CSI measurement reporting
if
(
slot
==
0
)
nr_csi_meas_reporting
(
module_idP
,
frame
,
slot
);
nr_csi_meas_reporting
(
module_idP
,
frame
,
slot
);
// Schedule SRS: check in slot 0 for the whole frame
// Schedule SRS: check in slot 0 for the whole frame
if
(
slot
==
0
)
if
(
slot
==
0
)
...
@@ -237,10 +236,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
...
@@ -237,10 +236,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
nr_schedule_ue_spec
(
module_idP
,
frame
,
slot
);
nr_schedule_ue_spec
(
module_idP
,
frame
,
slot
);
stop_meas
(
&
gNB
->
schedule_dlsch
);
stop_meas
(
&
gNB
->
schedule_dlsch
);
nr_s
chedule_pucch
(
RC
.
nrmac
[
module_idP
],
frame
,
slot
);
nr_s
r_reporting
(
RC
.
nrmac
[
module_idP
],
frame
,
slot
,
module_idP
);
// This schedule SR after PUCCH for multiplexing
nr_schedule_pucch
(
RC
.
nrmac
[
module_idP
],
frame
,
slot
);
nr_sr_reporting
(
RC
.
nrmac
[
module_idP
],
frame
,
slot
);
stop_meas
(
&
RC
.
nrmac
[
module_idP
]
->
eNB_scheduler
);
stop_meas
(
&
RC
.
nrmac
[
module_idP
]
->
eNB_scheduler
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
86cf5e70
...
@@ -1087,7 +1087,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
...
@@ -1087,7 +1087,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
pucch_pdu
->
cyclic_prefix
=
(
current_BWP
->
cyclicprefix
==
NULL
)
?
0
:
*
current_BWP
->
cyclicprefix
;
pucch_pdu
->
cyclic_prefix
=
(
current_BWP
->
cyclicprefix
==
NULL
)
?
0
:
*
current_BWP
->
cyclicprefix
;
NR_PUCCH_Config_t
*
pucch_Config
=
current_BWP
->
pucch_Config
;
NR_PUCCH_Config_t
*
pucch_Config
=
current_BWP
->
pucch_Config
;
if
(
r_pucch
<
0
||
pucch_Config
){
if
(
r_pucch
<
0
||
pucch_Config
)
{
LOG_D
(
NR_MAC
,
"pucch_acknak: Filling dedicated configuration for PUCCH
\n
"
);
LOG_D
(
NR_MAC
,
"pucch_acknak: Filling dedicated configuration for PUCCH
\n
"
);
AssertFatal
(
pucch_Config
->
resourceSetToAddModList
!=
NULL
,
AssertFatal
(
pucch_Config
->
resourceSetToAddModList
!=
NULL
,
...
@@ -2375,6 +2375,17 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
...
@@ -2375,6 +2375,17 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
else
else
UL_BWP
->
pucch_ConfigCommon
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pucch_ConfigCommon
->
choice
.
setup
;
UL_BWP
->
pucch_ConfigCommon
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
pucch_ConfigCommon
->
choice
.
setup
;
UL_BWP
->
max_fb_time
=
0
;
if
(
DL_BWP
->
dci_format
!=
NR_DL_DCI_FORMAT_1_0
&&
UL_BWP
->
pucch_Config
)
{
for
(
int
i
=
0
;
i
<
UL_BWP
->
pucch_Config
->
dl_DataToUL_ACK
->
list
.
count
;
i
++
)
{
if
(
*
UL_BWP
->
pucch_Config
->
dl_DataToUL_ACK
->
list
.
array
[
i
]
>
UL_BWP
->
max_fb_time
)
UL_BWP
->
max_fb_time
=
*
UL_BWP
->
pucch_Config
->
dl_DataToUL_ACK
->
list
.
array
[
i
];
}
}
else
UL_BWP
->
max_fb_time
=
8
;
// default value
if
(
UE
)
{
if
(
UE
)
{
// setting PDCCH related structures for sched_ctrl
// setting PDCCH related structures for sched_ctrl
...
@@ -2410,6 +2421,8 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
...
@@ -2410,6 +2421,8 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
if
(
UL_BWP
->
csi_MeasConfig
)
if
(
UL_BWP
->
csi_MeasConfig
)
compute_csi_bitlen
(
UL_BWP
->
csi_MeasConfig
,
UE
->
csi_report_template
);
compute_csi_bitlen
(
UL_BWP
->
csi_MeasConfig
,
UE
->
csi_report_template
);
set_sched_pucch_list
(
sched_ctrl
,
UL_BWP
,
scc
);
}
}
if
(
ra
)
{
if
(
ra
)
{
...
@@ -2456,6 +2469,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
...
@@ -2456,6 +2469,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
NR_RNTI_C
,
NR_RNTI_C
,
target_ss
,
target_ss
,
false
);
false
);
}
}
void
reset_srs_stats
(
NR_UE_info_t
*
UE
)
{
void
reset_srs_stats
(
NR_UE_info_t
*
UE
)
{
...
@@ -2553,6 +2567,34 @@ NR_UE_info_t *add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConf
...
@@ -2553,6 +2567,34 @@ NR_UE_info_t *add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConf
return
(
UE
);
return
(
UE
);
}
}
void
set_sched_pucch_list
(
NR_UE_sched_ctrl_t
*
sched_ctrl
,
NR_UE_UL_BWP_t
*
ul_bwp
,
NR_ServingCellConfigCommon_t
*
scc
)
{
const
NR_TDD_UL_DL_Pattern_t
*
tdd
=
scc
->
tdd_UL_DL_ConfigurationCommon
?
&
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
:
NULL
;
const
int
n_slots_frame
=
nr_slots_per_frame
[
ul_bwp
->
scs
];
const
int
nr_slots_period
=
tdd
?
n_slots_frame
/
get_nb_periods_per_frame
(
tdd
->
dl_UL_TransmissionPeriodicity
)
:
n_slots_frame
;
const
int
n_ul_slots_period
=
tdd
?
tdd
->
nrofUplinkSlots
+
(
tdd
->
nrofUplinkSymbols
>
0
?
1
:
0
)
:
n_slots_frame
;
const
int
list_size
=
n_ul_slots_period
<<
(
ul_bwp
->
max_fb_time
/
nr_slots_period
);
if
(
!
sched_ctrl
->
sched_pucch
)
{
sched_ctrl
->
sched_pucch
=
malloc
(
list_size
*
sizeof
(
*
sched_ctrl
->
sched_pucch
));
sched_ctrl
->
sched_pucch_size
=
list_size
;
for
(
int
i
=
0
;
i
<
list_size
;
i
++
)
{
NR_sched_pucch_t
*
curr_pucch
=
&
sched_ctrl
->
sched_pucch
[
i
];
memset
(
curr_pucch
,
0
,
sizeof
(
*
curr_pucch
));
}
}
else
if
(
list_size
>
sched_ctrl
->
sched_pucch_size
)
{
sched_ctrl
->
sched_pucch
=
realloc
(
sched_ctrl
->
sched_pucch
,
list_size
*
sizeof
(
*
sched_ctrl
->
sched_pucch
));
for
(
int
i
=
sched_ctrl
->
sched_pucch_size
;
i
<
list_size
;
i
++
){
NR_sched_pucch_t
*
curr_pucch
=
&
sched_ctrl
->
sched_pucch
[
i
];
memset
(
curr_pucch
,
0
,
sizeof
(
*
curr_pucch
));
}
sched_ctrl
->
sched_pucch_size
=
list_size
;
}
}
void
create_dl_harq_list
(
NR_UE_sched_ctrl_t
*
sched_ctrl
,
void
create_dl_harq_list
(
NR_UE_sched_ctrl_t
*
sched_ctrl
,
const
NR_PDSCH_ServingCellConfig_t
*
pdsch
)
{
const
NR_PDSCH_ServingCellConfig_t
*
pdsch
)
{
const
int
nrofHARQ
=
pdsch
&&
pdsch
->
nrofHARQ_ProcessesForPDSCH
?
const
int
nrofHARQ
=
pdsch
&&
pdsch
->
nrofHARQ_ProcessesForPDSCH
?
...
@@ -2672,23 +2714,17 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
...
@@ -2672,23 +2714,17 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
void
get_pdsch_to_harq_feedback
(
NR_PUCCH_Config_t
*
pucch_Config
,
void
get_pdsch_to_harq_feedback
(
NR_PUCCH_Config_t
*
pucch_Config
,
nr_dci_format_t
dci_format
,
nr_dci_format_t
dci_format
,
int
*
max_fb_time
,
uint8_t
*
pdsch_to_harq_feedback
)
{
uint8_t
*
pdsch_to_harq_feedback
)
{
if
(
dci_format
==
NR_DL_DCI_FORMAT_1_0
)
{
if
(
dci_format
==
NR_DL_DCI_FORMAT_1_0
)
{
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
for
(
int
i
=
0
;
i
<
8
;
i
++
)
pdsch_to_harq_feedback
[
i
]
=
i
+
1
;
pdsch_to_harq_feedback
[
i
]
=
i
+
1
;
if
(
pdsch_to_harq_feedback
[
i
]
>*
max_fb_time
)
*
max_fb_time
=
pdsch_to_harq_feedback
[
i
];
}
}
}
else
{
else
{
AssertFatal
(
pucch_Config
!=
NULL
,
"pucch_Config shouldn't be null here
\n
"
);
AssertFatal
(
pucch_Config
!=
NULL
,
"pucch_Config shouldn't be null here
\n
"
);
if
(
pucch_Config
->
dl_DataToUL_ACK
!=
NULL
)
{
if
(
pucch_Config
->
dl_DataToUL_ACK
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
pdsch_to_harq_feedback
[
i
]
=
*
pucch_Config
->
dl_DataToUL_ACK
->
list
.
array
[
i
];
pdsch_to_harq_feedback
[
i
]
=
*
pucch_Config
->
dl_DataToUL_ACK
->
list
.
array
[
i
];
if
(
pdsch_to_harq_feedback
[
i
]
>*
max_fb_time
)
*
max_fb_time
=
pdsch_to_harq_feedback
[
i
];
}
}
}
}
else
else
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
86cf5e70
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
86cf5e70
...
@@ -218,7 +218,6 @@ int nr_acknack_scheduling(int Mod_idP,
...
@@ -218,7 +218,6 @@ int nr_acknack_scheduling(int Mod_idP,
void
get_pdsch_to_harq_feedback
(
NR_PUCCH_Config_t
*
pucch_Config
,
void
get_pdsch_to_harq_feedback
(
NR_PUCCH_Config_t
*
pucch_Config
,
nr_dci_format_t
dci_format
,
nr_dci_format_t
dci_format
,
int
*
max_fb_time
,
uint8_t
*
pdsch_to_harq_feedback
);
uint8_t
*
pdsch_to_harq_feedback
);
void
nr_configure_css_dci_initial
(
nfapi_nr_dl_tti_pdcch_pdu_rel15_t
*
pdcch_pdu
,
void
nr_configure_css_dci_initial
(
nfapi_nr_dl_tti_pdcch_pdu_rel15_t
*
pdcch_pdu
,
...
@@ -466,6 +465,10 @@ uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx);
...
@@ -466,6 +465,10 @@ uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx);
uint8_t
get_dl_nrOfLayers
(
const
NR_UE_sched_ctrl_t
*
sched_ctrl
,
const
nr_dci_format_t
dci_format
);
uint8_t
get_dl_nrOfLayers
(
const
NR_UE_sched_ctrl_t
*
sched_ctrl
,
const
nr_dci_format_t
dci_format
);
void
set_sched_pucch_list
(
NR_UE_sched_ctrl_t
*
sched_ctrl
,
NR_UE_UL_BWP_t
*
ul_bwp
,
NR_ServingCellConfigCommon_t
*
scc
);
const
int
get_dl_tda
(
const
gNB_MAC_INST
*
nrmac
,
const
NR_ServingCellConfigCommon_t
*
scc
,
int
slot
);
const
int
get_dl_tda
(
const
gNB_MAC_INST
*
nrmac
,
const
NR_ServingCellConfigCommon_t
*
scc
,
int
slot
);
const
int
get_ul_tda
(
const
gNB_MAC_INST
*
nrmac
,
const
NR_ServingCellConfigCommon_t
*
scc
,
int
slot
);
const
int
get_ul_tda
(
const
gNB_MAC_INST
*
nrmac
,
const
NR_ServingCellConfigCommon_t
*
scc
,
int
slot
);
...
@@ -490,7 +493,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options,
...
@@ -490,7 +493,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options,
void
UL_tti_req_ahead_initialization
(
gNB_MAC_INST
*
gNB
,
NR_ServingCellConfigCommon_t
*
scc
,
int
n
,
int
CCid
);
void
UL_tti_req_ahead_initialization
(
gNB_MAC_INST
*
gNB
,
NR_ServingCellConfigCommon_t
*
scc
,
int
n
,
int
CCid
);
void
nr_sr_reporting
(
gNB_MAC_INST
*
nrmac
,
frame_t
frameP
,
sub_frame_t
slotP
);
void
nr_sr_reporting
(
gNB_MAC_INST
*
nrmac
,
frame_t
frameP
,
sub_frame_t
slotP
,
int
mod_id
);
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
size_t
strlen
,
bool
reset_rsrp
);
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
size_t
strlen
,
bool
reset_rsrp
);
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
86cf5e70
...
@@ -123,6 +123,7 @@ typedef struct NR_UE_UL_BWP {
...
@@ -123,6 +123,7 @@ typedef struct NR_UE_UL_BWP {
uint8_t
transform_precoding
;
uint8_t
transform_precoding
;
uint8_t
mcs_table
;
uint8_t
mcs_table
;
nr_dci_format_t
dci_format
;
nr_dci_format_t
dci_format
;
int
max_fb_time
;
}
NR_UE_UL_BWP_t
;
}
NR_UE_UL_BWP_t
;
typedef
enum
{
typedef
enum
{
...
@@ -354,6 +355,7 @@ typedef struct UE_info {
...
@@ -354,6 +355,7 @@ typedef struct UE_info {
}
NR_UE_mac_ce_ctrl_t
;
}
NR_UE_mac_ce_ctrl_t
;
typedef
struct
NR_sched_pucch
{
typedef
struct
NR_sched_pucch
{
bool
active
;
int
frame
;
int
frame
;
int
ul_slot
;
int
ul_slot
;
bool
sr_flag
;
bool
sr_flag
;
...
@@ -560,9 +562,11 @@ typedef struct {
...
@@ -560,9 +562,11 @@ typedef struct {
/// corresponding to the sched_pusch/sched_pdsch structures below
/// corresponding to the sched_pusch/sched_pdsch structures below
int
cce_index
;
int
cce_index
;
uint8_t
aggregation_level
;
uint8_t
aggregation_level
;
/// PUCCH scheduling information. Array of two: HARQ+SR in the first field,
/// PUCCH scheduling information. Array of two: HARQ+SR in the first field,
/// CSI in second. This order is important for nr_acknack_scheduling()!
/// CSI in second. This order is important for nr_acknack_scheduling()!
NR_sched_pucch_t
sched_pucch
[
2
];
NR_sched_pucch_t
*
sched_pucch
;
int
sched_pucch_size
;
/// Sched PUSCH: scheduling decisions, copied into HARQ and cleared every TTI
/// Sched PUSCH: scheduling decisions, copied into HARQ and cleared every TTI
NR_sched_pusch_t
sched_pusch
;
NR_sched_pusch_t
sched_pusch
;
...
...
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