Nfapi struct corrections/ DCI interface/ Phytest scheduler type 1

This commit is contained in:
Guy De Souza
2018-07-27 15:25:51 +02:00
parent 45db11de94
commit b387b2034e
16 changed files with 295 additions and 211 deletions
+4 -33
View File
@@ -417,42 +417,13 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
schedule_nr_mib(module_idP, frameP, subframeP);
}
/*
* Temporary DCI scheduling for PDCCH testing in the absence of phy-test mode and pending proper scheduling
* currently schedules PDCCH type 1 for RA-RNTI*/
/*
if (phy_test == 0){
// This schedules SI for legacy LTE and eMTC starting in subframeP
schedule_SI(module_idP, frameP, subframeP);
// This schedules Paging in subframeP
schedule_PCH(module_idP,frameP,subframeP);
// This schedules Random-Access for legacy LTE and eMTC starting in subframeP
schedule_RA(module_idP, frameP, subframeP);
// copy previously scheduled UL resources (ULSCH + HARQ)
copy_nr_ulreq(module_idP, frameP, subframeP);
// This schedules SRS in subframeP
schedule_nr_SRS(module_idP, frameP, subframeP);
// This schedules ULSCH in subframeP (dci0)
schedule_ulsch(module_idP, frameP, subframeP);
// This schedules UCI_SR in subframeP
schedule_nr_SR(module_idP, frameP, subframeP);
// This schedules UCI_CSI in subframeP
schedule_nr_CSI(module_idP, frameP, subframeP);
// This schedules DLSCH in subframeP
schedule_dlsch(module_idP, frameP, subframeP, mbsfn_status);
if (phy_test == 0) {
}
else{
schedule_ulsch_phy_test(module_idP,frameP,subframeP);
schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status);
else {
void nr_schedule_css_dlsch_phytest(module_idP, frameP, subframeP);
}
*/
if (RC.flexran[module_idP]->enabled)
flexran_agent_send_update_stats(module_idP);
/*
// Allocate CCEs for good after scheduling is done
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
@@ -0,0 +1,62 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file gNB_scheduler_RA.c
* \brief primitives used for random access
* \author
* \date
* \email:
* \version
*/
#include nr_mac_gNB.h
void
schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
{
eNB_MAC_INST *mac = RC.mac[module_idP];
COMMON_channels_t *cc = mac->common_channels;
RA_t *ra;
uint8_t i;
start_meas(&mac->schedule_ra);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (i = 0; i < NB_RA_PROC_MAX; i++) {
ra = (RA_t *) & cc[CC_id].ra[i];
//LOG_D(MAC,"RA[state:%d]\n",ra->state);
if (ra->state == MSG2)
generate_Msg2(module_idP, CC_id, frameP, subframeP, ra);
else if (ra->state == MSG4)
generate_Msg4(module_idP, CC_id, frameP, subframeP, ra);
else if (ra->state == WAITMSG4ACK)
check_Msg4_retransmission(module_idP, CC_id, frameP, subframeP, ra);
} // for i=0 .. N_RA_PROC-1
} // CC_id
stop_meas(&mac->schedule_ra);
}
@@ -30,7 +30,7 @@
*/
#include "assertions.h"
#include "LAYER2/NR_MAC_gNB/mac.h"
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log.h"
@@ -0,0 +1,101 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file gNB_scheduler_phytest.c
* \brief gNB scheduling procedures in phy_test mode
* \author Guy De Souza
* \date 07/2018
* \email: desouza@eurecom.fr
* \version 1.0
* @ingroup _mac
*/
#include "nr_mac_gNB.h"
#include "PHY/SCHED/sched_nr.h"
extern RAN_CONTEXT_t RC;
/*Scheduling of DLSCH with associated DCI in common search space
* current version has only a DCI for type 1 PDCCH for RA-RNTI*/
void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
frame_t frameP,
sub_frame_t subframeP)
{
uint8_t CC_id;
gNB_MAC_INST *gNB_mac = RC.mac[module_idP];
NR_COMMON_channels_t *cc = gNB_mac->common_channels;
nfapi_nr_dl_config_request_body_t *dl_req;
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
LOG_I(MAC, "Scheduling common search space DCI type 1 for CC_id %d\n",CC_id);
PHY_VARS_gNB_s *gNB = RC.gNB[module_idP][CC_id];
nfapi_nr_config_request_t *config = gNB->gNB_config;
dl_req = &gNB_mac->DL_req[CC_id].dl_config_request_body;
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_of_pdus];
memset((void*)dl_config_pdu,0,sizeof(nfapi_nr_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_nr_dl_config_dci_dl_pdu));
nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel15;
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &dl_config_pdu->dci_dl_pdu.pdcch_params_rel15;
nr_configure_css_dci_from_mib(&gNB->pdcch_type0_params,
kHz30, kHz30, NR_FR1, 0, 0,
fp->slots_per_frame,
cfg->rf_config.dl_channel_bandwidth.value);
pdu_rel15->frequency_domain_resource_assignment = 5;
pdu_rel15->time_domain_resource_assignment = 2;
pdu_rel15->vrb_to_prb_mapping = 0;
pdu_rel15->tb_scaling = 1;
LOG_I(PHY, "DCI type 1 payload: freq_alloc %d, time_alloc %d, vrb to prb %d, tb_scaling %d\n",
pdu_rel15->frequency_domain_resource_assignment,
pdu_rel15->time_domain_resource_assignment,
pdu_rel15->vrb_to_prb_mapping,
pdu_rel15->tb_scaling);
params_rel15->rnti = 0x03;
params_rel15->rnti_type = NFAPI_NR_RNTI_RA;
params_rel15->dci_format = NFAPI_NR_DL_DCI_FORMAT_1_0;
params_rel15->aggregation_level = 4;
LOG_I(PHY, "DCI type 1 params: rmsi_pdcch_config, rnti %d, rnti_type %d, dci_format, L %d\n \
coreset params: mux_pattern %d, n_rb %d, n_symb %d, rb_offset %d \n \
ss params : nb_ss_sets_per_slot %d, first symb %d, nb_slots %d, sfn_mod2 %d, first slot %d\n",
0,
params_rel15->rnti,
params_rel15->rnti_type,
params_rel15->dci_format,
params_rel15->aggregation_level,
params_rel15->mux_pattern,
params_rel15->n_rb,
params_rel15->n_symb,
params_rel15->rb_offset,
params_rel15->nb_ss_sets_per_slot,
params_rel15->first_symbol,
params_rel15->nb_slots,
params_rel15->sfn_mod2,
params_rel15->first_slot);
}
}
@@ -32,7 +32,7 @@
#include "assertions.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/NR_MAC_gNB/mac.h"
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
@@ -119,4 +119,4 @@ int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){
subframeP, (int) ccP->tdd_Config->subframeAssignment);
break;
}
}
}
+3 -3
View File
@@ -2,8 +2,8 @@
#ifndef __LAYER2_NR_MAC_PROTO_H__
#define __LAYER2_NR_MAC_PROTO_H__
#include "mac.h"
#include "PHY/defs_nr_common.h"
#include "nr_mac_gNB.h"
#include "PHY/defs_gNB.h"
void mac_top_init_gNB(void);
@@ -30,4 +30,4 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
@@ -34,8 +34,8 @@
/*@}*/
#ifndef __LAYER2_NR_MAC_DEFS_H__
#define __LAYER2_NR_MAC_DEFS_H__
#ifndef __LAYER2_NR_MAC_GNB_H__
#define __LAYER2_NR_MAC_GNB_H__
#include <stdio.h>
#include <stdlib.h>
@@ -52,13 +52,13 @@
#include "PHY/TOOLS/time_meas.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
#include "PHY/defs_gNB.h"
#include "targets/ARCH/COMMON/common_lib.h"
#include "LAYER2/MAC/mac.h" // temporary
/*! \brief eNB common channels */
/*! \brief gNB common channels */
typedef struct {
int physCellId;
int p_gNB;
@@ -163,4 +163,4 @@ typedef struct gNB_MAC_INST_s {
time_stats_t schedule_pch;
} gNB_MAC_INST;
#endif /*__LAYER2_NR_MAC_DEFS_H__ */
#endif /*__LAYER2_NR_MAC_GNB_H__ */