Commit db326bbf authored by Guy De Souza's avatar Guy De Souza

SSB repositioning

parent fb23ffd6
......@@ -684,6 +684,7 @@ typedef struct {
nfapi_uint16_tlv_t ssb_position_in_burst;
nfapi_uint16_tlv_t ssb_periodicity;
nfapi_uint16_tlv_t ss_pbch_block_power;
nfapi_uint16_tlv_t n_ssb_crb;
} nfapi_sch_config_t;
#define NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001E
......@@ -694,6 +695,7 @@ typedef struct {
#define NFAPI_SCH_CONFIG_SSB_POSITION_IN_BURST 0x0023
#define NFAPI_SCH_CONFIG_SSB_PERIODICITY 0x0024
#define NFAPI_SCH_CONFIG_SS_PBCH_BLOCK_POWER 0x0025
#define NFAPI_SCH_CONFIG_N_SSB_CRB 0x0025
typedef struct {
nfapi_uint16_tlv_t configuration_index;
......
......@@ -347,6 +347,8 @@ void nr_phy_config_request(PHY_VARS_gNB *gNB)
gNB_config->rf_config.ul_channel_bandwidth.value = 106;
gNB_config->sch_config.half_frame_index.value = 0;
gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
gNB_config->sch_config.n_ssb_crb.value = 86;
gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
gNB->mac_enabled = 1;
......
......@@ -79,14 +79,14 @@ int nr_phy_init_RU(RU_t *ru) {
LOG_I(PHY,"[INIT] common.txdata_BF= %p (%lu bytes)\n",ru->common.txdataF_BF,
ru->nb_tx*sizeof(int32_t*));
for (i=0; i<ru->nb_tx; i++) {
ru->common.txdataF_BF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t) );
ru->common.txdataF_BF[i] = (int32_t*)malloc16_clear(fp->samples_per_subframe_wCP*sizeof(int32_t) );
LOG_I(PHY,"txdataF_BF[%d] %p for RU %d\n",i,ru->common.txdataF_BF[i],ru->idx);
}
// allocate FFT output buffers (RX)
ru->common.rxdataF = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
for (i=0; i<ru->nb_rx; i++) {
// allocate 2 subframes of I/Q signal data (frequency)
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->samples_per_frame_wCP) );
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->samples_per_subframe_wCP) );
LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx);
}
......
......@@ -63,7 +63,7 @@ int nr_generate_pss( int16_t *d_pss,
{
// PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from
k = frame_parms->first_carrier_offset + config->sch_config.ssb_subcarrier_offset.value + 56; //and
k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
l = ssb_start_symbol;
for (m = 0; m < NR_PSS_LENGTH; m++) {
......
......@@ -73,7 +73,7 @@ int nr_generate_sss( int16_t *d_sss,
{
// SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from
k = frame_parms->first_carrier_offset + config->sch_config.ssb_subcarrier_offset.value + 56; //and
k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
l = ssb_start_symbol + 2;
for (m = 0; m < NR_SSS_LENGTH; m++) {
......
......@@ -204,6 +204,8 @@ typedef struct {
uint32_t samples_per_subframe_wCP;
/// Number of samples in a radio frame without CP
uint32_t samples_per_frame_wCP;
/// Start in Subcarrier index of the SSB block
uint16_t ssb_start_subcarrier;
} NR_DL_FRAME_PARMS;
struct PHY_VARS_gNB_s;
......
......@@ -45,5 +45,6 @@ int nr_generate_sss( int16_t *d_sss,
uint8_t ssb_start_symbol,
nfapi_config_request_t* config,
NR_DL_FRAME_PARMS *frame_parms);
void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
#endif
......@@ -32,8 +32,7 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "SCHED_NR/defs.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
......
......@@ -31,8 +31,7 @@
*/
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "SCHED_NR/defs.h"
nr_subframe_t nr_subframe_select(nfapi_config_request_t *cfg,unsigned char subframe)
......@@ -75,7 +74,8 @@ int nr_get_ssb_start_symbol(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
return symbol;
}
void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg)
void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
{
cfg->sch_config.ssb_subcarrier_offset.value = 0;
int start_rb = cfg->sch_config.n_ssb_crb.value / pow(2,cfg->subframe_config.numerology_index_mu.value);
fp->ssb_start_subcarrier = 12 * start_rb + cfg->sch_config.ssb_subcarrier_offset.value;
}
......@@ -51,7 +51,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) {
LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d\n",frame,subframe);
int ssb_start_symbol = nr_get_ssb_start_symbol(cfg, fp);
//nr_set_ssb_first_subcarrier(cfg);
nr_set_ssb_first_subcarrier(cfg, fp);
if (subframe == ss_subframe)
{
......
......@@ -814,9 +814,9 @@ void tx_rf(RU_t *ru) {
for (i=0; i<ru->nb_tx; i++)
txp[i] = (void*)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_subframe)-sf_extension];
/*if (proc->subframe_tx == 9){
write_output("txdataF_frame.m","txdataF_frame",&ru->common.txdataF_BF[i],fp->samples_per_frame_wCP, 1, 1);
write_output("txdata_frame.m","txdata_frame",&ru->common.txdata[i],fp->samples_per_frame, 1, 1);
/*if (proc->subframe_tx == 0){
write_output("txdataF_frame.m","txdataF_frame",&ru->common.txdataF_BF[i],fp->samples_per_subframe_wCP, 1, 1);
write_output("txdata_frame.m","txdata_frame",&ru->common.txdata[i],fp->samples_per_subframe, 1, 1);
}*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
......
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