Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
817339e0
Commit
817339e0
authored
Oct 30, 2020
by
rmagueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transmission of SIB1
parent
b54d283e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
241 additions
and
310 deletions
+241
-310
openair1/PHY/NR_TRANSPORT/nr_dci.c
openair1/PHY/NR_TRANSPORT/nr_dci.c
+1
-7
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+18
-2
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
+6
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
+5
-18
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+207
-250
openair2/RRC/NR/L2_nr_interface.c
openair2/RRC/NR/L2_nr_interface.c
+0
-6
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+4
-26
No files found.
openair1/PHY/NR_TRANSPORT/nr_dci.c
View file @
817339e0
...
...
@@ -240,13 +240,7 @@ uint8_t nr_generate_dci_top(PHY_VARS_gNB *gNB,
}
// m
}
// reg_idx
printf
(
"polar_encoder_fast: pdcch_pdu_rel15->dci_pdu.PayloadSizeBits[d] = %i, pdcch_pdu_rel15->dci_pdu.AggregationLevel[d] = %i, n_RNTI = %i
\n
"
,
pdcch_pdu_rel15
->
dci_pdu
.
PayloadSizeBits
[
d
],
pdcch_pdu_rel15
->
dci_pdu
.
AggregationLevel
[
d
],
n_RNTI
);
printf
(
"nr_pdcch_scrambling: encoded_length = %i, Nid = %i, scrambling_RNTI = %i
\n\n
"
,
encoded_length
,
Nid
,
scrambling_RNTI
);
printf
(
"
\n
>> DCI: payloadSize = %d | payload = %llx
\n\n
"
,
printf
(
">> DCI: payloadSize = %d | payload = %llx
\n\n
"
,
*
pdcch_pdu_rel15
->
dci_pdu
.
PayloadSizeBits
,
*
(
unsigned
long
long
*
)
pdcch_pdu_rel15
->
dci_pdu
.
Payload
);
}
// for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++)
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
817339e0
...
...
@@ -590,8 +590,17 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if
(
check_crc
((
uint8_t
*
)
llrProcBuf
,
length_dec
,
harq_process
->
F
,
crc_type
))
{
LOG_D
(
PHY
,
"Segment %u CRC OK
\n\033
[0m"
,
r
);
if
(
r
==
0
)
for
(
int
i
=
0
;
i
<
10
;
i
++
)
LOG_D
(
PHY
,
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
llrProcBuf
)[
i
]);
if
(
r
==
0
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
LOG_D
(
PHY
,
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
llrProcBuf
)[
i
]);
printf
(
"
\n
"
);
printf
(
"==== CRC OK ====
\n
"
);
for
(
int
i
=
0
;
i
<
10
;
i
++
)
printf
(
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
llrProcBuf
)[
i
]);
printf
(
"
\n
"
);
getchar
();
}
//Temporary hack
no_iteration_ldpc
=
dlsch
->
max_ldpc_iterations
;
...
...
@@ -600,6 +609,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
else
{
LOG_D
(
PHY
,
"CRC NOK
\n\033
[0m"
);
ret
=
1
+
dlsch
->
max_ldpc_iterations
;
printf
(
"
\n
"
);
printf
(
"==== CRC NOT OK ====
\n
"
);
for
(
int
i
=
0
;
i
<
10
;
i
++
)
printf
(
"byte %d : %x
\n
"
,
i
,((
uint8_t
*
)
llrProcBuf
)[
i
]);
printf
(
"
\n
"
);
getchar
();
}
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
View file @
817339e0
...
...
@@ -2234,8 +2234,13 @@ uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc,
case
NR_DL_DCI_FORMAT_1_0
:
/// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 Time Domain assgnmt 4 -- 28
size
+
=
28
;
size
=
28
;
size
+=
(
uint8_t
)
ceil
(
log2
(
(
N_RB
*
(
N_RB
+
1
))
>>
1
)
);
// Freq domain assignment
dci_pdu
->
frequency_domain_assignment
.
nbits
=
(
int
)
ceil
(
log2
(
(
N_RB
*
(
N_RB
+
1
))
>>
1
)
);
dci_pdu
->
time_domain_assignment
.
nbits
=
4
;
dci_pdu
->
vrb_to_prb_mapping
.
nbits
=
1
;
break
;
case
NR_DL_DCI_FORMAT_1_1
:
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
View file @
817339e0
...
...
@@ -163,10 +163,8 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
rel15
->
dci_length_options
[
i
]
=
nr_dci_size
(
scc
,
mac
->
scg
,
def_dci_pdu_rel15
,
rel15
->
dci_format_options
[
i
],
NR_RNTI_SI
,
rel15
->
BWPSize
,
bwp_id
);
}
printf
(
"bwp_Common->genericParameters.locationAndBandwidth = %li
\n
"
,
bwp_Common
->
genericParameters
.
locationAndBandwidth
);
printf
(
"rel15->BWPSize = %i
\n
"
,
rel15
->
BWPSize
);
break
;
case
NR_RNTI_SFI
:
break
;
case
NR_RNTI_INT
:
...
...
@@ -253,23 +251,12 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
}
}
}
/*if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
printf("*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = %li\n", *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1);
printf("ss->searchSpaceId = %li\n", ss->searchSpaceId);
// FIXME:
//if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
if
(
pdcch_ConfigCommon
->
choice
.
setup
->
searchSpaceSIB1
){
if
(
ss
->
searchSpaceId
==
*
pdcch_ConfigCommon
->
choice
.
setup
->
searchSpaceSIB1
){
if( (frame%2 == mac->type0_PDCCH_CSS_config.sfn_c) && (slot == mac->type0_PDCCH_CSS_config.n_0) ){
rel15->num_dci_options = 1;
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_SI, ss_id);
fill_dci_search_candidates(ss, rel15);
}
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
LOG_W
(
MAC
,
"[DCI_CONFIG] This seach space should not be configured yet..."
);
}
}
*/
}
if
(
pdcch_ConfigCommon
->
choice
.
setup
->
searchSpaceOtherSystemInformation
){
if
(
ss
->
searchSpaceId
==
*
pdcch_ConfigCommon
->
choice
.
setup
->
searchSpaceOtherSystemInformation
){
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
View file @
817339e0
...
...
@@ -162,9 +162,11 @@ void schedule_control_sib1(module_id_t module_id,
int
time_domain_allocation
,
uint8_t
mcsTableIdx
,
uint8_t
mcs
,
uint8_t
numDmrsCdmGrpsNoData
)
{
uint8_t
numDmrsCdmGrpsNoData
,
int
num_total_bytes
)
{
gNB_MAC_INST
*
gNB_mac
=
RC
.
nrmac
[
module_id
];
uint8_t
*
vrb_map
=
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
vrb_map
;
if
(
gNB_mac
->
sched_ctrlCommon
==
NULL
){
gNB_mac
->
sched_ctrlCommon
=
calloc
(
1
,
sizeof
(
*
gNB_mac
->
sched_ctrlCommon
));
...
...
@@ -175,348 +177,303 @@ void schedule_control_sib1(module_id_t module_id,
fill_default_coresetZero
(
gNB_mac
->
sched_ctrlCommon
->
coreset
);
}
gNB_mac
->
sched_ctrlCommon
->
active_bwp
=
gNB_mac
->
secondaryCellGroupCommon
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
array
[
bwp_id
-
1
];
//NR_COMMON_channels_t *cc = &gNB_mac->common_channels[0];
//NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
//scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth;
gNB_mac
->
sched_ctrlCommon
->
rbSize
=
0
;
gNB_mac
->
sched_ctrlCommon
->
time_domain_allocation
=
time_domain_allocation
;
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
=
mcsTableIdx
;
gNB_mac
->
sched_ctrlCommon
->
mcs
=
mcs
;
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
=
numDmrsCdmGrpsNoData
;
gNB_mac
->
sched_ctrlCommon
->
num_total_bytes
=
num_total_bytes
;
uint8_t
nr_of_candidates
;
find_aggregation_candidates
(
&
gNB_mac
->
sched_ctrlCommon
->
aggregation_level
,
&
nr_of_candidates
,
gNB_mac
->
sched_ctrlCommon
->
search_space
);
find_aggregation_candidates
(
&
gNB_mac
->
sched_ctrlCommon
->
aggregation_level
,
&
nr_of_candidates
,
gNB_mac
->
sched_ctrlCommon
->
search_space
);
gNB_mac
->
sched_ctrlCommon
->
cce_index
=
allocate_nr_CCEs
(
RC
.
nrmac
[
module_id
],
gNB_mac
->
sched_ctrlCommon
->
active_bwp
,
gNB_mac
->
sched_ctrlCommon
->
coreset
,
gNB_mac
->
sched_ctrlCommon
->
aggregation_level
,
0
,
0
);
0
);
const
uint16_t
bwpSize
=
NRRIV2BW
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
275
);
int
rbStart
=
NRRIV2PRBOFFSET
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
275
);
// Freq-domain allocation
while
(
rbStart
<
bwpSize
&&
vrb_map
[
rbStart
])
rbStart
++
;
// Calculate number of PRB_DMRS
uint8_t
N_PRB_DMRS
;
if
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NFAPI_NR_DMRS_TYPE1
)
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
6
;
}
else
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
4
;
}
// 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
->
time_domain_allocation
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
// Calculate rbStart and rbSize
gNB_mac
->
sched_ctrlCommon
->
rbStart
=
NRRIV2PRBOFFSET
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
275
);
gNB_mac
->
sched_ctrlCommon
->
rbSize
=
4
;
//24; //gNB_mac->type0_PDCCH_CSS_config.num_rbs;
int
rbSize
=
0
;
uint32_t
TBS
=
0
;
do
{
rbSize
++
;
TBS
=
nr_compute_tbs
(
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
,
0
,
0
,
1
)
>>
3
;
}
while
(
rbStart
+
rbSize
<
bwpSize
&&
!
vrb_map
[
rbStart
+
rbSize
]
&&
TBS
<
gNB_mac
->
sched_ctrlCommon
->
num_total_bytes
);
gNB_mac
->
sched_ctrlCommon
->
rbSize
=
rbSize
;
gNB_mac
->
sched_ctrlCommon
->
rbStart
=
rbStart
;
// Mark the corresponding RBs as used
uint8_t
*
vrb_map
=
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
vrb_map
;
for
(
int
rb
=
0
;
rb
<
gNB_mac
->
sched_ctrlCommon
->
rbSize
;
rb
++
)
{
vrb_map
[
rb
+
gNB_mac
->
sched_ctrlCommon
->
rbStart
]
=
1
;
}
printf
(
"searchSpaceId = %li
\n
"
,
gNB_mac
->
sched_ctrlCommon
->
search_space
->
searchSpaceId
);
printf
(
"locationAndBandwidth = %li
\n
"
,
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
);
printf
(
"cce_index = %i
\n
"
,
gNB_mac
->
sched_ctrlCommon
->
cce_index
);
printf
(
"aggregation_level = %i
\n
"
,
gNB_mac
->
sched_ctrlCommon
->
aggregation_level
);
printf
(
"nr_of_candidates = %i
\n
"
,
nr_of_candidates
);
printf
(
"rbSize = %i
\n
"
,
gNB_mac
->
sched_ctrlCommon
->
rbSize
);
printf
(
"rbStart = %i
\n
"
,
gNB_mac
->
sched_ctrlCommon
->
rbStart
);
}
void
nr_fill_nfapi_dci_sib1_pdu
(
int
Mod_idP
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
)
{
void
nr_fill_nfapi_dl_sib1_pdu
(
int
Mod_idP
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
,
uint32_t
TBS
,
int
StartSymbolIndex
,
int
NrOfSymbols
)
{
// static values
int
rnti
=
0xFFFF
;
int
dci_format
=
NR_DL_DCI_FORMAT_1_0
;
int
rnti_type
=
NR_RNTI_SI
;
gNB_MAC_INST
*
gNB_mac
=
RC
.
nrmac
[
Mod_idP
];
NR_ServingCellConfigCommon_t
*
scc
=
gNB_mac
->
common_channels
->
ServingCellConfigCommon
;
NR_COMMON_channels_t
*
cc
=
gNB_mac
->
common_channels
;
NR_ServingCellConfigCommon_t
*
scc
=
cc
->
ServingCellConfigCommon
;
NR_CellGroupConfig_t
*
secondaryCellGroup
=
gNB_mac
->
secondaryCellGroupCommon
;
NR_BWP_Downlink_t
*
bwp
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
;
long
locationAndBandwidth
=
bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
;
//long locationAndBandwidth = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth;
int
dci10_bw
=
NRRIV2BW
(
locationAndBandwidth
,
275
);
// Uncommenting these lines, the DLSCH is decoded in the UE:
//
//rnti = 0x1234;
//dci_format = NR_DL_DCI_FORMAT_1_1;
//rnti_type = NR_RNTI_C;
//gNB_mac->type0_PDCCH_CSS_config.n_0 = 6;
//
nfapi_nr_dl_tti_request_pdu_t
*
dl_tti_pdcch_pdu
=
&
dl_req
->
dl_tti_pdu_list
[
dl_req
->
nPDUs
];
memset
((
void
*
)
dl_tti_pdcch_pdu
,
0
,
sizeof
(
nfapi_nr_dl_tti_request_pdu_t
));
dl_tti_pdcch_pdu
->
PDUType
=
NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE
;
dl_tti_pdcch_pdu
->
PDUSize
=
(
uint8_t
)(
2
+
sizeof
(
nfapi_nr_dl_tti_pdcch_pdu
));
nfapi_nr_dl_tti_pdcch_pdu_rel15_t
*
pdcch_pdu_rel15
=
&
dl_tti_pdcch_pdu
->
pdcch_pdu
.
pdcch_pdu_rel15
;
dci_pdu_rel15_t
dci_pdu_rel15
[
MAX_DCI_CORESET
];
memset
(
dci_pdu_rel15
,
0
,
sizeof
(
dci_pdu_rel15_t
)
*
MAX_DCI_CORESET
);
dci_pdu_rel15
[
0
].
bwp_indicator
.
val
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Id
-
1
;
dci_pdu_rel15
[
0
].
frequency_domain_assignment
.
val
=
PRBalloc_to_locationandbandwidth0
(
gNB_mac
->
sched_ctrlCommon
->
rbSize
,
gNB_mac
->
sched_ctrlCommon
->
rbStart
,
dci10_bw
);
dci_pdu_rel15
[
0
].
time_domain_assignment
.
val
=
gNB_mac
->
sched_ctrlCommon
->
time_domain_allocation
;
dci_pdu_rel15
[
0
].
mcs
=
gNB_mac
->
sched_ctrlCommon
->
mcs
;
dci_pdu_rel15
[
0
].
rv
=
0
;
dci_pdu_rel15
[
0
].
harq_pid
=
0
;
dci_pdu_rel15
[
0
].
ndi
=
0
;
dci_pdu_rel15
[
0
].
dai
[
0
].
val
=
0
;
dci_pdu_rel15
[
0
].
tpc
=
0
;
dci_pdu_rel15
[
0
].
pucch_resource_indicator
=
0
;
dci_pdu_rel15
[
0
].
pdsch_to_harq_feedback_timing_indicator
.
val
=
0
;
dci_pdu_rel15
[
0
].
antenna_ports
.
val
=
0
;
dci_pdu_rel15
[
0
].
dmrs_sequence_initialization
.
val
=
0
;
dci_pdu_rel15
[
0
].
system_info_indicator
=
0
;
nr_configure_pdcch
(
gNB_mac
,
pdcch_pdu_rel15
,
0xFFFF
,
// SI-RNTI - 3GPP TS 38.321 Table 7.1-1: RNTI values
gNB_mac
->
sched_ctrlCommon
->
search_space
,
gNB_mac
->
sched_ctrlCommon
->
coreset
,
scc
,
bwp
,
gNB_mac
->
sched_ctrlCommon
->
aggregation_level
,
gNB_mac
->
sched_ctrlCommon
->
cce_index
);
int
dci_formats
[
2
];
int
rnti_types
[
2
];
dci_formats
[
0
]
=
NR_DL_DCI_FORMAT_1_0
;
rnti_types
[
0
]
=
NR_RNTI_SI
;
fill_dci_pdu_rel15
(
scc
,
gNB_mac
->
secondaryCellGroupCommon
,
pdcch_pdu_rel15
,
dci_pdu_rel15
,
dci_formats
,
rnti_types
,
dci10_bw
,
bwp
->
bwp_Id
);
//fill_dci_pdu_rel15(scc,gNB_mac->secondaryCellGroupCommon,pdcch_pdu_rel15,dci_pdu_rel15,dci_formats,rnti_types, 50,bwp->bwp_Id);
//dl_req->nPDUs += 1; // -----------------------------
printf
(
"locationAndBandwidth = %li
\n
"
,
locationAndBandwidth
);
printf
(
"dci10_bw = %i
\n
"
,
dci10_bw
);
}
void
nr_fill_nfapi_sib1_pdu
(
int
Mod_idP
,
nfapi_nr_dl_tti_request_body_t
*
dl_req
)
{
gNB_MAC_INST
*
gNB_mac
=
RC
.
nrmac
[
Mod_idP
];
NR_BWP_Downlink_t
*
bwp
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
;
nfapi_nr_dl_tti_request_pdu_t
*
dl_tti_pdsch_pdu
=
&
dl_req
->
dl_tti_pdu_list
[
dl_req
->
nPDUs
+
1
];
memset
((
void
*
)
dl_tti_pdsch_pdu
,
0
,
sizeof
(
nfapi_nr_dl_tti_request_pdu_t
));
dl_tti_pdsch_pdu
->
PDUType
=
NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE
;
dl_tti_pdsch_pdu
->
PDUSize
=
(
uint8_t
)(
2
+
sizeof
(
nfapi_nr_dl_tti_pdsch_pdu
));
nfapi_nr_dl_tti_pdcch_pdu_rel15_t
*
pdcch_pdu_rel15
=
&
dl_tti_pdcch_pdu
->
pdcch_pdu
.
pdcch_pdu_rel15
;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
pdsch_pdu_rel15
=
&
dl_tti_pdsch_pdu
->
pdsch_pdu
.
pdsch_pdu_rel15
;
// Calculate number of symbols
struct
NR_PDSCH_TimeDomainResourceAllocationList
*
tdaList
=
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
;
const
int
startSymbolAndLength
=
tdaList
->
list
.
array
[
gNB_mac
->
sched_ctrlCommon
->
time_domain_allocation
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
// Calculate number of PRB_DMRS
uint8_t
N_PRB_DMRS
;
if
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NFAPI_NR_DMRS_TYPE1
)
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
6
;
}
else
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
4
;
}
pdsch_pdu_rel15
->
pduBitmap
=
0
;
pdsch_pdu_rel15
->
rnti
=
0xFFFF
;
pdsch_pdu_rel15
->
rnti
=
rnti
;
pdsch_pdu_rel15
->
pduIndex
=
gNB_mac
->
pdu_index
[
0
]
++
;
pdsch_pdu_rel15
->
BWPSize
=
NRRIV2BW
(
bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
275
);
pdsch_pdu_rel15
->
BWPStart
=
NRRIV2PRBOFFSET
(
bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
275
);
pdsch_pdu_rel15
->
SubcarrierSpacing
=
bwp
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
if
(
bwp
->
bwp_Common
->
genericParameters
.
cyclicPrefix
)
{
pdsch_pdu_rel15
->
CyclicPrefix
=
*
bwp
->
bwp_Common
->
genericParameters
.
cyclicPrefix
;
}
else
{
}
else
{
pdsch_pdu_rel15
->
CyclicPrefix
=
0
;
}
pdsch_pdu_rel15
->
NrOfCodewords
=
1
;
pdsch_pdu_rel15
->
targetCodeRate
[
0
]
=
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
0
);
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
)
;
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
2
;
pdsch_pdu_rel15
->
mcsIndex
[
0
]
=
gNB_mac
->
sched_ctrlCommon
->
mcs
;
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
0
;
pdsch_pdu_rel15
->
rvIndex
[
0
]
=
0
;
pdsch_pdu_rel15
->
dataScramblingId
=
*
gNB_mac
->
common_channels
->
ServingCellConfigCommon
->
physCellId
;
pdsch_pdu_rel15
->
rvIndex
[
0
]
=
nr_rv_round_map
[
0
]
;
pdsch_pdu_rel15
->
dataScramblingId
=
*
scc
->
physCellId
;
pdsch_pdu_rel15
->
nrOfLayers
=
1
;
pdsch_pdu_rel15
->
transmissionScheme
=
0
;
pdsch_pdu_rel15
->
refPoint
=
0
;
// Point A
pdsch_pdu_rel15
->
dmrsConfigType
=
0
;
pdsch_pdu_rel15
->
dlDmrsScramblingId
=
*
gNB_mac
->
common_channels
->
ServingCellConfigCommon
->
physCellId
;
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
->
numDmrsCdmGrpsNoData
;
pdsch_pdu_rel15
->
dmrsPorts
=
1
;
pdsch_pdu_rel15
->
resourceAlloc
=
1
;
pdsch_pdu_rel15
->
rbStart
=
gNB_mac
->
sched_ctrlCommon
->
rbStart
;
pdsch_pdu_rel15
->
rbSize
=
gNB_mac
->
sched_ctrlCommon
->
rbSize
;
pdsch_pdu_rel15
->
VRBtoPRBMapping
=
1
;
// non-interleaved, check if this is ok for initialBWP
pdsch_pdu_rel15
->
targetCodeRate
[
0
]
=
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
);
pdsch_pdu_rel15
->
VRBtoPRBMapping
=
1
;
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
);
pdsch_pdu_rel15
->
TBSize
[
0
]
=
TBS
;
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
;
pdsch_pdu_rel15
->
StartSymbolIndex
=
s
tartSymbolIndex
;
pdsch_pdu_rel15
->
NrOfSymbols
=
n
rOfSymbols
;
pdsch_pdu_rel15
->
StartSymbolIndex
=
S
tartSymbolIndex
;
pdsch_pdu_rel15
->
NrOfSymbols
=
N
rOfSymbols
;
pdsch_pdu_rel15
->
TBSize
[
0
]
=
nr_compute_tbs
(
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
,
0
,
0
,
1
)
>>
3
;
pdsch_pdu_rel15
->
dlDmrsSymbPos
=
fill_dmrs_mask
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
scc
->
dmrs_TypeA_Position
,
pdsch_pdu_rel15
->
NrOfSymbols
);
pdsch_pdu_rel15
->
dlDmrsSymbPos
=
fill_dmrs_mask
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
,
gNB_mac
->
common_channels
->
ServingCellConfigCommon
->
dmrs_TypeA_Position
,
pdsch_pdu_rel15
->
NrOfSymbols
);
dci_pdu_rel15_t
dci_pdu_rel15
[
MAX_DCI_CORESET
];
memset
(
dci_pdu_rel15
,
0
,
sizeof
(
dci_pdu_rel15_t
)
*
MAX_DCI_CORESET
);
int
n_dl_bwp
=
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
;
dl_req
->
nPDUs
+=
2
;
// ----------------------------
if
(
n_dl_bwp
<
4
)
{
dci_pdu_rel15
[
0
].
bwp_indicator
.
val
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Id
;
}
else
{
dci_pdu_rel15
[
0
].
bwp_indicator
.
val
=
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Id
-
1
;
// as per table 7.3.1.1.2-1 in 38.212
}
// frequency domain assignment
dci_pdu_rel15
[
0
].
frequency_domain_assignment
.
val
=
PRBalloc_to_locationandbandwidth0
(
pdsch_pdu_rel15
->
rbSize
,
pdsch_pdu_rel15
->
rbStart
,
NRRIV2BW
(
bwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
275
));
dci_pdu_rel15
[
0
].
time_domain_assignment
.
val
=
gNB_mac
->
sched_ctrlCommon
->
time_domain_allocation
;
dci_pdu_rel15
[
0
].
mcs
=
gNB_mac
->
sched_ctrlCommon
->
mcs
;
dci_pdu_rel15
[
0
].
rv
=
pdsch_pdu_rel15
->
rvIndex
[
0
];
dci_pdu_rel15
[
0
].
harq_pid
=
0
;
dci_pdu_rel15
[
0
].
ndi
=
0
;
dci_pdu_rel15
[
0
].
dai
[
0
].
val
=
0
;
dci_pdu_rel15
[
0
].
tpc
=
0
;
// table 7.2.1-1 in 38.213
dci_pdu_rel15
[
0
].
pucch_resource_indicator
=
0
;
dci_pdu_rel15
[
0
].
pdsch_to_harq_feedback_timing_indicator
.
val
=
0
;
dci_pdu_rel15
[
0
].
antenna_ports
.
val
=
0
;
dci_pdu_rel15
[
0
].
dmrs_sequence_initialization
.
val
=
pdsch_pdu_rel15
->
SCID
;
nr_configure_pdcch
(
gNB_mac
,
pdcch_pdu_rel15
,
rnti
,
gNB_mac
->
sched_ctrlCommon
->
search_space
,
gNB_mac
->
sched_ctrlCommon
->
coreset
,
scc
,
bwp
,
gNB_mac
->
sched_ctrlCommon
->
aggregation_level
,
gNB_mac
->
sched_ctrlCommon
->
cce_index
);
int
dci_formats
[
2
];
int
rnti_types
[
2
];
dci_formats
[
0
]
=
dci_format
;
rnti_types
[
0
]
=
rnti_type
;
fill_dci_pdu_rel15
(
scc
,
secondaryCellGroup
,
pdcch_pdu_rel15
,
dci_pdu_rel15
,
dci_formats
,
rnti_types
,
pdsch_pdu_rel15
->
BWPSize
,
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Id
);
dl_req
->
nPDUs
+=
2
;
}
void
schedule_nr_sib1
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
slotP
)
{
printf
(
"
\n\n
--- Schedule_nr_sib1: Start
\n
"
);
printf
(
"frameP = %i, slotP = %i
\n
"
,
frameP
,
slotP
);
printf
(
"
\n\n
Schedule_nr_sib1: frameP = %i, slotP = %i
\n
"
,
frameP
,
slotP
);
int
CC_id
=
0
;
int
bwp_id
=
1
;
int
time_domain_allocation
=
0
;
// static values
const
int
CC_id
=
0
;
int
time_domain_allocation
=
2
;
uint8_t
mcsTableIdx
=
0
;
uint8_t
mcs
=
3
;
// 9
uint8_t
mcs
=
9
;
uint8_t
numDmrsCdmGrpsNoData
=
1
;
int
bwp_id
=
1
;
gNB_MAC_INST
*
gNB_mac
=
RC
.
nrmac
[
module_idP
];
if
(
gNB_mac
->
type0_PDCCH_CSS_config
.
num_rbs
<=
0
)
{
return
;
}
printf
(
"search_space_duration = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
search_space_duration
);
printf
(
"number_of_search_space_per_slot = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
number_of_search_space_per_slot
);
printf
(
"type0_pdcch_ss_mux_pattern = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
type0_pdcch_ss_mux_pattern
);
printf
(
"ssb_index = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
ssb_index
);
printf
(
"first_symbol_index = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
first_symbol_index
);
printf
(
"num_symbols = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
num_symbols
);
printf
(
"ssb_length = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
ssb_length
);
printf
(
"frame = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
frame
);
printf
(
"n_c = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
n_c
);
printf
(
"num_rbs = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
num_rbs
);
printf
(
"rb_offset = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
rb_offset
);
printf
(
"sfn_c = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
sfn_c
);
printf
(
"n_0 = %i
\n
"
,
gNB_mac
->
type0_PDCCH_CSS_config
.
n_0
);
if
(
(
frameP
%
2
==
gNB_mac
->
type0_PDCCH_CSS_config
.
sfn_c
)
&&
(
slotP
==
gNB_mac
->
type0_PDCCH_CSS_config
.
n_0
)
)
{
printf
(
"
\n
SIB1 will be transmitted here
\n
"
);
// Computation of the sched_ctrlCommon: bwp, coreset0, rbStart, rbSize, etc.
schedule_control_sib1
(
module_idP
,
CC_id
,
bwp_id
,
time_domain_allocation
,
mcsTableIdx
,
mcs
,
numDmrsCdmGrpsNoData
);
if
(
(
frameP
%
2
==
gNB_mac
->
type0_PDCCH_CSS_config
.
sfn_c
)
&&
(
slotP
==
gNB_mac
->
type0_PDCCH_CSS_config
.
n_0
)
)
{
// Schedule broadcast DCI for the SIB1
nfapi_nr_dl_tti_request_body_t
*
dl_req
=
&
gNB_mac
->
DL_req
[
CC_id
].
dl_tti_request_body
;
nr_fill_nfapi_dci_sib1_pdu
(
module_idP
,
dl_req
);
printf
(
"> SIB1 will be transmitted here
\n
"
);
// Get SIB1
uint8_t
sib1_payload
[
100
];
uint8_t
sib1_sdu_length
=
mac_rrc_nr_data_req
(
module_idP
,
CC_id
,
frameP
,
BCCH
,
1
,
sib1_payload
);
printf
(
"sib1_sdu_length = %i
\n
"
,
sib1_sdu_length
);
printf
(
"SIB1: "
);
for
(
int
i
=
0
;
i
<
sib1_sdu_length
;
i
++
)
{
printf
(
"%
i
"
,
sib1_payload
[
i
]);
printf
(
"%
x
"
,
sib1_payload
[
i
]);
}
printf
(
"
\n
"
);
// Schedule broadcast the SIB1
nr_fill_nfapi_sib1_pdu
(
module_idP
,
dl_req
);
const
int
ta_len
=
2
;
// 0 or 2
// Get RLC data TODO: remove random data retrieval
int
header_length_total
=
0
;
int
header_length_last
=
0
;
int
sdu_length_total
=
0
;
int
num_sdus
=
0
;
uint16_t
sdu_lengths
[
NB_RB_MAX
]
=
{
0
};
uint8_t
mac_sdus
[
MAX_NR_DLSCH_PAYLOAD_BYTES
];
unsigned
char
sdu_lcids
[
NB_RB_MAX
]
=
{
0
};
const
int
lcid
=
DL_SCH_LCID_DTCH
;
// Calculate number of PRB_DMRS
uint8_t
N_PRB_DMRS
;
if
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NFAPI_NR_DMRS_TYPE1
)
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
6
;
}
else
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
4
;
}
// 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
->
time_domain_allocation
]
->
startSymbolAndLength
;
int
startSymbolIndex
,
nrOfSymbols
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
uint32_t
TBS
=
nr_compute_tbs
(
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
,
0
,
0
,
1
)
>>
3
;
printf
(
"TBS = %i
\n
"
,
TBS
);
LOG_D
(
MAC
,
"Configuring DL_TX in %d.%d: random data
\n
"
,
frameP
,
slotP
);
// fill dlsch_buffer with random data
for
(
int
i
=
0
;
i
<
TBS
;
i
++
)
mac_sdus
[
i
]
=
(
unsigned
char
)
(
lrand48
()
&
0xff
);
sdu_lcids
[
0
]
=
0x3f
;
// DRB
sdu_lengths
[
0
]
=
TBS
-
ta_len
-
3
;
header_length_total
+=
2
+
(
sdu_lengths
[
0
]
>=
128
);
sdu_length_total
+=
sdu_lengths
[
0
];
num_sdus
+=
1
;
// Check if there is data from RLC or CE
const
int
post_padding
=
TBS
>=
2
+
header_length_total
+
sdu_length_total
+
ta_len
;
// padding param currently not in use
//padding = TBS - header_length_total - sdu_length_total - ta_len - 1;
const
int
ntx_req
=
gNB_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
;
nfapi_nr_pdu_t
*
tx_req
=
&
gNB_mac
->
TX_req
[
CC_id
].
pdu_list
[
ntx_req
];
// pointer to directly generate the PDU into the nFAPI structure
uint32_t
*
buf
=
tx_req
->
TLVs
[
0
].
value
.
direct
;
printf
(
"
\n\n
"
);
// Configure sched_ctrlCommon for SIB1
schedule_control_sib1
(
module_idP
,
CC_id
,
bwp_id
,
time_domain_allocation
,
mcsTableIdx
,
mcs
,
numDmrsCdmGrpsNoData
,
sib1_sdu_length
);
// Calculate number of symbols
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
->
time_domain_allocation
]
->
startSymbolAndLength
;
SLIV2SL
(
startSymbolAndLength
,
&
startSymbolIndex
,
&
nrOfSymbols
);
// Calculate number of PRB_DMRS
uint8_t
N_PRB_DMRS
;
if
(
gNB_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_Type
==
NFAPI_NR_DMRS_TYPE1
)
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
6
;
}
else
{
N_PRB_DMRS
=
gNB_mac
->
sched_ctrlCommon
->
numDmrsCdmGrpsNoData
*
4
;
}
const
int
offset
=
nr_generate_dlsch_pdu
(
module_idP
,
gNB_mac
->
sched_ctrlCommon
,
(
unsigned
char
*
)
mac_sdus
,
(
unsigned
char
*
)
buf
,
num_sdus
,
// num_sdus
sdu_lengths
,
sdu_lcids
,
255
,
// no drx
NULL
,
// contention res id
post_padding
);
const
uint32_t
TBS
=
nr_compute_tbs
(
nr_get_Qm_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
nr_get_code_rate_dl
(
gNB_mac
->
sched_ctrlCommon
->
mcs
,
gNB_mac
->
sched_ctrlCommon
->
mcsTableIdx
),
gNB_mac
->
sched_ctrlCommon
->
rbSize
,
nrOfSymbols
,
N_PRB_DMRS
,
0
,
0
,
1
)
>>
3
;
// Padding: fill remainder of DLSCH with 0
if
(
post_padding
>
0
)
{
for
(
int
j
=
0
;
j
<
TBS
-
offset
;
j
++
)
buf
[
offset
+
j
]
=
0
;
}
nfapi_nr_dl_tti_request_body_t
*
dl_req
=
&
gNB_mac
->
DL_req
[
CC_id
].
dl_tti_request_body
;
nr_fill_nfapi_dl_sib1_pdu
(
module_idP
,
dl_req
,
TBS
,
startSymbolIndex
,
nrOfSymbols
);
// reserve space for timing advance of UE if necessary,
const
int
ta_len
=
(
gNB_mac
->
sched_ctrlCommon
->
ta_apply
)
?
2
:
0
;
int
header_length_total
=
0
;
int
sdu_length_total
=
0
;
int
num_sdus
=
0
;
uint16_t
sdu_lengths
[
NB_RB_MAX
]
=
{
0
};
uint8_t
mac_sdus
[
MAX_NR_DLSCH_PAYLOAD_BYTES
];
unsigned
char
sdu_lcids
[
NB_RB_MAX
]
=
{
0
};
// Data to be transmitted
bzero
(
mac_sdus
,
MAX_NR_DLSCH_PAYLOAD_BYTES
);
//mac_sdus[2] = 0xFF;
//mac_sdus[5] = 0xFF;
memcpy
(
mac_sdus
,
sib1_payload
,
sib1_sdu_length
);
sdu_lcids
[
0
]
=
0x3f
;
// DRB
sdu_lengths
[
0
]
=
TBS
-
ta_len
-
3
;
header_length_total
+=
2
+
(
sdu_lengths
[
0
]
>=
128
);
sdu_length_total
+=
sdu_lengths
[
0
];
num_sdus
+=
1
;
// Check if there is data from RLC or CE
const
int
post_padding
=
TBS
>=
2
+
header_length_total
+
sdu_length_total
+
ta_len
;
const
int
ntx_req
=
gNB_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
;
nfapi_nr_pdu_t
*
tx_req
=
&
gNB_mac
->
TX_req
[
CC_id
].
pdu_list
[
ntx_req
];
// pointer to directly generate the PDU into the nFAPI structure
uint32_t
*
buf
=
tx_req
->
TLVs
[
0
].
value
.
direct
;
const
int
offset
=
nr_generate_dlsch_pdu
(
module_idP
,
gNB_mac
->
sched_ctrlCommon
,
(
unsigned
char
*
)
mac_sdus
,
(
unsigned
char
*
)
buf
,
num_sdus
,
sdu_lengths
,
sdu_lcids
,
255
,
NULL
,
post_padding
);
// Padding: fill remainder of DLSCH with 0
if
(
post_padding
>
0
)
{
for
(
int
j
=
0
;
j
<
TBS
-
offset
;
j
++
)
{
buf
[
offset
+
j
]
=
0
;
}
}
tx_req
->
PDU_length
=
TBS
;
tx_req
->
PDU_index
=
gNB_mac
->
pdu_index
[
0
]
++
;
tx_req
->
num_TLV
=
1
;
tx_req
->
TLVs
[
0
].
length
=
TBS
+
2
;
gNB_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
++
;
gNB_mac
->
TX_req
[
CC_id
].
SFN
=
frameP
;
gNB_mac
->
TX_req
[
CC_id
].
Slot
=
slotP
;
tx_req
->
PDU_length
=
TBS
;
tx_req
->
PDU_index
=
gNB_mac
->
pdu_index
[
0
]
++
;
tx_req
->
num_TLV
=
1
;
tx_req
->
TLVs
[
0
].
length
=
TBS
+
2
;
gNB_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
++
;
gNB_mac
->
TX_req
[
CC_id
].
SFN
=
frameP
;
gNB_mac
->
TX_req
[
CC_id
].
Slot
=
slotP
;
}
printf
(
"--- Schedule_nr_sib1: End
\n\n\n
"
);
}
openair2/RRC/NR/L2_nr_interface.c
View file @
817339e0
...
...
@@ -204,12 +204,6 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
/* TODO BCCH SIB1 SIBs */
if
((
Srb_id
&
RAB_OFFSET
)
==
BCCH
)
{
// memcpy(&buffer_pP[0],
// RC.rrc[Mod_idP]->carrier[CC_id].SIB1_MBMS,
// RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_MBMS);
//
// return RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_MBMS;
memcpy
(
&
buffer_pP
[
0
],
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
SIB1
,
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
sizeof_SIB1
);
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
817339e0
...
...
@@ -182,43 +182,21 @@ static void init_NR_SI(gNB_RRC_INST *rrc) {
LOG_D
(
RRC
,
"%s()
\n\n\n\n
"
,
__FUNCTION__
);
// MIB
rrc
->
carrier
.
MIB
=
(
uint8_t
*
)
malloc16
(
4
);
rrc
->
carrier
.
sizeof_MIB
=
do_MIB_NR
(
rrc
,
0
);
printf
(
"rrc->carrier.sizeof_MIB = %i
\n
"
,
rrc
->
carrier
.
sizeof_MIB
);
// SIB 1
gNB_RrcConfigurationReq
*
configuration
;
configuration
=
CALLOC
(
1
,
sizeof
(
gNB_RrcConfigurationReq
));
configuration
->
cell_identity
=
3
;
configuration
->
ssb_SubcarrierOffset
=
rrc
->
carrier
.
ssb_SubcarrierOffset
;
configuration
->
pdsch_AntennaPorts
=
rrc
->
carrier
.
pdsch_AntennaPorts
;
configuration
->
pusch_TargetSNRx10
=
rrc
->
carrier
.
pusch_TargetSNRx10
;
configuration
->
pucch_TargetSNRx10
=
rrc
->
carrier
.
pucch_TargetSNRx10
;
configuration
->
scc
=
rrc
->
carrier
.
servingcellconfigcommon
;
rrc
->
carrier
.
SIB1
=
(
uint8_t
*
)
malloc16
(
100
);
rrc
->
carrier
.
sizeof_SIB1
=
do_SIB1_NR
(
&
rrc
->
carrier
,
configuration
);
printf
(
"
\n
"
);
printf
(
"rrc->carrier.sizeof_SIB1 = %i
\n
"
,
rrc
->
carrier
.
sizeof_SIB1
);
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
printf
(
"%i "
,
rrc
->
carrier
.
SIB1
[
i
]);
}
printf
(
"
\n\n
"
);
if
(
rrc
->
carrier
.
SIB1
==
NULL
)
rrc
->
carrier
.
SIB1
=
(
uint8_t
*
)
malloc16
(
100
);
rrc
->
carrier
.
sizeof_SIB1
=
do_SIB1_NR
(
&
rrc
->
carrier
,
configuration
);
LOG_I
(
NR_RRC
,
"Done init_NR_SI
\n
"
);
rrc_mac_config_req_gNB
(
rrc
->
module_id
,
...
...
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