Commit 142f01c1 authored by Sakthivel Velumani's avatar Sakthivel Velumani

added mcs option for cmdline

parent 9c6105a4
...@@ -160,8 +160,6 @@ int otg_enabled; ...@@ -160,8 +160,6 @@ int otg_enabled;
//static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; //static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
//static nfapi_nr_config_request_t *config[MAX_NUM_CCs]; //static nfapi_nr_config_request_t *config[MAX_NUM_CCs];
uint32_t target_dl_mcs = 28; //maximum allowed mcs
uint32_t target_ul_mcs = 20;
uint32_t timing_advance = 0; uint32_t timing_advance = 0;
uint64_t num_missed_slots=0; // counter for the number of missed slots uint64_t num_missed_slots=0; // counter for the number of missed slots
......
...@@ -67,13 +67,13 @@ extern "C" ...@@ -67,13 +67,13 @@ extern "C"
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n" #define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n" #define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" #define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n" #define CONFIG_HLP_DLMCS "Set the downlink MCS\n"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" #define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
//#define CONFIG_HLP_NUMUES "Set the number of UEs for the emulation" //#define CONFIG_HLP_NUMUES "Set the number of UEs for the emulation"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n" #define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS "Set the maximum uplink MCS\n" #define CONFIG_HLP_ULMCS "Set the uplink MCS\n"
#define CONFIG_HLP_UE "Set the lte softmodem as a UE\n" #define CONFIG_HLP_UE "Set the lte softmodem as a UE\n"
#define CONFIG_HLP_TQFS "Apply three-quarter of sampling frequency, 23.04 Msps to reduce the data rate on USB/PCIe transfers (only valid for 20 MHz)\n" #define CONFIG_HLP_TQFS "Apply three-quarter of sampling frequency, 23.04 Msps to reduce the data rate on USB/PCIe transfers (only valid for 20 MHz)\n"
...@@ -135,6 +135,8 @@ extern "C" ...@@ -135,6 +135,8 @@ extern "C"
{"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \ {"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \ {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
{"m" , CONFIG_HLP_DLMCS, 0, iptr:&target_dl_mcs, defintval:9, TYPE_INT, 0}, \
{"u" , CONFIG_HLP_ULMCS, 0, iptr:&target_ul_mcs, defintval:9, TYPE_INT, 0}, \
} }
...@@ -230,6 +232,8 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr); ...@@ -230,6 +232,8 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
#define SOFTMODEM_RTSIGNAL (SIGRTMIN+1) #define SOFTMODEM_RTSIGNAL (SIGRTMIN+1)
extern void set_softmodem_sighandler(void); extern void set_softmodem_sighandler(void);
extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern uint32_t target_dl_mcs;
extern uint32_t target_ul_mcs;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "openair1/SIMULATION/RF/rf.h" #include "openair1/SIMULATION/RF/rf.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
//#include "executables/softmodem-common.h"
//#define DEBUG_NR_PBCHSIM //#define DEBUG_NR_PBCHSIM
...@@ -53,6 +54,8 @@ PHY_VARS_NR_UE *UE; ...@@ -53,6 +54,8 @@ PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint32_t target_dl_mcs;
uint32_t target_ul_mcs;
double cpuf; double cpuf;
uint8_t nfapi_mode = 0; uint8_t nfapi_mode = 0;
uint16_t NB_UE_INST = 1; uint16_t NB_UE_INST = 1;
...@@ -64,6 +67,7 @@ uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; ...@@ -64,6 +67,7 @@ uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3};
uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3};
uint64_t get_softmodem_optmask(void) {return 0;} uint64_t get_softmodem_optmask(void) {return 0;}
softmodem_params_t *get_softmodem_params(void) {return NULL;}
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "executables/softmodem-common.h"
#include "nr_unitary_defs.h" #include "nr_unitary_defs.h"
#include "OCG_vars.h" #include "OCG_vars.h"
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
//#define UL_HARQ_PRINT //#define UL_HARQ_PRINT
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
uint32_t target_dl_mcs;
uint32_t target_ul_mcs;
const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3}; const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3};
//#define ENABLE_MAC_PAYLOAD_DEBUG 1 //#define ENABLE_MAC_PAYLOAD_DEBUG 1
...@@ -122,8 +125,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, ...@@ -122,8 +125,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
pdsch_pdu_rel15->SubcarrierSpacing = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing; pdsch_pdu_rel15->SubcarrierSpacing = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing;
pdsch_pdu_rel15->CyclicPrefix = 0; pdsch_pdu_rel15->CyclicPrefix = 0;
pdsch_pdu_rel15->NrOfCodewords = 1; pdsch_pdu_rel15->NrOfCodewords = 1;
int mcsIndex = 9; int mcsIndex = target_dl_mcs;
if (get_softmodem_params()->phy_test) mcsIndex = 28;
pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcsIndex,0); pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcsIndex,0);
pdsch_pdu_rel15->qamModOrder[0] = 2; pdsch_pdu_rel15->qamModOrder[0] = 2;
pdsch_pdu_rel15->mcsIndex[0] = mcsIndex; pdsch_pdu_rel15->mcsIndex[0] = mcsIndex;
...@@ -310,8 +312,7 @@ int configure_fapi_dl_pdu(int Mod_idP, ...@@ -310,8 +312,7 @@ int configure_fapi_dl_pdu(int Mod_idP,
else pdsch_pdu_rel15->CyclicPrefix=0; else pdsch_pdu_rel15->CyclicPrefix=0;
pdsch_pdu_rel15->NrOfCodewords = 1; pdsch_pdu_rel15->NrOfCodewords = 1;
int mcs = (mcsIndex!=NULL) ? *mcsIndex : 9; int mcs = (mcsIndex!=NULL) ? *mcsIndex : target_dl_mcs;
if (get_softmodem_params()->phy_test) mcs = 28;
int current_harq_pid = UE_list->UE_sched_ctrl[UE_id].current_harq_pid; int current_harq_pid = UE_list->UE_sched_ctrl[UE_id].current_harq_pid;
pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcs,0); pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcs,0);
pdsch_pdu_rel15->qamModOrder[0] = 2; pdsch_pdu_rel15->qamModOrder[0] = 2;
...@@ -886,8 +887,7 @@ void schedule_fapi_ul_pdu(int Mod_idP, ...@@ -886,8 +887,7 @@ void schedule_fapi_ul_pdu(int Mod_idP,
pusch_pdu->cyclic_prefix = 0; pusch_pdu->cyclic_prefix = 0;
//pusch information always include //pusch information always include
//this informantion seems to be redundant. with hthe mcs_index and the modulation table, the mod_order and target_code_rate can be determined. //this informantion seems to be redundant. with hthe mcs_index and the modulation table, the mod_order and target_code_rate can be determined.
pusch_pdu->mcs_index = 9; pusch_pdu->mcs_index = target_ul_mcs;
if (get_softmodem_params()->phy_test) pusch_pdu->mcs_index = 28;
pusch_pdu->mcs_table = 0; //0: notqam256 [TS38.214, table 5.1.3.1-1] - corresponds to nr_target_code_rate_table1 in PHY pusch_pdu->mcs_table = 0; //0: notqam256 [TS38.214, table 5.1.3.1-1] - corresponds to nr_target_code_rate_table1 in PHY
pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table) ; pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table) ;
pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table) ; pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table) ;
......
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