Commit 1aea23d3 authored by Rakesh's avatar Rakesh

nr tdd config

parent b6246f77
...@@ -722,23 +722,44 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -722,23 +722,44 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
T_INT(0), T_BUFFER(&ru->common.txdata[0][slot * fp->samples_per_slot], fp->samples_per_slot * 4)); T_INT(0), T_BUFFER(&ru->common.txdata[0][slot * fp->samples_per_slot], fp->samples_per_slot * 4));
int slot_type = nr_slot_select(ru->nr_frame_parms,frame,slot%fp->slots_per_frame); int slot_type = nr_slot_select(ru->nr_frame_parms,frame,slot%fp->slots_per_frame);
int prevslot_type = nr_slot_select(ru->nr_frame_parms,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
int sf_extension = 0; int sf_extension = 0;
//nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame); //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
if ((slot == 0) || if (slot_type == NR_DOWNLINK_SLOT ||
slot_type == NR_S_SLOT) {
int siglen=fp->samples_per_tti,flags=1;
if(slot_type == NR_S_SLOT) {
int txsymb = fp->p_tdd_UL_DL_Configuration->nrofDownlinkSymbols;
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0)
+ (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
//+ ru->end_of_burst_delay;
flags=3; // end of burst
}
if (fp->frame_type == TDD &&
slot_type == NR_DOWNLINK_SLOT &&
prevslot_type == NR_UPLINK_SLOT) {
flags = 2; // start of burst
//sf_extension = ru->sf_extension;
}
/*if ((slot == 0) ||
(slot == 1)) { (slot == 1)) {
int siglen=fp->samples_per_slot; int siglen=fp->samples_per_slot;
int flags; int flags;
if (slot==0) if (slot==0)
flags = 2; flags = 2;
else if (slot==1) else if (slot==1)
flags=3; flags=3;*/
if ((slot_type & NR_UPLINK_SLOT) == 0) { //if ((slot_type & NR_UPLINK_SLOT) == 0) {
/*
if (SF_type == SF_S) { /* if (SF_type == SF_S) {
siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0); siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0);
flags=3; // end of burst flags=3; // end of burst
} }
...@@ -756,7 +777,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -756,7 +777,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
(nextSF_type == SF_UL)) { (nextSF_type == SF_UL)) {
flags = 4; // start of burst and end of burst (only one DL SF between two UL) flags = 4; // start of burst and end of burst (only one DL SF between two UL)
sf_extension = ru->N_TA_offset<<1; sf_extension = ru->N_TA_offset<<1;
} */ }*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
...@@ -772,12 +793,11 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -772,12 +793,11 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
siglen+sf_extension, siglen+sf_extension,
ru->nb_tx, ru->nb_tx,
flags); flags);
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx, LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %d\n",ru->idx,
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot); (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen); AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen);
} }
}
} }
......
...@@ -403,6 +403,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB, ...@@ -403,6 +403,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
void nr_phy_config_request(NR_PHY_Config_t *phy_config) { void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
uint8_t Mod_id = phy_config->Mod_id; uint8_t Mod_id = phy_config->Mod_id;
int return_tdd;
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id]->frame_parms; NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id]->frame_parms;
nfapi_nr_config_request_t *gNB_config = &RC.gNB[Mod_id]->gNB_config; nfapi_nr_config_request_t *gNB_config = &RC.gNB[Mod_id]->gNB_config;
gNB_config->nfapi_config.rf_bands.rf_band[0] = phy_config->cfg->nfapi_config.rf_bands.rf_band[0]; //22 gNB_config->nfapi_config.rf_bands.rf_band[0] = phy_config->cfg->nfapi_config.rf_bands.rf_band[0]; //22
...@@ -417,6 +418,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { ...@@ -417,6 +418,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
gNB_config->sch_config.ssb_scg_position_in_burst.value= phy_config->cfg->sch_config.ssb_scg_position_in_burst.value; gNB_config->sch_config.ssb_scg_position_in_burst.value= phy_config->cfg->sch_config.ssb_scg_position_in_burst.value;
gNB_config->sch_config.ssb_periodicity.value = phy_config->cfg->sch_config.ssb_periodicity.value; gNB_config->sch_config.ssb_periodicity.value = phy_config->cfg->sch_config.ssb_periodicity.value;
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) { if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
gNB_config->subframe_config.duplex_mode.value = FDD; gNB_config->subframe_config.duplex_mode.value = FDD;
} else { } else {
...@@ -424,6 +426,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { ...@@ -424,6 +426,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
} }
memcpy((void*)&gNB_config->rach_config,(void*)&phy_config->cfg->rach_config,sizeof(phy_config->cfg->rach_config)); memcpy((void*)&gNB_config->rach_config,(void*)&phy_config->cfg->rach_config,sizeof(phy_config->cfg->rach_config));
memcpy((void*)&gNB_config->tdd_ul_dl_config,(void*)&phy_config->cfg->tdd_ul_dl_config,sizeof(phy_config->cfg->tdd_ul_dl_config));
RC.gNB[Mod_id]->mac_enabled = 1; RC.gNB[Mod_id]->mac_enabled = 1;
fp->dl_CarrierFreq = from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value); fp->dl_CarrierFreq = from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
...@@ -441,9 +444,24 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { ...@@ -441,9 +444,24 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
(unsigned long long)fp->dl_CarrierFreq, (unsigned long long)fp->dl_CarrierFreq,
(unsigned long long)fp->ul_CarrierFreq); (unsigned long long)fp->ul_CarrierFreq);
nr_init_frame_parms(gNB_config, fp); nr_init_frame_parms(gNB_config, fp);
if(gNB_config->subframe_config.duplex_mode.value == TDD){
return_tdd = set_tdd_config_nr(fp,
gNB_config->tdd_ul_dl_config.dl_ul_periodicity.value,
gNB_config->tdd_ul_dl_config.nrofDownlinkSlots.value,
gNB_config->tdd_ul_dl_config.nrofDownlinkSymbols.value,
gNB_config->tdd_ul_dl_config.nrofUplinkSlots.value,
gNB_config->tdd_ul_dl_config.nrofUplinkSymbols.value
);
if (return_tdd !=0){
LOG_E(PHY,"TDD configuration can not be done\n");
}
else LOG_I(PHY,"TDD has been properly configurated\n");
}
if (RC.gNB[Mod_id]->configured == 1) { if (RC.gNB[Mod_id]->configured == 1) {
LOG_E(PHY,"Already gNB already configured, do nothing\n"); LOG_E(PHY,"Already gNB already configured, do nothing\n");
return; return;
......
...@@ -97,6 +97,7 @@ SystemInformationBlockType1_nr_t; ...@@ -97,6 +97,7 @@ SystemInformationBlockType1_nr_t;
#define NR_DOWNLINK_SLOT (0x01) #define NR_DOWNLINK_SLOT (0x01)
#define NR_UPLINK_SLOT (0x02) #define NR_UPLINK_SLOT (0x02)
#define NR_S_SLOT (0x03)
#define FRAME_DURATION_MICRO_SEC (10000) /* frame duration in microsecond */ #define FRAME_DURATION_MICRO_SEC (10000) /* frame duration in microsecond */
......
...@@ -272,7 +272,7 @@ void nr_fep0(RU_t *ru, int first_half) { ...@@ -272,7 +272,7 @@ void nr_fep0(RU_t *ru, int first_half) {
end_symbol = NR_SYMBOLS_PER_SLOT; end_symbol = NR_SYMBOLS_PER_SLOT;
} }
LOG_D(PHY,"In fep0 for slot = %d, first_half = %d, start_symbol = %d, end_symbol = %d\n", proc->tti_rx, first_half, start_symbol, end_symbol); LOG_I(PHY,"In fep0 for slot = %d, first_half = %d, start_symbol = %d, end_symbol = %d\n", proc->tti_rx, first_half, start_symbol, end_symbol);
// printf("fep0: slot %d\n",slot); // printf("fep0: slot %d\n",slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1);
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include "SCHED_NR_UE/defs.h" #include "SCHED_NR_UE/defs.h"
#include "PHY/defs_nr_UE.h" #include "PHY/defs_nr_UE.h"
#include "SCHED_NR_UE/phy_frame_config_nr.h" #include "SCHED_NR_UE/phy_frame_config_nr.h"
#include "PHY/defs_common.h"
#include "PHY/impl_defs_top.h"
/******************************************************************* /*******************************************************************
* *
...@@ -55,8 +57,7 @@ int set_tdd_config_nr(NR_DL_FRAME_PARMS *frame_parms, int dl_UL_TransmissionPeri ...@@ -55,8 +57,7 @@ int set_tdd_config_nr(NR_DL_FRAME_PARMS *frame_parms, int dl_UL_TransmissionPeri
{ {
TDD_UL_DL_configCommon_t *p_tdd_ul_dl_configuration; TDD_UL_DL_configCommon_t *p_tdd_ul_dl_configuration;
int slot_number = 0; int slot_number = 0;
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(frame_parms->slots_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
/* allocate buffer for configuration structure */ /* allocate buffer for configuration structure */
p_tdd_ul_dl_configuration = calloc( 1, sizeof(TDD_UL_DL_configCommon_t)); p_tdd_ul_dl_configuration = calloc( 1, sizeof(TDD_UL_DL_configCommon_t));
...@@ -86,26 +87,28 @@ int set_tdd_config_nr(NR_DL_FRAME_PARMS *frame_parms, int dl_UL_TransmissionPeri ...@@ -86,26 +87,28 @@ int set_tdd_config_nr(NR_DL_FRAME_PARMS *frame_parms, int dl_UL_TransmissionPeri
AssertFatal(nrofDownlinkSymbols + nrofUplinkSymbols < 14,"illegal symbol configuration DL %d, UL %d\n",nrofDownlinkSymbols,nrofUplinkSymbols); AssertFatal(nrofDownlinkSymbols + nrofUplinkSymbols < 14,"illegal symbol configuration DL %d, UL %d\n",nrofDownlinkSymbols,nrofUplinkSymbols);
while(slot_number != nb_slots_to_set) { while(slot_number != nb_slots_to_set) {
for (int number_of_slot = 0; number_of_slot < nrofDownlinkSlots; number_of_slot++) { for (int number_of_slot = 0; number_of_slot < nrofDownlinkSlots; number_of_slot++) {
frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_DOWNLINK_SLOT; frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_DOWNLINK_SLOT;
printf("slot %d set as downlink\n",slot_number);
slot_number++; slot_number++;
} }
if (p_tdd_ul_dl_configuration->nrofDownlinkSymbols != 0) { if (p_tdd_ul_dl_configuration->nrofDownlinkSymbols != 0 || p_tdd_ul_dl_configuration->nrofUplinkSymbols != 0) {
LOG_E(PHY,"set_tdd_configuration_nr: downlink symbol for slot is not supported for tdd configuration \n"); frame_parms->tdd_uplink_nr[slot_number] = (1<<nrofUplinkSymbols) - 1;
return (-1); printf("slot %d set as SL\n",slot_number);
slot_number++;
} }
for (int number_of_slot = 0; number_of_slot < nrofUplinkSlots; number_of_slot++) { for (int number_of_slot = 0; number_of_slot < nrofUplinkSlots; number_of_slot++) {
frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_UPLINK_SLOT; frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_UPLINK_SLOT;
printf("slot %d set as uplink\n",slot_number);
slot_number++; slot_number++;
} }
if (p_tdd_ul_dl_configuration->nrofUplinkSymbols != 0) { /*if (p_tdd_ul_dl_configuration->nrofUplinkSymbols != 0) {
LOG_E(PHY,"set_tdd_configuration_nr: uplink symbol for slot is not supported for tdd configuration \n"); LOG_E(PHY,"set_tdd_configuration_nr: uplink symbol for slot is not supported for tdd configuration \n");
return (-1); return (-1);
} }*/
} }
if (frame_parms->p_tdd_UL_DL_ConfigurationCommon2 != NULL) { if (frame_parms->p_tdd_UL_DL_ConfigurationCommon2 != NULL) {
...@@ -261,16 +264,18 @@ int nr_slot_select(NR_DL_FRAME_PARMS *frame_parms, int nr_frame, int nr_tti) ...@@ -261,16 +264,18 @@ int nr_slot_select(NR_DL_FRAME_PARMS *frame_parms, int nr_frame, int nr_tti)
if (frame_parms->tdd_uplink_nr[nr_tti] == NR_TDD_UPLINK_SLOT) { if (frame_parms->tdd_uplink_nr[nr_tti] == NR_TDD_UPLINK_SLOT) {
return (NR_UPLINK_SLOT); return (NR_UPLINK_SLOT);
} }
else { else if(frame_parms->tdd_uplink_nr[nr_tti] == NR_TDD_DOWNLINK_SLOT){
return (NR_DOWNLINK_SLOT); return (NR_DOWNLINK_SLOT);
} }
else return (NR_S_SLOT);
} }
else if ((frame_parms->tdd_uplink_nr[(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti] == NR_TDD_UPLINK_SLOT)) { else if ((frame_parms->tdd_uplink_nr[(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti] == NR_TDD_UPLINK_SLOT)) {
return (NR_UPLINK_SLOT); return (NR_UPLINK_SLOT);
} }
else { else if ((frame_parms->tdd_uplink_nr[(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti] == NR_TDD_DOWNLINK_SLOT)) {
return (NR_DOWNLINK_SLOT); return (NR_DOWNLINK_SLOT);
} }
else return (NR_S_SLOT);
} }
/******************************************************************* /*******************************************************************
......
...@@ -87,6 +87,12 @@ void config_common(int Mod_idP, ...@@ -87,6 +87,12 @@ void config_common(int Mod_idP,
cfg->subframe_config.duplex_mode.value = 1; cfg->subframe_config.duplex_mode.value = 1;
cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG; cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
cfg->num_tlv++; cfg->num_tlv++;
cfg->tdd_ul_dl_config.referenceSubcarrierSpacing.value = scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing;
cfg->tdd_ul_dl_config.dl_ul_periodicity.value = 5000;//scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;// rakesh:need to configure properly
cfg->tdd_ul_dl_config.nrofDownlinkSlots.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots;
cfg->tdd_ul_dl_config.nrofDownlinkSymbols.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols;
cfg->tdd_ul_dl_config.nrofUplinkSlots.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
cfg->tdd_ul_dl_config.nrofUplinkSymbols.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols;
/// In NR DL and UL will be different band /// In NR DL and UL will be different band
cfg->nfapi_config.rf_bands.number_rf_bands = 1; cfg->nfapi_config.rf_bands.number_rf_bands = 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