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
77153fbf
Commit
77153fbf
authored
Feb 17, 2022
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TBSLBRM for DL computed ad MAC (added fapi parameter)
parent
af6836d9
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
106 additions
and
59 deletions
+106
-59
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+1
-1
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+5
-0
openair1/PHY/CODING/coding_defs.h
openair1/PHY/CODING/coding_defs.h
+0
-4
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+1
-6
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+1
-5
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+1
-6
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+1
-0
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+2
-6
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+0
-1
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+1
-0
openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c
openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c
+23
-28
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
+22
-0
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
+7
-0
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+15
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+10
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+4
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+12
-2
No files found.
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
View file @
77153fbf
...
@@ -464,7 +464,7 @@ typedef struct {
...
@@ -464,7 +464,7 @@ typedef struct {
uint8_t
nEpreRatioOfPDSCHToPTRS
;
uint8_t
nEpreRatioOfPDSCHToPTRS
;
/// MCS table for this DLSCH
/// MCS table for this DLSCH
uint8_t
mcs_table
;
uint8_t
mcs_table
;
uint32_t
tbslbrm
;
uint16_t
pduBitmap
;
uint16_t
pduBitmap
;
}
fapi_nr_dl_config_dlsch_pdu_rel15_t
;
}
fapi_nr_dl_config_dlsch_pdu_rel15_t
;
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
77153fbf
...
@@ -776,6 +776,10 @@ typedef struct {
...
@@ -776,6 +776,10 @@ typedef struct {
nfapi_nr_dl_dci_pdu_t
dci_pdu
[
MAX_DCI_CORESET
];
nfapi_nr_dl_dci_pdu_t
dci_pdu
[
MAX_DCI_CORESET
];
}
nfapi_nr_dl_tti_pdcch_pdu_rel15_t
;
}
nfapi_nr_dl_tti_pdcch_pdu_rel15_t
;
typedef
struct
{
uint32_t
tbSizeLbrmBytes
;
}
nfapi_v3_pdsch_maintenance_parameters_t
;
typedef
struct
{
typedef
struct
{
uint16_t
pduBitmap
;
uint16_t
pduBitmap
;
uint16_t
rnti
;
uint16_t
rnti
;
...
@@ -854,6 +858,7 @@ typedef struct {
...
@@ -854,6 +858,7 @@ typedef struct {
uint8_t
nEpreRatioOfPDSCHToPTRS
;
uint8_t
nEpreRatioOfPDSCHToPTRS
;
// Beamforming
// Beamforming
nfapi_nr_tx_precoding_and_beamforming_t
precodingAndBeamforming
;
nfapi_nr_tx_precoding_and_beamforming_t
precodingAndBeamforming
;
nfapi_v3_pdsch_maintenance_parameters_t
maintenance_parms_v3
;
}
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
;
}
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
;
...
...
openair1/PHY/CODING/coding_defs.h
View file @
77153fbf
...
@@ -481,10 +481,6 @@ uint32_t nr_compute_tbs(uint16_t Qm,
...
@@ -481,10 +481,6 @@ uint32_t nr_compute_tbs(uint16_t Qm,
uint8_t
tb_scaling
,
uint8_t
tb_scaling
,
uint8_t
Nl
);
uint8_t
Nl
);
uint32_t
nr_compute_tbslbrm
(
uint16_t
table
,
uint16_t
nb_rb
,
uint8_t
Nl
);
void
nr_interleaving_ldpc
(
uint32_t
E
,
uint8_t
Qm
,
uint8_t
*
e
,
uint8_t
*
f
);
void
nr_interleaving_ldpc
(
uint32_t
E
,
uint8_t
Qm
,
uint8_t
*
e
,
uint8_t
*
f
);
void
nr_deinterleaving_ldpc
(
uint32_t
E
,
uint8_t
Qm
,
int16_t
*
e
,
int16_t
*
f
);
void
nr_deinterleaving_ldpc
(
uint32_t
E
,
uint8_t
Qm
,
int16_t
*
e
,
int16_t
*
f
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
77153fbf
...
@@ -229,13 +229,8 @@ void ldpc8blocks( void *p) {
...
@@ -229,13 +229,8 @@ void ldpc8blocks( void *p) {
impp
->
F
,
impp
->
F
,
Kr
-
impp
->
F
-
2
*
(
*
impp
->
Zc
),
Kr
-
impp
->
F
-
2
*
(
*
impp
->
Zc
),
mod_order
,
nb_rb
);
mod_order
,
nb_rb
);
// for tbslbrm calculation according to 5.4.2.1 of 38.212
uint8_t
Nl
=
4
;
if
(
rel15
->
nrOfLayers
<
Nl
)
uint32_t
Tbslbrm
=
rel15
->
maintenance_parms_v3
.
tbSizeLbrmBytes
;
Nl
=
rel15
->
nrOfLayers
;
uint32_t
Tbslbrm
=
nr_compute_tbslbrm
(
rel15
->
mcsTable
[
0
],
nb_rb
,
Nl
);
uint8_t
Ilbrm
=
1
;
uint8_t
Ilbrm
=
1
;
uint8_t
e
[
E
];
uint8_t
e
[
E
];
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
77153fbf
...
@@ -259,7 +259,6 @@ void nr_processULSegment(void* arg) {
...
@@ -259,7 +259,6 @@ void nr_processULSegment(void* arg) {
int
rv_index
=
rdata
->
rv_index
;
int
rv_index
=
rdata
->
rv_index
;
int
r_offset
=
rdata
->
r_offset
;
int
r_offset
=
rdata
->
r_offset
;
uint8_t
kc
=
rdata
->
Kc
;
uint8_t
kc
=
rdata
->
Kc
;
uint32_t
Tbslbrm
=
rdata
->
Tbslbrm
;
short
*
ulsch_llr
=
rdata
->
ulsch_llr
;
short
*
ulsch_llr
=
rdata
->
ulsch_llr
;
int
max_ldpc_iterations
=
p_decoderParms
->
numMaxIter
;
int
max_ldpc_iterations
=
p_decoderParms
->
numMaxIter
;
int8_t
llrProcBuf
[
OAI_UL_LDPC_MAX_NUM_LLR
]
__attribute__
((
aligned
(
32
)));
int8_t
llrProcBuf
[
OAI_UL_LDPC_MAX_NUM_LLR
]
__attribute__
((
aligned
(
32
)));
...
@@ -319,7 +318,7 @@ void nr_processULSegment(void* arg) {
...
@@ -319,7 +318,7 @@ void nr_processULSegment(void* arg) {
//start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
//start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
if
(
nr_rate_matching_ldpc_rx
(
Ilbrm
,
if
(
nr_rate_matching_ldpc_rx
(
Ilbrm
,
Tbslbrm
,
0
,
p_decoderParms
->
BG
,
p_decoderParms
->
BG
,
p_decoderParms
->
Z
,
p_decoderParms
->
Z
,
ulsch_harq
->
d
[
r
],
ulsch_harq
->
d
[
r
],
...
@@ -420,7 +419,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
...
@@ -420,7 +419,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
uint32_t
r_offset
;
uint32_t
r_offset
;
uint32_t
offset
;
uint32_t
offset
;
int
kc
;
int
kc
;
int
Tbslbrm
;
int
E
;
int
E
;
#ifdef PRINT_CRC_CHECK
#ifdef PRINT_CRC_CHECK
...
@@ -559,7 +557,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
...
@@ -559,7 +557,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
if
(
!
frame
%
100
)
if
(
!
frame
%
100
)
printf
(
"K %d C %d Z %d
\n
"
,
harq_process
->
K
,
harq_process
->
C
,
harq_process
->
Z
);
printf
(
"K %d C %d Z %d
\n
"
,
harq_process
->
K
,
harq_process
->
C
,
harq_process
->
Z
);
#endif
#endif
Tbslbrm
=
nr_compute_tbslbrm
(
0
,
nb_rb
,
n_layers
);
p_decParams
->
Z
=
harq_process
->
Z
;
p_decParams
->
Z
=
harq_process
->
Z
;
...
@@ -610,7 +607,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
...
@@ -610,7 +607,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
rdata
->
r_offset
=
r_offset
;
rdata
->
r_offset
=
r_offset
;
rdata
->
Kr_bytes
=
Kr_bytes
;
rdata
->
Kr_bytes
=
Kr_bytes
;
rdata
->
rv_index
=
pusch_pdu
->
pusch_data
.
rv_index
;
rdata
->
rv_index
=
pusch_pdu
->
pusch_data
.
rv_index
;
rdata
->
Tbslbrm
=
Tbslbrm
;
rdata
->
offset
=
offset
;
rdata
->
offset
=
offset
;
rdata
->
ulsch
=
ulsch
;
rdata
->
ulsch
=
ulsch
;
rdata
->
ulsch_id
=
ULSCH_id
;
rdata
->
ulsch_id
=
ULSCH_id
;
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
77153fbf
...
@@ -472,7 +472,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
...
@@ -472,7 +472,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
phy_vars_ue
->
dl_stats
[
harq_process
->
round
]
++
;
phy_vars_ue
->
dl_stats
[
harq_process
->
round
]
++
;
LOG_D
(
PHY
,
"Round %d RV idx %d
\n
"
,
harq_process
->
round
,
harq_process
->
rvidx
);
LOG_D
(
PHY
,
"Round %d RV idx %d
\n
"
,
harq_process
->
round
,
harq_process
->
rvidx
);
uint8_t
kc
;
uint8_t
kc
;
uint32_t
Tbslbrm
;
// = 950984;
uint16_t
nb_rb
;
// = 30;
uint16_t
nb_rb
;
// = 30;
double
Coderate
;
// = 0.0;
double
Coderate
;
// = 0.0;
uint8_t
dmrs_Type
=
harq_process
->
dmrsConfigType
;
uint8_t
dmrs_Type
=
harq_process
->
dmrsConfigType
;
...
@@ -583,10 +582,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
...
@@ -583,10 +582,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
if
(
LOG_DEBUGFLAG
(
DEBUG_DLSCH_DECOD
)
&&
(
!
frame
%
100
))
if
(
LOG_DEBUGFLAG
(
DEBUG_DLSCH_DECOD
)
&&
(
!
frame
%
100
))
LOG_I
(
PHY
,
"K %d C %d Z %d nl %d
\n
"
,
harq_process
->
K
,
harq_process
->
C
,
p_decParams
->
Z
,
harq_process
->
Nl
);
LOG_I
(
PHY
,
"K %d C %d Z %d nl %d
\n
"
,
harq_process
->
K
,
harq_process
->
C
,
p_decParams
->
Z
,
harq_process
->
Nl
);
}
}
if
((
harq_process
->
Nl
)
<
4
)
Tbslbrm
=
nr_compute_tbslbrm
(
harq_process
->
mcs_table
,
nb_rb
,
harq_process
->
Nl
);
else
Tbslbrm
=
nr_compute_tbslbrm
(
harq_process
->
mcs_table
,
nb_rb
,
4
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION
,
VCD_FUNCTION_OUT
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION
,
VCD_FUNCTION_OUT
);
p_decParams
->
Z
=
harq_process
->
Z
;
p_decParams
->
Z
=
harq_process
->
Z
;
...
@@ -637,7 +632,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
...
@@ -637,7 +632,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
rdata
->
r_offset
=
r_offset
;
rdata
->
r_offset
=
r_offset
;
rdata
->
Kr_bytes
=
Kr_bytes
;
rdata
->
Kr_bytes
=
Kr_bytes
;
rdata
->
rv_index
=
harq_process
->
rvidx
;
rdata
->
rv_index
=
harq_process
->
rvidx
;
rdata
->
Tbslbrm
=
T
bslbrm
;
rdata
->
Tbslbrm
=
harq_process
->
t
bslbrm
;
rdata
->
offset
=
offset
;
rdata
->
offset
=
offset
;
rdata
->
dlsch
=
dlsch
;
rdata
->
dlsch
=
dlsch
;
rdata
->
dlsch_id
=
0
;
rdata
->
dlsch_id
=
0
;
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
View file @
77153fbf
...
@@ -303,6 +303,7 @@ typedef struct {
...
@@ -303,6 +303,7 @@ typedef struct {
uint16_t
ptrs_symbols
;
uint16_t
ptrs_symbols
;
// PTRS symbol index, to be updated every PTRS symbol within a slot.
// PTRS symbol index, to be updated every PTRS symbol within a slot.
uint8_t
ptrs_symbol_index
;
uint8_t
ptrs_symbol_index
;
uint32_t
tbslbrm
;
/// PDU BITMAP
/// PDU BITMAP
uint16_t
pduBitmap
;
uint16_t
pduBitmap
;
}
NR_DL_UE_HARQ_t
;
}
NR_DL_UE_HARQ_t
;
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
View file @
77153fbf
...
@@ -233,8 +233,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
...
@@ -233,8 +233,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
uint16_t
Kr
,
r
;
uint16_t
Kr
,
r
;
uint32_t
r_offset
;
uint32_t
r_offset
;
uint32_t
E
,
Kb
;
uint32_t
E
,
Kb
;
uint8_t
Ilbrm
;
uint8_t
Ilbrm
;
uint32_t
Tbslbrm
;
uint16_t
R
;
uint16_t
R
;
float
Coderate
;
float
Coderate
;
...
@@ -256,7 +255,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
...
@@ -256,7 +255,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
r_offset
=
0
;
r_offset
=
0
;
F
=
0
;
F
=
0
;
Ilbrm
=
0
;
Ilbrm
=
0
;
Tbslbrm
=
950984
;
//max tbs
Coderate
=
0
.
0
;
Coderate
=
0
.
0
;
///////////
///////////
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
...
@@ -440,12 +438,10 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
...
@@ -440,12 +438,10 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
E
=
nr_get_E
(
G
,
harq_process
->
C
,
mod_order
,
harq_process
->
pusch_pdu
.
nrOfLayers
,
r
);
E
=
nr_get_E
(
G
,
harq_process
->
C
,
mod_order
,
harq_process
->
pusch_pdu
.
nrOfLayers
,
r
);
Tbslbrm
=
nr_compute_tbslbrm
(
0
,
nb_rb
,
harq_process
->
pusch_pdu
.
nrOfLayers
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC
,
VCD_FUNCTION_IN
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC
,
VCD_FUNCTION_IN
);
start_meas
(
&
ue
->
ulsch_rate_matching_stats
);
start_meas
(
&
ue
->
ulsch_rate_matching_stats
);
if
(
nr_rate_matching_ldpc
(
Ilbrm
,
if
(
nr_rate_matching_ldpc
(
Ilbrm
,
Tbslbrm
,
0
,
harq_process
->
BG
,
harq_process
->
BG
,
*
pz
,
*
pz
,
harq_process
->
d
[
r
],
harq_process
->
d
[
r
],
...
...
openair1/PHY/defs_gNB.h
View file @
77153fbf
...
@@ -928,7 +928,6 @@ typedef struct LDPCDecode_s {
...
@@ -928,7 +928,6 @@ typedef struct LDPCDecode_s {
int
segment_r
;
int
segment_r
;
int
r_offset
;
int
r_offset
;
int
offset
;
int
offset
;
int
Tbslbrm
;
int
decodeIterations
;
int
decodeIterations
;
}
ldpcDecode_t
;
}
ldpcDecode_t
;
...
...
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
View file @
77153fbf
...
@@ -286,6 +286,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
...
@@ -286,6 +286,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0_harq
->
n_dmrs_cdm_groups
=
dlsch_config_pdu
->
n_dmrs_cdm_groups
;
dlsch0_harq
->
n_dmrs_cdm_groups
=
dlsch_config_pdu
->
n_dmrs_cdm_groups
;
dlsch0_harq
->
mcs
=
dlsch_config_pdu
->
mcs
;
dlsch0_harq
->
mcs
=
dlsch_config_pdu
->
mcs
;
dlsch0_harq
->
rvidx
=
dlsch_config_pdu
->
rv
;
dlsch0_harq
->
rvidx
=
dlsch_config_pdu
->
rv
;
dlsch0_harq
->
tbslbrm
=
dlsch_config_pdu
->
tbslbrm
;
dlsch0
->
g_pucch
=
dlsch_config_pdu
->
accumulated_delta_PUCCH
;
dlsch0
->
g_pucch
=
dlsch_config_pdu
->
accumulated_delta_PUCCH
;
//get nrOfLayers from DCI info
//get nrOfLayers from DCI info
uint8_t
Nl
=
0
;
uint8_t
Nl
=
0
;
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c
View file @
77153fbf
...
@@ -92,12 +92,10 @@ uint32_t nr_compute_tbs(uint16_t Qm,
...
@@ -92,12 +92,10 @@ uint32_t nr_compute_tbs(uint16_t Qm,
}
}
//tbslbrm calculation according to 5.4.2.1 of 38.212
//tbslbrm calculation according to 5.4.2.1 of 38.212
uint32_t
nr_compute_tbslbrm
(
uint16_t
table
,
uint32_t
nr_compute_tbslbrm
(
uint16_t
table
,
uint16_t
nb_rb
,
uint16_t
nb_rb
,
uint8_t
Nl
)
uint8_t
Nl
)
{
{
uint16_t
R
,
nb_re
;
uint16_t
R
,
nb_re
;
uint16_t
nb_rb_lbrm
=
0
;
uint16_t
nb_rb_lbrm
=
0
;
...
@@ -122,34 +120,31 @@ uint32_t nr_compute_tbslbrm(uint16_t table,
...
@@ -122,34 +120,31 @@ uint32_t nr_compute_tbslbrm(uint16_t table,
Ninfo
=
(
nb_re
*
R
*
Qm
*
Nl
)
>>
10
;
Ninfo
=
(
nb_re
*
R
*
Qm
*
Nl
)
>>
10
;
if
(
Ninfo
<=
3824
)
{
if
(
Ninfo
<=
3824
)
{
n
=
max
(
3
,
floor
(
log2
(
Ninfo
))
-
6
);
n
=
max
(
3
,
floor
(
log2
(
Ninfo
))
-
6
);
Np_info
=
max
(
24
,
(
Ninfo
>>
n
)
<<
n
);
Np_info
=
max
(
24
,
(
Ninfo
>>
n
)
<<
n
);
for
(
int
i
=
0
;
i
<
INDEX_MAX_TBS_TABLE
;
i
++
)
{
for
(
int
i
=
0
;
i
<
INDEX_MAX_TBS_TABLE
;
i
++
)
{
if
(
Tbstable_nr
[
i
]
>=
Np_info
){
if
(
Tbstable_nr
[
i
]
>=
Np_info
){
nr_tbs
=
Tbstable_nr
[
i
];
nr_tbs
=
Tbstable_nr
[
i
];
break
;
break
;
}
}
}
}
}
}
else
{
else
{
n
=
log2
(
Ninfo
-
24
)
-
5
;
n
=
log2
(
Ninfo
-
24
)
-
5
;
Np_info
=
max
(
3840
,
(
ROUNDIDIV
((
Ninfo
-
24
),(
1
<<
n
)))
<<
n
);
Np_info
=
max
(
3840
,
(
ROUNDIDIV
((
Ninfo
-
24
),(
1
<<
n
)))
<<
n
);
if
(
R
<=
256
)
{
C
=
CEILIDIV
((
Np_info
+
24
),
3816
);
nr_tbs
=
(
C
<<
3
)
*
CEILIDIV
((
Np_info
+
24
),(
C
<<
3
))
-
24
;
}
else
{
if
(
Np_info
>
8424
){
C
=
CEILIDIV
((
Np_info
+
24
),
8424
);
nr_tbs
=
(
C
<<
3
)
*
CEILIDIV
((
Np_info
+
24
),(
C
<<
3
))
-
24
;
}
else
{
nr_tbs
=
((
CEILIDIV
((
Np_info
+
24
),
8
))
<<
3
)
-
24
;
}
}
if
(
R
<=
256
)
{
C
=
CEILIDIV
((
Np_info
+
24
),
3816
);
nr_tbs
=
(
C
<<
3
)
*
CEILIDIV
((
Np_info
+
24
),(
C
<<
3
))
-
24
;
}
else
{
if
(
Np_info
>
8424
){
C
=
CEILIDIV
((
Np_info
+
24
),
8424
);
nr_tbs
=
(
C
<<
3
)
*
CEILIDIV
((
Np_info
+
24
),(
C
<<
3
))
-
24
;
}
else
nr_tbs
=
((
CEILIDIV
((
Np_info
+
24
),
8
))
<<
3
)
-
24
;
}
}
}
return
nr_tbs
;
return
nr_tbs
;
}
}
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
View file @
77153fbf
...
@@ -4076,6 +4076,28 @@ uint16_t compute_pucch_prb_size(uint8_t format,
...
@@ -4076,6 +4076,28 @@ uint16_t compute_pucch_prb_size(uint8_t format,
}
}
}
}
int
get_bw_tbslbrm
(
NR_ServingCellConfigCommon_t
*
scc
,
NR_CellGroupConfig_t
*
cg
)
{
int
bw
=
0
;
NR_BWP_t
genericParameters
;
if
(
cg
&&
cg
->
spCellConfig
&&
cg
->
spCellConfig
->
spCellConfigDedicated
&&
cg
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
)
{
struct
NR_ServingCellConfig__downlinkBWP_ToAddModList
*
BWP_list
=
cg
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
;
for
(
int
i
=
0
;
i
<
BWP_list
->
list
.
count
;
i
++
)
{
genericParameters
=
BWP_list
->
list
.
array
[
i
]
->
bwp_Common
->
genericParameters
;
int
curr_bw
=
NRRIV2BW
(
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
if
(
curr_bw
>
bw
)
bw
=
curr_bw
;
}
}
else
{
genericParameters
=
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
;
bw
=
NRRIV2BW
(
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
}
return
bw
;
}
/* extract UL PTRS values from RRC and validate it based upon 38.214 6.2.3 */
/* extract UL PTRS values from RRC and validate it based upon 38.214 6.2.3 */
bool
set_ul_ptrs_values
(
NR_PTRS_UplinkConfig_t
*
ul_ptrs_config
,
bool
set_ul_ptrs_values
(
NR_PTRS_UplinkConfig_t
*
ul_ptrs_config
,
uint16_t
rbSize
,
uint8_t
mcsIndex
,
uint8_t
mcsTable
,
uint16_t
rbSize
,
uint8_t
mcsIndex
,
uint8_t
mcsTable
,
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
View file @
77153fbf
...
@@ -121,6 +121,13 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB);
...
@@ -121,6 +121,13 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB);
uint16_t
get_nr_srs_offset
(
NR_SRS_PeriodicityAndOffset_t
periodicityAndOffset
);
uint16_t
get_nr_srs_offset
(
NR_SRS_PeriodicityAndOffset_t
periodicityAndOffset
);
int
get_bw_tbslbrm
(
NR_ServingCellConfigCommon_t
*
scc
,
NR_CellGroupConfig_t
*
cg
);
uint32_t
nr_compute_tbslbrm
(
uint16_t
table
,
uint16_t
nb_rb
,
uint8_t
Nl
);
void
get_type0_PDCCH_CSS_config_parameters
(
NR_Type0_PDCCH_CSS_config_t
*
type0_PDCCH_CSS_config
,
void
get_type0_PDCCH_CSS_config_parameters
(
NR_Type0_PDCCH_CSS_config_t
*
type0_PDCCH_CSS_config
,
frame_t
frameP
,
frame_t
frameP
,
NR_MIB_t
*
mib
,
NR_MIB_t
*
mib
,
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
77153fbf
...
@@ -890,6 +890,12 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -890,6 +890,12 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
LOG_W
(
MAC
,
"[%d.%d] MCS value %d out of bounds! Possibly due to false DCI. Ignoring DCI!
\n
"
,
frame
,
slot
,
dlsch_config_pdu_1_0
->
mcs
);
LOG_W
(
MAC
,
"[%d.%d] MCS value %d out of bounds! Possibly due to false DCI. Ignoring DCI!
\n
"
,
frame
,
slot
,
dlsch_config_pdu_1_0
->
mcs
);
return
-
1
;
return
-
1
;
}
}
int
bw_tbslbrm
=
get_bw_tbslbrm
(
mac
->
scc
,
mac
->
cg
);
dlsch_config_pdu_1_0
->
tbslbrm
=
nr_compute_tbslbrm
(
dlsch_config_pdu_1_0
->
mcs_table
,
bw_tbslbrm
,
1
);
/* NDI (only if CRC scrambled by C-RNTI or CS-RNTI or new-RNTI or TC-RNTI)*/
/* NDI (only if CRC scrambled by C-RNTI or CS-RNTI or new-RNTI or TC-RNTI)*/
dlsch_config_pdu_1_0
->
ndi
=
dci
->
ndi
;
dlsch_config_pdu_1_0
->
ndi
=
dci
->
ndi
;
/* RV (only if CRC scrambled by C-RNTI or CS-RNTI or new-RNTI or TC-RNTI)*/
/* RV (only if CRC scrambled by C-RNTI or CS-RNTI or new-RNTI or TC-RNTI)*/
...
@@ -1254,6 +1260,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -1254,6 +1260,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
/* TODO same calculation for MCS table as done in UL */
/* TODO same calculation for MCS table as done in UL */
dlsch_config_pdu_1_1
->
mcs_table
=
(
pdsch_Config
->
mcs_Table
)
?
(
*
pdsch_Config
->
mcs_Table
+
1
)
:
0
;
dlsch_config_pdu_1_1
->
mcs_table
=
(
pdsch_Config
->
mcs_Table
)
?
(
*
pdsch_Config
->
mcs_Table
+
1
)
:
0
;
// TBS_LBRM according to section 5.4.2.1 of 38.212
long
*
maxMIMO_Layers
=
mac
->
cg
->
spCellConfig
->
spCellConfigDedicated
->
pdsch_ServingCellConfig
->
choice
.
setup
->
ext1
->
maxMIMO_Layers
;
AssertFatal
(
maxMIMO_Layers
!=
NULL
,
"Option with max MIMO layers not configured is not supported
\n
"
);
int
nl_tbslbrm
=
*
maxMIMO_Layers
<
4
?
*
maxMIMO_Layers
:
4
;
int
bw_tbslbrm
=
get_bw_tbslbrm
(
mac
->
scc
,
mac
->
cg
);
dlsch_config_pdu_1_1
->
tbslbrm
=
nr_compute_tbslbrm
(
dlsch_config_pdu_1_1
->
mcs_table
,
bw_tbslbrm
,
nl_tbslbrm
);
/*PTRS configuration */
/*PTRS configuration */
dlsch_config_pdu_1_1
->
pduBitmap
=
0
;
dlsch_config_pdu_1_1
->
pduBitmap
=
0
;
if
(
pdsch_Config
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
phaseTrackingRS
!=
NULL
)
{
if
(
pdsch_Config
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
phaseTrackingRS
!=
NULL
)
{
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
77153fbf
...
@@ -1338,6 +1338,11 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
...
@@ -1338,6 +1338,11 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
uint8_t
tb_scaling
=
0
;
uint8_t
tb_scaling
=
0
;
nr_get_tbs_dl
(
&
dl_tti_pdsch_pdu
->
pdsch_pdu
,
x_Overhead
,
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
,
tb_scaling
);
nr_get_tbs_dl
(
&
dl_tti_pdsch_pdu
->
pdsch_pdu
,
x_Overhead
,
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
,
tb_scaling
);
int
bw_tbslbrm
=
get_bw_tbslbrm
(
scc
,
ra
->
CellGroup
);
pdsch_pdu_rel15
->
maintenance_parms_v3
.
tbSizeLbrmBytes
=
nr_compute_tbslbrm
(
mcsTableIdx
,
bw_tbslbrm
,
1
);
// Fill PDCCH DL DCI PDU
// Fill PDCCH DL DCI PDU
nfapi_nr_dl_dci_pdu_t
*
dci_pdu
=
&
pdcch_pdu_rel15
->
dci_pdu
[
pdcch_pdu_rel15
->
numDlDci
];
nfapi_nr_dl_dci_pdu_t
*
dci_pdu
=
&
pdcch_pdu_rel15
->
dci_pdu
[
pdcch_pdu_rel15
->
numDlDci
];
pdcch_pdu_rel15
->
numDlDci
++
;
pdcch_pdu_rel15
->
numDlDci
++
;
...
@@ -1715,6 +1720,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
...
@@ -1715,6 +1720,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
int
x_Overhead
=
0
;
int
x_Overhead
=
0
;
nr_get_tbs_dl
(
&
dl_tti_pdsch_pdu
->
pdsch_pdu
,
x_Overhead
,
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
,
tb_scaling
);
nr_get_tbs_dl
(
&
dl_tti_pdsch_pdu
->
pdsch_pdu
,
x_Overhead
,
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
,
tb_scaling
);
int
bw_tbslbrm
=
get_bw_tbslbrm
(
scc
,
ra
->
CellGroup
);
pdsch_pdu_rel15
->
maintenance_parms_v3
.
tbSizeLbrmBytes
=
nr_compute_tbslbrm
(
mcsTableIdx
,
bw_tbslbrm
,
1
);
pdsch_pdu_rel15
->
precodingAndBeamforming
.
num_prgs
=
1
;
pdsch_pdu_rel15
->
precodingAndBeamforming
.
num_prgs
=
1
;
pdsch_pdu_rel15
->
precodingAndBeamforming
.
prg_size
=
275
;
pdsch_pdu_rel15
->
precodingAndBeamforming
.
prg_size
=
275
;
pdsch_pdu_rel15
->
precodingAndBeamforming
.
dig_bf_interfaces
=
1
;
pdsch_pdu_rel15
->
precodingAndBeamforming
.
dig_bf_interfaces
=
1
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
View file @
77153fbf
...
@@ -502,6 +502,10 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
...
@@ -502,6 +502,10 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
pdsch_pdu_rel15
->
dlDmrsSymbPos
=
dlDmrsSymbPos
;
pdsch_pdu_rel15
->
dlDmrsSymbPos
=
dlDmrsSymbPos
;
LOG_D
(
MAC
,
"dlDmrsSymbPos = 0x%x
\n
"
,
pdsch_pdu_rel15
->
dlDmrsSymbPos
);
LOG_D
(
MAC
,
"dlDmrsSymbPos = 0x%x
\n
"
,
pdsch_pdu_rel15
->
dlDmrsSymbPos
);
pdsch_pdu_rel15
->
maintenance_parms_v3
.
tbSizeLbrmBytes
=
nr_compute_tbslbrm
(
0
,
pdsch_pdu_rel15
->
BWPSize
,
1
);
/* Fill PDCCH DL DCI PDU */
/* Fill PDCCH DL DCI PDU */
nfapi_nr_dl_dci_pdu_t
*
dci_pdu
=
&
pdcch_pdu_rel15
->
dci_pdu
[
pdcch_pdu_rel15
->
numDlDci
];
nfapi_nr_dl_dci_pdu_t
*
dci_pdu
=
&
pdcch_pdu_rel15
->
dci_pdu
[
pdcch_pdu_rel15
->
numDlDci
];
pdcch_pdu_rel15
->
numDlDci
++
;
pdcch_pdu_rel15
->
numDlDci
++
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
77153fbf
...
@@ -1140,6 +1140,16 @@ void nr_schedule_ue_spec(module_id_t module_id,
...
@@ -1140,6 +1140,16 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu
->
StartSymbolIndex
=
ps
->
startSymbolIndex
;
pdsch_pdu
->
StartSymbolIndex
=
ps
->
startSymbolIndex
;
pdsch_pdu
->
NrOfSymbols
=
ps
->
nrOfSymbols
;
pdsch_pdu
->
NrOfSymbols
=
ps
->
nrOfSymbols
;
// TBS_LBRM according to section 5.4.2.1 of 38.212
long
*
maxMIMO_Layers
=
cg
->
spCellConfig
->
spCellConfigDedicated
->
pdsch_ServingCellConfig
->
choice
.
setup
->
ext1
->
maxMIMO_Layers
;
AssertFatal
(
maxMIMO_Layers
!=
NULL
,
"Option with max MIMO layers not configured is not supported
\n
"
);
int
nl_tbslbrm
=
*
maxMIMO_Layers
<
4
?
*
maxMIMO_Layers
:
4
;
// Maximum number of PRBs across all configured DL BWPs
int
bw_tbslbrm
=
get_bw_tbslbrm
(
scc
,
cg
);
pdsch_pdu
->
maintenance_parms_v3
.
tbSizeLbrmBytes
=
nr_compute_tbslbrm
(
ps
->
mcsTableIdx
,
bw_tbslbrm
,
nl_tbslbrm
);
NR_PDSCH_Config_t
*
pdsch_Config
=
NULL
;
NR_PDSCH_Config_t
*
pdsch_Config
=
NULL
;
if
(
bwp
&&
if
(
bwp
&&
bwp
->
bwp_Dedicated
&&
bwp
->
bwp_Dedicated
&&
...
@@ -1189,7 +1199,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
...
@@ -1189,7 +1199,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
dci_pdu_rel15_t
dci_payload
;
dci_pdu_rel15_t
dci_payload
;
memset
(
&
dci_payload
,
0
,
sizeof
(
dci_pdu_rel15_t
));
memset
(
&
dci_payload
,
0
,
sizeof
(
dci_pdu_rel15_t
));
// bwp indicator
// bwp indicator
const
int
n_dl_bwp
=
bwp
?
UE_info
->
CellGroup
[
UE_id
]
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
:
0
;
const
int
n_dl_bwp
=
bwp
?
cg
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
:
0
;
AssertFatal
(
n_dl_bwp
<=
1
,
"downlinkBWP_ToAddModList has %d BWP!
\n
"
,
n_dl_bwp
);
AssertFatal
(
n_dl_bwp
<=
1
,
"downlinkBWP_ToAddModList has %d BWP!
\n
"
,
n_dl_bwp
);
// as per table 7.3.1.1.2-1 in 38.212
// as per table 7.3.1.1.2-1 in 38.212
...
@@ -1242,7 +1252,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
...
@@ -1242,7 +1252,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
const
int
rnti_type
=
NR_RNTI_C
;
const
int
rnti_type
=
NR_RNTI_C
;
fill_dci_pdu_rel15
(
scc
,
fill_dci_pdu_rel15
(
scc
,
UE_info
->
CellGroup
[
UE_id
]
,
cg
,
dci_pdu
,
dci_pdu
,
&
dci_payload
,
&
dci_payload
,
dci_format
,
dci_format
,
...
...
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