Commit f32c759e authored by Raymond Knopp's avatar Raymond Knopp

modifications to allow running SL without --phy-test flag

parent 88b6cdd2
...@@ -1124,8 +1124,8 @@ target_link_libraries(PHY_COMMON PRIVATE asn1_lte_rrc_hdrs) ...@@ -1124,8 +1124,8 @@ target_link_libraries(PHY_COMMON PRIVATE asn1_lte_rrc_hdrs)
add_library(PHY ${PHY_SRC}) add_library(PHY ${PHY_SRC})
target_link_libraries(PHY PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) target_link_libraries(PHY PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
pkg_check_modules(blas REQUIRED blas) #pkg_check_modules(blas REQUIRED blas)
pkg_check_modules(lapacke REQUIRED lapacke) #pkg_check_modules(lapacke REQUIRED lapacke)
add_library(PHY_UE ${PHY_SRC_UE}) add_library(PHY_UE ${PHY_SRC_UE})
target_link_libraries(PHY_UE PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) target_link_libraries(PHY_UE PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
......
...@@ -622,7 +622,6 @@ void processSlotTX(void *arg) { ...@@ -622,7 +622,6 @@ void processSlotTX(void *arg) {
nr_phy_data_tx_t phy_data = {0}; nr_phy_data_tx_t phy_data = {0};
int sl_tx_action = 0; int sl_tx_action = 0;
LOG_D(PHY,"%d.%d => slot type %d\n", proc->frame_tx, proc->nr_slot_tx, proc->tx_slot_type);
if (proc->tx_slot_type == NR_SIDELINK_SLOT && UE->sl_mode == 2) { if (proc->tx_slot_type == NR_SIDELINK_SLOT && UE->sl_mode == 2) {
...@@ -1008,10 +1007,11 @@ void *UE_thread(void *arg) ...@@ -1008,10 +1007,11 @@ void *UE_thread(void *arg)
curMsg.proc.nr_slot_tx = (absolute_slot + DURATION_RX_TO_TX) % nb_slot_frame; curMsg.proc.nr_slot_tx = (absolute_slot + DURATION_RX_TO_TX) % nb_slot_frame;
curMsg.proc.frame_rx = (absolute_slot / nb_slot_frame) % MAX_FRAME_NUMBER; curMsg.proc.frame_rx = (absolute_slot / nb_slot_frame) % MAX_FRAME_NUMBER;
curMsg.proc.frame_tx = ((absolute_slot + DURATION_RX_TO_TX) / nb_slot_frame) % MAX_FRAME_NUMBER; curMsg.proc.frame_tx = ((absolute_slot + DURATION_RX_TO_TX) / nb_slot_frame) % MAX_FRAME_NUMBER;
if (mac->phy_config_request_sent) { if (UE->phy_config_request_sent) {
if (is_sidelink) { if (is_sidelink) {
curMsg.proc.rx_slot_type = sl_nr_ue_slot_select(sl_cfg, curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx, TDD); curMsg.proc.rx_slot_type = sl_nr_ue_slot_select(sl_cfg, curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx, TDD);
curMsg.proc.tx_slot_type = sl_nr_ue_slot_select(sl_cfg, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx, TDD); curMsg.proc.tx_slot_type = sl_nr_ue_slot_select(sl_cfg, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx, TDD);
LOG_D(NR_PHY,"Setting SL slot type to TX %d.%d %d, RX %d.%d %d\n",curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx,curMsg.proc.tx_slot_type,curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx,curMsg.proc.rx_slot_type);
} else { } else {
curMsg.proc.rx_slot_type = nr_ue_slot_select(cfg, curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx); curMsg.proc.rx_slot_type = nr_ue_slot_select(cfg, curMsg.proc.frame_rx, curMsg.proc.nr_slot_rx);
curMsg.proc.tx_slot_type = nr_ue_slot_select(cfg, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx); curMsg.proc.tx_slot_type = nr_ue_slot_select(cfg, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx);
......
...@@ -523,7 +523,7 @@ int main( int argc, char **argv ) { ...@@ -523,7 +523,7 @@ int main( int argc, char **argv ) {
get_softmodem_params()->numerology, get_softmodem_params()->numerology,
nr_band); nr_band);
} }
else{ else if (get_softmodem_params()->sl_mode != 2){
DevAssert(mac->if_module != NULL && mac->if_module->phy_config_request != NULL); DevAssert(mac->if_module != NULL && mac->if_module->phy_config_request != NULL);
mac->if_module->phy_config_request(&mac->phy_config); mac->if_module->phy_config_request(&mac->phy_config);
mac->phy_config_request_sent = true; mac->phy_config_request_sent = true;
...@@ -547,7 +547,6 @@ int main( int argc, char **argv ) { ...@@ -547,7 +547,6 @@ int main( int argc, char **argv ) {
get_nrUE_params()->ofdm_offset_divisor); get_nrUE_params()->ofdm_offset_divisor);
sl_ue_phy_init(UE[CC_id]); sl_ue_phy_init(UE[CC_id]);
} }
} }
bool is_sl = (get_softmodem_params()->sl_mode) ? 1 : 0; bool is_sl = (get_softmodem_params()->sl_mode) ? 1 : 0;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include <execinfo.h> #include <execinfo.h>
#include <getopt.h> #include <getopt.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "common_lib.h" #include "common_lib.h"
#include "fapi_nr_ue_interface.h" #include "fapi_nr_ue_interface.h"
#include "assertions.h" #include "assertions.h"
#include <stdbool.h>
#ifdef MEX #ifdef MEX
#define msg mexPrintf #define msg mexPrintf
...@@ -654,6 +655,7 @@ typedef struct { ...@@ -654,6 +655,7 @@ typedef struct {
//Sidelink parameters //Sidelink parameters
sl_nr_sidelink_mode_t sl_mode; sl_nr_sidelink_mode_t sl_mode;
sl_nr_ue_phy_params_t SL_UE_PHY_PARAMS; sl_nr_ue_phy_params_t SL_UE_PHY_PARAMS;
bool phy_config_request_sent;
} PHY_VARS_NR_UE; } PHY_VARS_NR_UE;
typedef struct { typedef struct {
......
...@@ -671,7 +671,9 @@ int8_t nr_ue_sl_phy_config_request(nr_sl_phy_config_t *phy_config) ...@@ -671,7 +671,9 @@ int8_t nr_ue_sl_phy_config_request(nr_sl_phy_config_t *phy_config)
sl_nr_phy_config_request_t *sl_config = &PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->SL_UE_PHY_PARAMS.sl_config; sl_nr_phy_config_request_t *sl_config = &PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->SL_UE_PHY_PARAMS.sl_config;
if(phy_config != NULL) { if(phy_config != NULL) {
memcpy(sl_config,&phy_config->sl_config_req,sizeof(sl_nr_phy_config_request_t)); memcpy(sl_config,&phy_config->sl_config_req,sizeof(sl_nr_phy_config_request_t));
PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->phy_config_request_sent = true;
} }
return 0; return 0;
} }
/* /*
......
...@@ -58,7 +58,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) { ...@@ -58,7 +58,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
int scs = get_softmodem_params()->sa ? int scs = get_softmodem_params()->sa ?
get_softmodem_params()->numerology : get_softmodem_params()->numerology :
rrc_inst ? rrc_inst && rrc_inst->scell_group_config ?
*rrc_inst->scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon->ssbSubcarrierSpacing : *rrc_inst->scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon->ssbSubcarrierSpacing :
- 1; - 1;
if (scs > -1) if (scs > -1)
......
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