Commit 1fe40f31 authored by Abhijith's avatar Abhijith

bugfix : pdcch and BWP switch capability

parent bca775a5
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
"name": "(gdb) Launch UE PHY Simu", "name": "(gdb) Launch UE PHY Simu",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "/home/spclab/SCS60/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem", "program": "/home/spclab/SCS60/rem/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem",
"args": ["--rfsimulator.serveraddr","127.0.0.1", "args": ["--rfsimulator.serveraddr","127.0.0.1",
"--rfsim", "--rfsim",
"--phy-test", "--phy-test",
"--rrc_config_path" ,"/home/spclab/SCS60/openairinterface5g/cmake_targets/ran_build/build" "--rrc_config_path" ,"/home/spclab/SCS60/rem/openairinterface5g/cmake_targets/ran_build/build"
], ],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
"name": "(gdb) Launch UE RA", "name": "(gdb) Launch UE RA",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "/home/spclab/SCS60/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem", "program": "/home/spclab/SCS60/rem/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem",
"args": ["--rfsimulator.serveraddr","127.0.0.1", "args": ["--rfsimulator.serveraddr","127.0.0.1",
"--rfsim", "--rfsim",
"--do-ra", "--do-ra",
"--rrc_config_path" ,"/home/spclab/SCS60/openairinterface5g/cmake_targets/ran_build/build" "--rrc_config_path" ,"/home/spclab/SCS60/rem/openairinterface5g/cmake_targets/ran_build/build"
], ],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
"name": "(gdb) Launch gNB PHY Simu", "name": "(gdb) Launch gNB PHY Simu",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "/home/spclab/SCS60/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem", "program": "/home/spclab/SCS60/rem/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem",
"args": ["--rfsimulator.serveraddr","server","-O", "args": ["--rfsimulator.serveraddr","server","-O",
"/home/spclab/SCS60/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf", "/home/spclab/SCS60/rem/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf",
"--rfsim", "--rfsim",
"--phy-test" "--phy-test"
], ],
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
"name": "(gdb) Launch gNB RA", "name": "(gdb) Launch gNB RA",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "/home/spclab/SCS60/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem", "program": "/home/spclab/SCS60/rem/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem",
"args": ["--rfsimulator.serveraddr","server","-O", "args": ["--rfsimulator.serveraddr","server","-O",
"/home/spclab/SCS60/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf", "/home/spclab/SCS60/rem/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf",
"--rfsim", "--rfsim",
"--do-ra" "--do-ra"
], ],
...@@ -102,27 +102,7 @@ ...@@ -102,27 +102,7 @@
"ignoreFailures": true "ignoreFailures": true
} }
] ]
},
{
"name": "(gdb) dlsim",
"type": "cppdbg",
"request": "launch",
"program": "/home/spclab/SCS60/openairinterface5g/cmake_targets/phy_simulators/build/nr_dlsim",
"args": ["-n", "4", "-m", "2"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
} }
] ]
} }
...@@ -937,10 +937,10 @@ uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t ...@@ -937,10 +937,10 @@ uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t
int N_m_c_rx = 0; int N_m_c_rx = 0;
int V_DAI_m_DL = 0; int V_DAI_m_DL = 0;
NR_UE_MAC_INST_t *mac = get_mac_inst(0); NR_UE_MAC_INST_t *mac = get_mac_inst(0);
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
if (mac->DLbwp[dl_bwp_id-1] == NULL) return 0;
if (mac->DLbwp[0] == NULL) return 0; if (mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0] == 2) {
if (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0] == 2) {
two_transport_blocks = TRUE; two_transport_blocks = TRUE;
number_of_code_word = 2; number_of_code_word = 2;
} }
...@@ -1018,7 +1018,7 @@ uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t ...@@ -1018,7 +1018,7 @@ uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t
N_m_c_rx = number_harq_feedback; N_m_c_rx = number_harq_feedback;
int N_SPS_c = 0; /* FFS TODO_NR multicells and SPS are not supported at the moment */ int N_SPS_c = 0; /* FFS TODO_NR multicells and SPS are not supported at the moment */
if (mac->scg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH == NULL) { if (mac->scg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH == NULL) {
int N_TB_max_DL = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0]; int N_TB_max_DL = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0];
*n_HARQ_ACK = (((V_DAI_m_DL - U_DAI_c)%4) * N_TB_max_DL) + N_m_c_rx + N_SPS_c; *n_HARQ_ACK = (((V_DAI_m_DL - U_DAI_c)%4) * N_TB_max_DL) + N_m_c_rx + N_SPS_c;
NR_TST_PHY_PRINTF("PUCCH power n(%d) = ( V(%d) - U(%d) )mod4 * N_TB(%d) + N(%d) \n", *n_HARQ_ACK, V_DAI_m_DL, U_DAI_c, N_TB_max_DL, N_m_c_rx); NR_TST_PHY_PRINTF("PUCCH power n(%d) = ( V(%d) - U(%d) )mod4 * N_TB(%d) + N(%d) \n", *n_HARQ_ACK, V_DAI_m_DL, U_DAI_c, N_TB_max_DL, N_m_c_rx);
} }
......
...@@ -442,7 +442,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){ ...@@ -442,7 +442,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
AssertFatal(*ss->controlResourceSetId == mac->coreset[dl_bwp_id - 1][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n"); AssertFatal(*ss->controlResourceSetId == mac->coreset[dl_bwp_id - 1][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n");
AssertFatal(ss->monitoringSymbolsWithinSlot != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot is null\n"); AssertFatal(ss->monitoringSymbolsWithinSlot != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot is null\n");
AssertFatal(ss->monitoringSymbolsWithinSlot->buf != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot->buf is null\n"); AssertFatal(ss->monitoringSymbolsWithinSlot->buf != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot->buf is null\n");
mac->SSpace[0][0][ss_id] = ss; mac->SSpace[dl_bwp_id-1][0][ss_id] = ss;
} }
// Check available CSSs in the commonSearchSpaceList (list of additional common search spaces) // Check available CSSs in the commonSearchSpaceList (list of additional common search spaces)
......
...@@ -94,14 +94,15 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, ...@@ -94,14 +94,15 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
*/ */
long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) {
long k2 = -1; long k2 = -1;
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
// Get K2 from RRC configuration // Get K2 from RRC configuration
NR_PUSCH_Config_t *pusch_config=mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup; NR_PUSCH_Config_t *pusch_config=mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated->pusch_Config->choice.setup;
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL; NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
if (pusch_config->pusch_TimeDomainAllocationList) { if (pusch_config->pusch_TimeDomainAllocationList) {
pusch_TimeDomainAllocationList = pusch_config->pusch_TimeDomainAllocationList->choice.setup; pusch_TimeDomainAllocationList = pusch_config->pusch_TimeDomainAllocationList->choice.setup;
} }
else if (mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) { else if (mac->ULbwp[ul_bwp_id-1]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; pusch_TimeDomainAllocationList = mac->ULbwp[ul_bwp_id-1]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
} }
if (pusch_TimeDomainAllocationList) { if (pusch_TimeDomainAllocationList) {
if (time_domain_ind >= pusch_TimeDomainAllocationList->list.count) { if (time_domain_ind >= pusch_TimeDomainAllocationList->list.count) {
...@@ -126,6 +127,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { ...@@ -126,6 +127,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) {
*/ */
fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int slot) fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int slot)
{ {
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
//Check if request to access ul_config is for a UL slot //Check if request to access ul_config is for a UL slot
if (is_nr_UL_slot(mac->scc, slot, mac->frame_type) == 0) { if (is_nr_UL_slot(mac->scc, slot, mac->frame_type) == 0) {
LOG_W(MAC, "Slot %d is not a UL slot. %s called for wrong slot!!!\n", slot, __FUNCTION__); LOG_W(MAC, "Slot %d is not a UL slot. %s called for wrong slot!!!\n", slot, __FUNCTION__);
...@@ -135,7 +137,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl ...@@ -135,7 +137,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl
// Calculate the index of the UL slot in mac->ul_config_request list. This is // Calculate the index of the UL slot in mac->ul_config_request list. This is
// based on the TDD pattern (slot configuration period) and number of UL+mixed // based on the TDD pattern (slot configuration period) and number of UL+mixed
// slots in the period. TS 38.213 Sec 11.1 // slots in the period. TS 38.213 Sec 11.1
int mu = mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing; int mu = mac->ULbwp[ul_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing;
NR_TDD_UL_DL_Pattern_t *tdd_pattern = &mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1; NR_TDD_UL_DL_Pattern_t *tdd_pattern = &mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1;
const int num_slots_per_tdd = nr_slots_per_frame[mu] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity); const int num_slots_per_tdd = nr_slots_per_frame[mu] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity);
const int num_slots_ul = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0); const int num_slots_ul = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0);
...@@ -152,7 +154,8 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl ...@@ -152,7 +154,8 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl
void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci) { void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci) {
NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommon_t *scc = mac->scc;
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup; NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated->pusch_Config->choice.setup;
long transformPrecoder; long transformPrecoder;
if (pusch_Config->transformPrecoder) if (pusch_Config->transformPrecoder)
...@@ -290,9 +293,9 @@ void ul_ports_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_conf ...@@ -290,9 +293,9 @@ void ul_ports_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_conf
/* ANTENNA_PORTS */ /* ANTENNA_PORTS */
uint8_t rank = 0; // We need to initialize rank FIXME!!! uint8_t rank = 0; // We need to initialize rank FIXME!!!
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommon_t *scc = mac->scc;
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup; NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated->pusch_Config->choice.setup;
long transformPrecoder; long transformPrecoder;
if (pusch_Config->transformPrecoder) if (pusch_Config->transformPrecoder)
...@@ -498,6 +501,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -498,6 +501,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommon_t *scc = mac->scc;
int rnti_type = get_rnti_type(mac, rnti); int rnti_type = get_rnti_type(mac, rnti);
NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id;
// Common configuration // Common configuration
pusch_config_pdu->dmrs_config_type = pusch_dmrs_type1; pusch_config_pdu->dmrs_config_type = pusch_dmrs_type1;
...@@ -512,7 +516,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -512,7 +516,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
// Note: for Msg3 or MsgA PUSCH transmission the N_PRB_oh is always set to 0 // Note: for Msg3 or MsgA PUSCH transmission the N_PRB_oh is always set to 0
NR_BWP_Uplink_t *ubwp = mac->ULbwp[0]; NR_BWP_Uplink_t *ubwp = mac->ULbwp[ul_bwp_id-1];
NR_BWP_UplinkDedicated_t *ibwp = mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP; NR_BWP_UplinkDedicated_t *ibwp = mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
NR_PUSCH_Config_t *pusch_Config = ibwp->pusch_Config->choice.setup; NR_PUSCH_Config_t *pusch_Config = ibwp->pusch_Config->choice.setup;
int startSymbolAndLength = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->startSymbolAndLength; int startSymbolAndLength = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->startSymbolAndLength;
...@@ -599,8 +603,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -599,8 +603,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
int target_ss; int target_ss;
bool valid_ptrs_setup = 0; bool valid_ptrs_setup = 0;
uint16_t n_RB_ULBWP = NRRIV2BW(mac->ULbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); uint16_t n_RB_ULBWP = NRRIV2BW(mac->ULbwp[ul_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup; NR_PUSCH_Config_t *pusch_Config = mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated->pusch_Config->choice.setup;
// Basic sanity check for MCS value to check for a false or erroneous DCI // Basic sanity check for MCS value to check for a false or erroneous DCI
if (dci->mcs > 28) { if (dci->mcs > 28) {
...@@ -642,8 +646,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -642,8 +646,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
if (pusch_Config->pusch_TimeDomainAllocationList) { if (pusch_Config->pusch_TimeDomainAllocationList) {
pusch_TimeDomainAllocationList = pusch_Config->pusch_TimeDomainAllocationList->choice.setup; pusch_TimeDomainAllocationList = pusch_Config->pusch_TimeDomainAllocationList->choice.setup;
} }
else if (mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) { else if (mac->ULbwp[mac->UL_BWP_Id-1]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; pusch_TimeDomainAllocationList = mac->ULbwp[mac->UL_BWP_Id-1]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
} }
int mappingtype = pusch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType; int mappingtype = pusch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
...@@ -1021,7 +1025,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac, ...@@ -1021,7 +1025,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac,
uint8_t tda_id){ uint8_t tda_id){
int delta = 0; int delta = 0;
NR_BWP_Uplink_t *ubwp = mac->ULbwp[0]; NR_BWP_Uplink_t *ubwp = mac->ULbwp[mac->UL_BWP_Id-1];
// Get the numerology to calculate the Tx frame and slot // Get the numerology to calculate the Tx frame and slot
int mu = ubwp->bwp_Common->genericParameters.subcarrierSpacing; int mu = ubwp->bwp_Common->genericParameters.subcarrierSpacing;
struct NR_PUSCH_TimeDomainResourceAllocationList *pusch_TimeDomainAllocationList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; struct NR_PUSCH_TimeDomainResourceAllocationList *pusch_TimeDomainAllocationList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
......
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