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
85a93882
Commit
85a93882
authored
Jan 12, 2021
by
ChiehChun
Committed by
Robert Schmidt
Mar 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check DL resource first for retransmission
parent
7b42a4ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+33
-28
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
85a93882
...
@@ -371,14 +371,16 @@ bool allocate_retransmission(module_id_t module_id,
...
@@ -371,14 +371,16 @@ bool allocate_retransmission(module_id_t module_id,
uint8_t
*
rballoc_mask
,
uint8_t
*
rballoc_mask
,
int
*
n_rb_sched
,
int
*
n_rb_sched
,
int
UE_id
,
int
UE_id
,
int
current_harq_pid
){
int
current_harq_pid
)
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
RC
.
nrmac
[
module_id
]
->
UE_info
.
UE_sched_ctrl
[
UE_id
];
NR_UE_info_t
*
UE_info
=
&
RC
.
nrmac
[
module_id
]
->
UE_info
;
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
NR_UE_ret_info_t
*
retInfo
=
&
sched_ctrl
->
retInfo
[
current_harq_pid
];
NR_UE_ret_info_t
*
retInfo
=
&
sched_ctrl
->
retInfo
[
current_harq_pid
];
const
uint16_t
bwpSize
=
NRRIV2BW
(
sched_ctrl
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
const
uint16_t
bwpSize
=
NRRIV2BW
(
sched_ctrl
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
int
rbStart
=
NRRIV2PRBOFFSET
(
sched_ctrl
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
int
rbStart
=
NRRIV2PRBOFFSET
(
sched_ctrl
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
sched_ctrl
->
time_domain_allocation
=
retInfo
->
time_domain_allocation
;
sched_ctrl
->
time_domain_allocation
=
retInfo
->
time_domain_allocation
;
/* Check the resource is enough for retransmission */
/* ensure that there is a free place for RB allocation */
/* ensure that there is a free place for RB allocation */
int
rbSize
=
0
;
int
rbSize
=
0
;
while
(
rbSize
<
retInfo
->
rbSize
)
{
while
(
rbSize
<
retInfo
->
rbSize
)
{
...
@@ -389,7 +391,7 @@ bool allocate_retransmission(module_id_t module_id,
...
@@ -389,7 +391,7 @@ bool allocate_retransmission(module_id_t module_id,
LOG_D
(
MAC
,
LOG_D
(
MAC
,
"cannot allocate retransmission for UE %d/RNTI %04x: no resources
\n
"
,
"cannot allocate retransmission for UE %d/RNTI %04x: no resources
\n
"
,
UE_id
,
UE_id
,
RC
.
nrmac
[
module_id
]
->
UE_info
.
rnti
[
UE_id
]);
UE_info
->
rnti
[
UE_id
]);
return
false
;
return
false
;
}
}
while
(
rbStart
+
rbSize
<
bwpSize
while
(
rbStart
+
rbSize
<
bwpSize
...
@@ -397,6 +399,34 @@ bool allocate_retransmission(module_id_t module_id,
...
@@ -397,6 +399,34 @@ bool allocate_retransmission(module_id_t module_id,
&&
rbSize
<
retInfo
->
rbSize
)
&&
rbSize
<
retInfo
->
rbSize
)
rbSize
++
;
rbSize
++
;
}
}
/* Find a free CCE */
bool
freeCCE
=
find_free_CCE
(
module_id
,
slot
,
UE_id
);
if
(
!
freeCCE
)
{
LOG_D
(
MAC
,
"%4d.%2d could not find CCE for DL DCI retransmission UE %d/RNTI %04x
\n
"
,
frame
,
slot
,
UE_id
,
UE_info
->
rnti
[
UE_id
]);
return
false
;
}
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
* allocation after CCE alloc fail would be more complex) */
const
bool
alloc
=
nr_acknack_scheduling
(
module_id
,
UE_id
,
frame
,
slot
);
if
(
!
alloc
)
{
LOG_W
(
MAC
,
"%s(): could not find PUCCH for UE %d/%04x@%d.%d
\n
"
,
__func__
,
UE_id
,
UE_info
->
rnti
[
UE_id
],
frame
,
slot
);
int
cid
=
sched_ctrl
->
coreset
->
controlResourceSetId
;
UE_info
->
num_pdcch_cand
[
UE_id
][
cid
]
--
;
int
*
cce_list
=
RC
.
nrmac
[
module_id
]
->
cce_list
[
sched_ctrl
->
active_bwp
->
bwp_Id
][
cid
];
for
(
int
i
=
0
;
i
<
sched_ctrl
->
aggregation_level
;
i
++
)
cce_list
[
sched_ctrl
->
cce_index
+
i
]
=
0
;
return
false
;
}
/* Allocate retransmission */
sched_ctrl
->
rbSize
=
retInfo
->
rbSize
;
sched_ctrl
->
rbSize
=
retInfo
->
rbSize
;
sched_ctrl
->
rbStart
=
rbStart
;
sched_ctrl
->
rbStart
=
rbStart
;
...
@@ -435,7 +465,6 @@ void pf_dl(module_id_t module_id,
...
@@ -435,7 +465,6 @@ void pf_dl(module_id_t module_id,
sched_ctrl
->
coreset
=
get_coreset
(
sched_ctrl
->
active_bwp
,
sched_ctrl
->
search_space
,
1
/* dedicated */
);
sched_ctrl
->
coreset
=
get_coreset
(
sched_ctrl
->
active_bwp
,
sched_ctrl
->
search_space
,
1
/* dedicated */
);
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
sched_ctrl
->
dl_harq_pid
=
sched_ctrl
->
retrans_dl_harq
.
head
;
sched_ctrl
->
dl_harq_pid
=
sched_ctrl
->
retrans_dl_harq
.
head
;
const
rnti_t
rnti
=
UE_info
->
rnti
[
UE_id
];
/* Calculate Throughput */
/* Calculate Throughput */
const
float
a
=
0
.
0005
f
;
// corresponds to 200ms window
const
float
a
=
0
.
0005
f
;
// corresponds to 200ms window
...
@@ -444,30 +473,6 @@ void pf_dl(module_id_t module_id,
...
@@ -444,30 +473,6 @@ void pf_dl(module_id_t module_id,
/* retransmission */
/* retransmission */
if
(
sched_ctrl
->
dl_harq_pid
>=
0
)
{
if
(
sched_ctrl
->
dl_harq_pid
>=
0
)
{
/* Find a free CCE */
bool
freeCCE
=
find_free_CCE
(
module_id
,
slot
,
UE_id
);
if
(
!
freeCCE
){
LOG_D
(
MAC
,
"%4d.%2d could not find CCE for DL DCI retransmission UE %d/RNTI %04x
\n
"
,
frame
,
slot
,
UE_id
,
rnti
);
continue
;
}
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
* allocation after CCE alloc fail would be more complex) */
const
bool
alloc
=
nr_acknack_scheduling
(
module_id
,
UE_id
,
frame
,
slot
);
if
(
!
alloc
)
{
LOG_W
(
MAC
,
"%s(): could not find PUCCH for UE %d/%04x@%d.%d
\n
"
,
__func__
,
UE_id
,
rnti
,
frame
,
slot
);
int
cid
=
sched_ctrl
->
coreset
->
controlResourceSetId
;
UE_info
->
num_pdcch_cand
[
UE_id
][
cid
]
--
;
int
*
cce_list
=
RC
.
nrmac
[
module_id
]
->
cce_list
[
sched_ctrl
->
active_bwp
->
bwp_Id
][
cid
];
for
(
int
i
=
0
;
i
<
sched_ctrl
->
aggregation_level
;
i
++
)
cce_list
[
sched_ctrl
->
cce_index
+
i
]
=
0
;
return
;
}
/* Allocate retransmission */
/* Allocate retransmission */
bool
r
=
allocate_retransmission
(
module_id
,
bool
r
=
allocate_retransmission
(
module_id
,
frame
,
frame
,
...
...
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