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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
f0533b9e
Commit
f0533b9e
authored
Sep 07, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move TBS calculation out of nr_fill_nfapi_dl_pdu
parent
71bfadf1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
109 deletions
+124
-109
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+75
-25
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+31
-73
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+18
-11
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
f0533b9e
...
...
@@ -32,6 +32,7 @@
/*PHY*/
#include "PHY/CODING/coding_defs.h"
#include "PHY/defs_nr_common.h"
#include "common/utils/nr/nr_common.h"
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
/*MAC*/
#include "NR_MAC_COMMON/nr_mac.h"
...
...
@@ -452,19 +453,68 @@ void nr_schedule_ue_spec(module_id_t module_id,
const
uint8_t
numDmrsCdmGrpsNoData
=
1
;
const
nfapi_nr_dmrs_type_e
dmrsConfigType
=
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NULL
?
0
:
1
;
const
int
TBS_bytes
=
nr_fill_nfapi_dl_pdu
(
module_id
,
UE_id
,
bwp_id
,
dl_req
,
pucch
,
nrOfLayers
,
mcs
,
bwpSize
,
0
/* bwpStart */
,
numDmrsCdmGrpsNoData
,
dmrsConfigType
);
if
(
TBS_bytes
==
0
)
const
int
time_domain_assignment
=
2
;
AssertFatal
(
time_domain_assignment
<
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
count
,
"time_domain_assignment %d>=%d
\n
"
,
time_domain_assignment
,
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
count
);
const
int
startSymbolAndLength
=
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
array
[
time_domain_assignment
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
const
uint16_t
N_PRB_oh
=
0
;
// overhead should be 0 for initialBWP
uint8_t
N_PRB_DMRS
;
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
N_PRB_DMRS
=
numDmrsCdmGrpsNoData
*
6
;
}
else
{
N_PRB_DMRS
=
numDmrsCdmGrpsNoData
*
4
;
}
const
uint8_t
N_sh_symb
=
nrOfSymbols
;
const
uint16_t
rbSize
=
bwpSize
;
const
uint8_t
table_idx
=
0
;
const
uint16_t
R
=
nr_get_code_rate_dl
(
mcs
,
table_idx
);
const
uint8_t
Qm
=
nr_get_Qm_dl
(
mcs
,
table_idx
);
const
uint32_t
TBS
=
nr_compute_tbs
(
Qm
,
R
,
rbSize
,
N_sh_symb
,
N_PRB_DMRS
,
// FIXME // This should be multiplied by the
// number of dmrs symbols
N_PRB_oh
,
0
/* tb_scaling */
,
nrOfLayers
)
>>
3
;
LOG_D
(
MAC
,
"TBS %d bytes: N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d R %d Qm %d table %d"
,
TBS
,
N_PRB_DMRS
,
N_sh_symb
,
N_PRB_oh
,
R
,
Qm
,
table_idx
);
nr_fill_nfapi_dl_pdu
(
module_id
,
UE_id
,
bwp_id
,
dl_req
,
pucch
,
nrOfLayers
,
mcs
,
rbSize
,
0
/* bwpStart */
,
numDmrsCdmGrpsNoData
,
dmrsConfigType
,
table_idx
,
R
,
Qm
,
TBS
,
time_domain_assignment
,
startSymbolIndex
,
nrOfSymbols
);
if
(
TBS
==
0
)
return
;
const
int
lcid
=
DL_SCH_LCID_DTCH
;
...
...
@@ -473,7 +523,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
int
sdu_length_total
=
0
;
int
num_sdus
=
0
;
LOG_D
(
MAC
,
"[gNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (TBS %d bytes, len %d)
\n
"
,
module_id
,
frame
,
lcid
,
TBS
_bytes
,
TBS_bytes
-
ta_len
-
header_length_total
-
sdu_length_total
-
3
);
module_id
,
frame
,
lcid
,
TBS
,
TBS
-
ta_len
-
header_length_total
-
sdu_length_total
-
3
);
const
mac_rlc_status_resp_t
rlc_status
=
mac_rlc_status_ind
(
module_id
,
rnti
,
...
...
@@ -490,9 +540,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
LOG_I
(
MAC
,
"configure fapi due to data availability
\n
"
);
LOG_I
(
MAC
,
"[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d), TBS
_bytes
: %d
\n
\n
"
,
module_id
,
frame
,
TBS
_bytes
-
ta_len
-
header_length_total
-
sdu_length_total
-
3
,
lcid
,
header_length_total
,
TBS
_bytes
);
LOG_I
(
MAC
,
"[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d), TBS: %d
\n
\n
"
,
module_id
,
frame
,
TBS
-
ta_len
-
header_length_total
-
sdu_length_total
-
3
,
lcid
,
header_length_total
,
TBS
);
sdu_lengths
[
num_sdus
]
=
mac_rlc_data_req
(
module_id
,
rnti
,
...
...
@@ -501,7 +551,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
ENB_FLAG_YES
,
MBMS_FLAG_NO
,
lcid
,
TBS
_bytes
-
ta_len
-
header_length_total
-
sdu_length_total
-
3
,
TBS
-
ta_len
-
header_length_total
-
sdu_length_total
-
3
,
(
char
*
)
&
mac_sdus
[
sdu_length_total
],
0
,
0
);
...
...
@@ -520,10 +570,10 @@ void nr_schedule_ue_spec(module_id_t module_id,
else
{
LOG_I
(
MAC
,
"Configuring DL_TX in %d.%d: random data
\n
"
,
frame
,
slot
);
// fill dlsch_buffer with random data
for
(
int
i
=
0
;
i
<
TBS
_bytes
;
i
++
)
for
(
int
i
=
0
;
i
<
TBS
;
i
++
)
mac_sdus
[
i
]
=
(
unsigned
char
)
(
lrand48
()
&
0xff
);
sdu_lcids
[
0
]
=
0x3f
;
// DRB
sdu_lengths
[
0
]
=
TBS
_bytes
-
ta_len
-
3
;
sdu_lengths
[
0
]
=
TBS
-
ta_len
-
3
;
header_length_total
+=
2
+
(
sdu_lengths
[
0
]
>=
128
);
sdu_length_total
+=
sdu_lengths
[
0
];
num_sdus
+=
1
;
...
...
@@ -537,9 +587,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
}
// Check if there is data from RLC or CE
const
int
post_padding
=
TBS
_bytes
>=
2
+
header_length_total
+
sdu_length_total
+
ta_len
;
const
int
post_padding
=
TBS
>=
2
+
header_length_total
+
sdu_length_total
+
ta_len
;
// padding param currently not in use
//padding = TBS
_bytes
- header_length_total - sdu_length_total - ta_len - 1;
//padding = TBS - header_length_total - sdu_length_total - ta_len - 1;
const
int
offset
=
nr_generate_dlsch_pdu
(
module_id
,
...
...
@@ -554,7 +604,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
// Padding: fill remainder of DLSCH with 0
if
(
post_padding
>
0
)
{
for
(
int
j
=
0
;
j
<
TBS
_bytes
-
offset
;
j
++
)
for
(
int
j
=
0
;
j
<
TBS
-
offset
;
j
++
)
gNB_mac
->
UE_list
.
DLSCH_pdu
[
0
][
0
].
payload
[
0
][
offset
+
j
]
=
0
;
}
...
...
@@ -563,7 +613,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
slot
,
dl_req
,
tx_req
,
TBS
_bytes
,
TBS
,
gNB_mac
->
pdu_index
[
CC_id
]);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
...
...
@@ -572,7 +622,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
"%d.%d, first 10 payload bytes, TBS size: %d
\n
"
,
frame
,
slot
,
TBS
_bytes
);
TBS
);
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
LOG_I
(
MAC
,
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
gNB_mac
->
UE_list
.
DLSCH_pdu
[
0
][
0
].
payload
[
0
])[
i
]);
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
f0533b9e
...
...
@@ -407,17 +407,24 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
}
int
nr_fill_nfapi_dl_pdu
(
int
Mod_idP
,
int
UE_id
,
int
bwp_id
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
,
NR_sched_pucch
*
pucch_sched
,
int
nrOfLayers
,
uint8_t
mcs
,
uint16_t
rbSize
,
uint16_t
rbStart
,
uint8_t
numDmrsCdmGrpsNoData
,
nfapi_nr_dmrs_type_e
dmrsConfigType
)
{
void
nr_fill_nfapi_dl_pdu
(
int
Mod_idP
,
int
UE_id
,
int
bwp_id
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
,
NR_sched_pucch
*
pucch_sched
,
int
nrOfLayers
,
uint8_t
mcs
,
uint16_t
rbSize
,
uint16_t
rbStart
,
uint8_t
numDmrsCdmGrpsNoData
,
nfapi_nr_dmrs_type_e
dmrsConfigType
,
uint8_t
table_idx
,
uint16_t
R
,
uint8_t
Qm
,
uint32_t
TBS
,
int
time_domain_assignment
,
int
StartSymbolIndex
,
int
NrOfSymbols
)
{
gNB_MAC_INST
*
nr_mac
=
RC
.
nrmac
[
Mod_idP
];
NR_COMMON_channels_t
*
cc
=
nr_mac
->
common_channels
;
NR_ServingCellConfigCommon_t
*
scc
=
cc
->
ServingCellConfigCommon
;
...
...
@@ -485,14 +492,10 @@ int nr_fill_nfapi_dl_pdu(int Mod_idP,
pdsch_pdu_rel15
->
rbStart
=
rbStart
;
pdsch_pdu_rel15
->
rbSize
=
rbSize
;
pdsch_pdu_rel15
->
VRBtoPRBMapping
=
1
;
// non-interleaved, check if this is ok for initialBWP
int
startSymbolAndLength
=
0
;
int
time_domain_assignment
=
2
;
int
StartSymbolIndex
,
NrOfSymbols
;
AssertFatal
(
time_domain_assignment
<
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
count
,
"time_domain_assignment %d>=%d
\n
"
,
time_domain_assignment
,
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
count
);
startSymbolAndLength
=
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
array
[
time_domain_assignment
]
->
startSymbolAndLength
;
SLIV2SL
(
startSymbolAndLength
,
&
StartSymbolIndex
,
&
NrOfSymbols
);
pdsch_pdu_rel15
->
targetCodeRate
[
0
]
=
R
;
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
Qm
;
pdsch_pdu_rel15
->
TBSize
[
0
]
=
TBS
;
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
table_idx
;
pdsch_pdu_rel15
->
StartSymbolIndex
=
StartSymbolIndex
;
pdsch_pdu_rel15
->
NrOfSymbols
=
NrOfSymbols
;
...
...
@@ -613,76 +616,31 @@ int nr_fill_nfapi_dl_pdu(int Mod_idP,
pdcch_pdu_rel15
->
StartSymbolIndex
,
pdcch_pdu_rel15
->
DurationSymbols
);
const
uint16_t
N_PRB_oh
=
0
;
// overhead should be 0 for initialBWP
uint8_t
N_PRB_DMRS
;
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
N_PRB_DMRS
=
numDmrsCdmGrpsNoData
*
6
;
}
else
{
N_PRB_DMRS
=
numDmrsCdmGrpsNoData
*
4
;
}
const
uint8_t
N_sh_symb
=
NrOfSymbols
;
const
uint8_t
table_idx
=
0
;
const
uint16_t
R
=
nr_get_code_rate_dl
(
mcs
,
table_idx
);
const
uint8_t
Qm
=
nr_get_Qm_dl
(
mcs
,
table_idx
);
const
uint32_t
TBS
=
nr_compute_tbs
(
Qm
,
R
,
rbSize
,
N_sh_symb
,
N_PRB_DMRS
,
// FIXME // This should be multiplied by the
// number of dmrs symbols
N_PRB_oh
,
0
/* tb_scaling */
,
nrOfLayers
)
>>
3
;
pdsch_pdu_rel15
->
targetCodeRate
[
0
]
=
R
;
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
Qm
;
pdsch_pdu_rel15
->
TBSize
[
0
]
=
TBS
;
// I don't know why the following is not needed, but in this case we don't
// need additional calculations:
const
uint16_t
N_RE_prime
=
NR_NB_SC_PER_RB
*
N_sh_symb
-
N_PRB_DMRS
-
N_PRB_oh
;
LOG_D
(
MAC
,
"N_RE_prime %d for %d symbols %d DMRS per PRB and %d overhead
\n
"
,
N_RE_prime
,
N_sh_symb
,
N_PRB_DMRS
,
N_PRB_oh
);
//
const uint16_t N_RE_prime = NR_NB_SC_PER_RB * N_sh_symb - N_PRB_DMRS - N_PRB_oh;
//
LOG_D(MAC,
//
"N_RE_prime %d for %d symbols %d DMRS per PRB and %d overhead\n",
//
N_RE_prime,
//
N_sh_symb,
//
N_PRB_DMRS,
//
N_PRB_oh);
//pdsch_pdu_rel15->nb_mod_symbols = N_RE_prime*pdsch_pdu_rel15->n_prb*pdsch_pdu_rel15->nb_codewords;
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
table_idx
;
LOG_D
(
MAC
,
"TBS %d bytes: N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d R %d Qm %d table "
"%d nb_symbols %d
\n
"
,
TBS
,
N_PRB_DMRS
,
N_sh_symb
,
N_PRB_oh
,
R
,
Qm
,
table_idx
,
N_RE_prime
*
pdsch_pdu_rel15
->
rbSize
*
pdsch_pdu_rel15
->
NrOfCodewords
);
if
(
UE_list
->
UE_sched_ctrl
[
UE_id
].
harq_processes
[
current_harq_pid
].
round
==
0
)
UE_list
->
mac_stats
[
UE_id
].
dlsch_total_bytes
+=
TBS
;
LOG_D
(
MAC
,
"DLSCH PDU: start PRB %d n_PRB %d start
SymbolAndLength %d start symbol
"
"
%d nb_symbols %d
nb_layers %d nb_codewords %d mcs %d TBS: %d
\n
"
,
"DLSCH PDU: start PRB %d n_PRB %d start
symbol %d nb_symbols %d
"
"nb_layers %d nb_codewords %d mcs %d TBS: %d
\n
"
,
pdsch_pdu_rel15
->
rbStart
,
pdsch_pdu_rel15
->
rbSize
,
startSymbolAndLength
,
pdsch_pdu_rel15
->
StartSymbolIndex
,
pdsch_pdu_rel15
->
NrOfSymbols
,
pdsch_pdu_rel15
->
nrOfLayers
,
pdsch_pdu_rel15
->
NrOfCodewords
,
pdsch_pdu_rel15
->
mcsIndex
[
0
],
TBS
);
return
TBS
;
//Return TBS in bytes
}
int
nr_configure_pdcch
(
gNB_MAC_INST
*
nr_mac
,
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
f0533b9e
...
...
@@ -129,17 +129,24 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
frame_t
frameP
,
sub_frame_t
subframeP
);
int
nr_fill_nfapi_dl_pdu
(
int
Mod_id
,
int
UE_id
,
int
bwp_id
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
,
NR_sched_pucch
*
pucch_sched
,
int
nrOfLayers
,
uint8_t
mcs
,
uint16_t
rbSize
,
uint16_t
rbStart
,
uint8_t
numDmrsCdmGrpsNoData
,
nfapi_nr_dmrs_type_e
dmrsConfigType
);
void
nr_fill_nfapi_dl_pdu
(
int
Mod_id
,
int
UE_id
,
int
bwp_id
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
,
NR_sched_pucch
*
pucch_sched
,
int
nrOfLayers
,
uint8_t
mcs
,
uint16_t
rbSize
,
uint16_t
rbStart
,
uint8_t
numDmrsCdmGrpsNoData
,
nfapi_nr_dmrs_type_e
dmrsConfigType
,
uint8_t
table_idx
,
uint16_t
R
,
uint8_t
Qm
,
uint32_t
tbs
,
int
time_domain_assignment
,
int
StartSymbolIndex
,
int
NrOfSymbols
);
int
configure_fapi_dl_pdu_phytest
(
int
Mod_id
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
,
...
...
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