Commit 9897ae64 authored by Khodr Saaifan's avatar Khodr Saaifan Committed by Thomas Schlichter
Browse files

Add a new nr_dlsim test case -x 1 or 2 to run 1 and 2 layers

parent 08ff33a0
......@@ -120,7 +120,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
dlsch0_harq->harq_ack.pucch_resource_indicator = dlsch_config_pdu->pucch_resource_id;
dlsch0_harq->harq_ack.slot_for_feedback_ack = (slot+dlsch_config_pdu->pdsch_to_harq_feedback_time_ind)%frame_parms.slots_per_frame;
dlsch0_harq->Nl=1;
if ((dlsch0_harq->Nl > 2)||(dlsch0_harq->Nl <= 0)) dlsch0_harq->Nl = 1;
//printf("no of layers Nl %d\n",dlsch0_harq->Nl);
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
dlsch0_harq->harq_ack.rx_status = downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type);
if (dlsch0_harq->status != ACTIVE) {
......
......@@ -292,7 +292,7 @@ int main(int argc, char **argv)
// char fname[40], vname[40];
int trial, n_trials = 1, n_errors = 0, n_false_positive = 0;
//int n_errors2, n_alamouti;
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
uint8_t nrOfLayers = 1,n_tx=1,n_rx=1;
uint8_t round;
uint8_t num_rounds = 4;
......@@ -455,12 +455,11 @@ int main(int argc, char **argv)
break;
*/
case 'x':
transmission_mode=atoi(optarg);
nrOfLayers=atoi(optarg);
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
printf("Unsupported transmission mode %d\n",transmission_mode);
if ((nrOfLayers!=1) &&
(nrOfLayers!=2)) {
printf("Unsupported nr Of Layers %d\n",nrOfLayers);
exit(-1);
}
......@@ -967,7 +966,7 @@ int main(int argc, char **argv)
gNB_mac->UE_info.num_pdcch_cand[0][i] = 0;
if (css_flag == 0) {
nr_schedule_ue_spec(0, frame, slot);
nr_schedule_ue_spec(0, frame, slot, nrOfLayers);
} else {
nr_schedule_css_dlsch_phytest(0,frame,slot);
}
......@@ -1108,6 +1107,7 @@ int main(int argc, char **argv)
}
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
UE_harq_process->Nl = nrOfLayers;
nr_ue_scheduled_response(&scheduled_response);
phy_procedures_nrUE_RX(UE,
......
......@@ -315,6 +315,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
int nb_periods_per_frame;
const int bwp_id = 1;
uint8_t nrOfLayers = 1;
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = gNB->common_channels;
......@@ -458,7 +459,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
// This schedules the DCI for Downlink and PDSCH
if (is_xlsch_in_slot(dlsch_in_slot_bitmap, slot))
nr_schedule_ue_spec(module_idP, frame, slot);
nr_schedule_ue_spec(module_idP, frame, slot, nrOfLayers);
nr_schedule_pucch(module_idP, frame, slot);
......
......@@ -656,7 +656,8 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
void nr_schedule_ue_spec(module_id_t module_id,
frame_t frame,
sub_frame_t slot) {
sub_frame_t slot,
uint8_t nrOfLayers) {
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
/* PREPROCESSOR */
......@@ -707,7 +708,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
nrOfSymbols,
startSymbolIndex);
const nfapi_nr_dmrs_type_e dmrsConfigType = getDmrsConfigType(sched_ctrl->active_bwp);
const int nrOfLayers = 1;
const uint16_t R = nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx);
const uint8_t Qm = nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx);
const uint32_t TBS =
......
......@@ -69,7 +69,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
void nr_schedule_ue_spec(module_id_t module_id,
frame_t frame,
sub_frame_t slot);
sub_frame_t slot,
uint8_t nrOfLayers);
void schedule_control_sib1(module_id_t module_id,
int CC_id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment