Commit a9c8b1b6 authored by 111's avatar 111

oxgrg changes for 4 ants

parent e4ed054c
...@@ -228,12 +228,16 @@ void rx_func(void *param) { ...@@ -228,12 +228,16 @@ void rx_func(void *param) {
L1_nr_prach_procedures(gNB,frame_rx,slot_rx); L1_nr_prach_procedures(gNB,frame_rx,slot_rx);
//apply the rx signal rotation here //apply the rx signal rotation here
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) { //for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
apply_nr_rotation_ul(&gNB->frame_parms, for (int aa = 0; aa < 4; aa++) {
gNB->common_vars.rxdataF[aa], if (gNB->common_vars.rxdataF[aa] != NULL)
slot_rx, {
0, apply_nr_rotation_ul(&gNB->frame_parms,
gNB->frame_parms.Ncp==EXTENDED?12:14); gNB->common_vars.rxdataF[aa],
slot_rx,
0,
gNB->frame_parms.Ncp==EXTENDED?12:14);
}
} }
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx); phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
} }
......
...@@ -852,23 +852,36 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { ...@@ -852,23 +852,36 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
for (i=0; i<ru->nb_tx; i++) { for (i=0; i<ru->nb_tx; i++) {
if (ru->if_frequency == 0) { if (ru->if_frequency == 0) {
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq; cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
} else if (ru->if_freq_offset) { } else if (ru->if_freq_offset) {
cfg->tx_freq[i] = (double)(ru->if_frequency); cfg->tx_freq[i] = (double)(ru->if_frequency);
cfg->rx_freq[i] = (double)(ru->if_frequency + ru->if_freq_offset);
LOG_I(PHY, "Setting IF TX frequency to %lu Hz with IF RX frequency offset %d Hz\n", ru->if_frequency, ru->if_freq_offset); LOG_I(PHY, "Setting IF TX frequency to %lu Hz with IF RX frequency offset %d Hz\n", ru->if_frequency, ru->if_freq_offset);
} else { } else {
cfg->tx_freq[i] = (double)ru->if_frequency; cfg->tx_freq[i] = (double)ru->if_frequency;
}
cfg->tx_gain[i] = ru->att_tx;
cfg->configFilename = rf_config_file;
LOG_I(PHY, "Channel %d: setting tx_gain offset %.0f, tx_freq %.0f Hz, tune_offset %.0f Hz, sample_rate %.0f Hz\n",
i, cfg->tx_gain[i],
cfg->tx_freq[i],
cfg->tune_offset,
cfg->sample_rate);
}
for (i=0; i<ru->nb_rx; i++) {
if (ru->if_frequency == 0) {
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
} else if (ru->if_freq_offset) {
cfg->rx_freq[i] = (double)(ru->if_frequency + ru->if_freq_offset);
LOG_I(PHY, "Setting IF RX frequency to %lu Hz with IF RX frequency offset %d Hz\n", ru->if_frequency, ru->if_freq_offset);
} else {
cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq); cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq);
} }
cfg->tx_gain[i] = ru->att_tx;
cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx; cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx;
cfg->configFilename = rf_config_file; cfg->configFilename = rf_config_file;
LOG_I(PHY, "Channel %d: setting tx_gain offset %.0f, rx_gain offset %.0f, tx_freq %.0f Hz, rx_freq %.0f Hz, tune_offset %.0f Hz, sample_rate %.0f Hz\n", LOG_I(PHY, "Channel %d: setting rx_gain offset %.0f, trx_freq %.0f Hz, tune_offset %.0f Hz, sample_rate %.0f Hz\n",
i, cfg->tx_gain[i], i,
cfg->rx_gain[i], cfg->rx_gain[i],
cfg->tx_freq[i],
cfg->rx_freq[i], cfg->rx_freq[i],
cfg->tune_offset, cfg->tune_offset,
cfg->sample_rate); cfg->sample_rate);
...@@ -1422,7 +1435,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -1422,7 +1435,7 @@ void init_RU_proc(RU_t *ru) {
pthread_mutex_init( &proc->mutex_emulateRF,NULL); pthread_mutex_init( &proc->mutex_emulateRF,NULL);
pthread_cond_init( &proc->cond_emulateRF, NULL); pthread_cond_init( &proc->cond_emulateRF, NULL);
threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "ru_thread", ru->tpcores[0], OAI_PRIORITY_RT_MAX ); threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "ru_thread", /*ru->tpcores[0]*/ 4, OAI_PRIORITY_RT_MAX );
if(emulate_rf) if(emulate_rf)
threadCreate( &proc->pthread_emulateRF, emulatedRF_thread, (void *)proc, "emulateRF", -1, OAI_PRIORITY_RT ); threadCreate( &proc->pthread_emulateRF, emulatedRF_thread, (void *)proc, "emulateRF", -1, OAI_PRIORITY_RT );
if (opp_enabled == 1) if (opp_enabled == 1)
......
...@@ -181,6 +181,11 @@ void main() ...@@ -181,6 +181,11 @@ void main()
printf("socket ERROR !!! \n\n\n"); printf("socket ERROR !!! \n\n\n");
return; return;
} }
else if (recv_len == 32768)
{
recv_len = recv(iSocketFD, &buf[recv_len], RIC_INTERFACE_SOCKET_MAX_LEN, 0);
recv_len += 32768;
}
printf("Received(%d):, msg len %d, cnt %d\n", recv_len, pdata[0], pdata[1]); printf("Received(%d):, msg len %d, cnt %d\n", recv_len, pdata[0], pdata[1]);
// for(int i=0;i<20;i++) // for(int i=0;i<20;i++)
...@@ -193,7 +198,7 @@ void main() ...@@ -193,7 +198,7 @@ void main()
{ {
memcpy(buf_debug, buf, recv_len); memcpy(buf_debug, buf, recv_len);
FILE *fd; FILE *fd;
if ((fd = fopen("srs_data.am","w")) != NULL) { if ((fd = fopen("srs_data_4ant.am","w")) != NULL) {
fwrite((void *)buf_debug, fwrite((void *)buf_debug,
sizeof(int32_t), sizeof(int32_t),
recv_len/4, recv_len/4,
......
...@@ -622,9 +622,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -622,9 +622,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
/// Transport init necessary for NR synchro /// Transport init necessary for NR synchro
init_nr_transport(gNB); init_nr_transport(gNB);
LOG_I(PHY, "prx %d~~~~~~~~~~~~~~~~~~~~\n", Prx);
common_vars->txdataF = (int32_t **)malloc16(Ptx*sizeof(int32_t*)); common_vars->txdataF = (int32_t **)malloc16(Ptx*sizeof(int32_t*));
common_vars->rxdataF = (int32_t **)malloc16(Prx*sizeof(int32_t*)); //common_vars->rxdataF = (int32_t **)malloc16(Prx*sizeof(int32_t*));
common_vars->rxdataF = (int32_t **)malloc16(4*sizeof(int32_t*));
/* Do NOT allocate per-antenna txdataF/rxdataF: the gNB gets a pointer to the /* Do NOT allocate per-antenna txdataF/rxdataF: the gNB gets a pointer to the
* RU to copy/recover freq-domain memory from there */ * RU to copy/recover freq-domain memory from there */
common_vars->beam_id = (uint8_t **)malloc16(Ptx*sizeof(uint8_t*)); common_vars->beam_id = (uint8_t **)malloc16(Ptx*sizeof(uint8_t*));
......
...@@ -2129,8 +2129,8 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -2129,8 +2129,8 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
uint pusch_amp; uint pusch_amp;
if (symbol == (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols - 1)) { if (symbol == (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols - 1)) {
static int cnt = 0; static int cnt = 0;
//if (((cnt & 0x1F) == 0) && (cnt < 0x100)) if (((cnt & 0x7F) == 0) || (cnt < 0x80))
if ( (cnt < 0x100)) //if ( (cnt < 0x100))
{ {
pusch_amp = cal_amp(&gNB->pusch_vars[ulsch_id]->rxdataF_ext[0][symbol * nb_re_pusch], nb_re_pusch); pusch_amp = cal_amp(&gNB->pusch_vars[ulsch_id]->rxdataF_ext[0][symbol * nb_re_pusch], nb_re_pusch);
//LOG_I(PHY, "UL AMP frame %d %d, symbol %d, rbs %d, res %d, time %d, freq %d \n", frame, slot, symbol, nb_re_pusch/12, nb_re_pusch, g_ul_time_amp[symbol], g_ul_freq_amp[symbol], pusch_amp); //LOG_I(PHY, "UL AMP frame %d %d, symbol %d, rbs %d, res %d, time %d, freq %d \n", frame, slot, symbol, nb_re_pusch/12, nb_re_pusch, g_ul_time_amp[symbol], g_ul_freq_amp[symbol], pusch_amp);
......
...@@ -242,21 +242,26 @@ int nr_cap_srs_signal(PHY_VARS_gNB *gNB, ...@@ -242,21 +242,26 @@ int nr_cap_srs_signal(PHY_VARS_gNB *gNB,
int len = frame_parms->N_RB_DL * 6; int len = frame_parms->N_RB_DL * 6;
int32_t *dst = ns_srs_cap->dmrsData; int32_t *dst = ns_srs_cap->dmrsData;
int32_t *src; int32_t *src;
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) int ant_num = 0;
for (int ant = 0; ant < 4; ant++)
{ {
for (int l_line = 0; l_line < N_symb_SRS; l_line++) if (rxdataF[ant]!=NULL)
{ {
src = (int32_t *)&rxdataF[ant][symbol_offset + l_line * gNB->frame_parms.ofdm_symbol_size]; for (int l_line = 0; l_line < N_symb_SRS; l_line++)
memcpy(dst, &src[gNB->frame_parms.ofdm_symbol_size - len], len*4); {
dst += len; src = (int32_t *)&rxdataF[ant][symbol_offset + l_line * gNB->frame_parms.ofdm_symbol_size];
memcpy(dst, &src[0], len*4); memcpy(dst, &src[gNB->frame_parms.ofdm_symbol_size - len], len*4);
dst += len; dst += len;
} memcpy(dst, &src[0], len*4);
dst += len;
}
ant_num++;
}
} }
#ifdef SEND_BY_SOCKET #ifdef SEND_BY_SOCKET
ric_send_buf = ns_srs_cap; ric_send_buf = ns_srs_cap;
ric_send_len = 40*2+273*12*frame_parms->nb_antennas_rx*N_symb_SRS*4;//for test ric_send_len = 40*2+273*12*ant_num*N_symb_SRS*4;//for test
sem_post(&ric_send_sem); sem_post(&ric_send_sem);
//LOG_I(PHY,"sem_post(&ric_send_sem) buf %p, size %d pos %d \n\n\n",ric_send_buf,ric_send_len, pos); //LOG_I(PHY,"sem_post(&ric_send_sem) buf %p, size %d pos %d \n\n\n",ric_send_buf,ric_send_len, pos);
g_dmrs_cnt++; g_dmrs_cnt++;
......
...@@ -218,7 +218,7 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, ...@@ -218,7 +218,7 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
uint16_t m_SRS_b = srs_bandwidth_config[C_SRS][B_SRS][0]; // Number of resource blocks uint16_t m_SRS_b = srs_bandwidth_config[C_SRS][B_SRS][0]; // Number of resource blocks
uint16_t M_sc_b_SRS = m_SRS_b * NR_NB_SC_PER_RB/K_TC; // Length of the SRS sequence uint16_t M_sc_b_SRS = m_SRS_b * NR_NB_SC_PER_RB/K_TC; // Length of the SRS sequence
//#ifdef SRS_DEBUG #ifdef SRS_DEBUG
if ((frame_number % 1024) == 8) if ((frame_number % 1024) == 8)
{ {
LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number); LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number);
...@@ -243,7 +243,7 @@ if ((frame_number % 1024) == 8) ...@@ -243,7 +243,7 @@ if ((frame_number % 1024) == 8)
LOG_I(NR_PHY,"m_SRS_b = %i\n", m_SRS_b); LOG_I(NR_PHY,"m_SRS_b = %i\n", m_SRS_b);
LOG_I(NR_PHY,"M_sc_b_SRS = %i\n", M_sc_b_SRS); LOG_I(NR_PHY,"M_sc_b_SRS = %i\n", M_sc_b_SRS);
} }
//#endif #endif
// Validation of SRS config parameters // Validation of SRS config parameters
......
...@@ -865,7 +865,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { ...@@ -865,7 +865,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
NR_gNB_SRS_t *srs = gNB->srs[i]; NR_gNB_SRS_t *srs = gNB->srs[i];
if (srs) { if (srs) {
if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) { if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) {
LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i\n", frame_rx, slot_rx, i); LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i ant rx %d\n", frame_rx, slot_rx, i, gNB->frame_parms.nb_antennas_rx);
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu;
......
...@@ -386,6 +386,8 @@ int trx_oxgrf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg ...@@ -386,6 +386,8 @@ int trx_oxgrf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
int status; int status;
int tx_rf_num = 1;
int rx_rf_num = 1;
oxgrf_state_t *oxgrf = (oxgrf_state_t*)malloc(sizeof(oxgrf_state_t)); oxgrf_state_t *oxgrf = (oxgrf_state_t*)malloc(sizeof(oxgrf_state_t));
...@@ -449,6 +451,11 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -449,6 +451,11 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
oxgrf->rx_num_channels = openair0_cfg[0].rx_num_channels; oxgrf->rx_num_channels = openair0_cfg[0].rx_num_channels;
oxgrf->tx_num_channels = openair0_cfg[0].tx_num_channels; oxgrf->tx_num_channels = openair0_cfg[0].tx_num_channels;
if (oxgrf->rx_num_channels > 2)
rx_rf_num = 2;
if (oxgrf->tx_num_channels > 2)
tx_rf_num = 2;
int auxdac1 = 0; int auxdac1 = 0;
char args[64]; char args[64];
if (openair0_cfg[0].sdr_addrs == NULL) { if (openair0_cfg[0].sdr_addrs == NULL) {
...@@ -507,75 +514,81 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -507,75 +514,81 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
oxgrf_set_duplex_select (oxgrf->dev, 0, FDD); oxgrf_set_duplex_select (oxgrf->dev, 0, FDD);
oxgrf_set_trxsw_fpga_enable(oxgrf->dev, 0, 0); oxgrf_set_trxsw_fpga_enable(oxgrf->dev, 0, 0);
oxgrf_set_rx_ant_enable (oxgrf->dev, 0, 1); oxgrf_set_rx_ant_enable (oxgrf->dev, 0, 1);
oxgrf_set_tx_fir_en_dis (oxgrf->dev, 0, 0);
oxgrf_set_rx_fir_en_dis (oxgrf->dev, 0, 0); for (int rfid = 0; rfid < rx_rf_num; rfid++)
{
// RX port Initialize oxgrf_set_rx_fir_en_dis (oxgrf->dev, 0, 0);
if ((status = oxgrf_set_rx_lo_freq(oxgrf->dev, 0, (uint64_t)(openair0_cfg->rx_freq[0]))) < 0) {
printf("[oxgrf] Failed to set RX frequency\n"); // RX port Initialize
} else if ((status = oxgrf_set_rx_lo_freq(oxgrf->dev, rfid, (uint64_t)(openair0_cfg->rx_freq[0]))) < 0) {
printf("[oxgrf] set RX frequency to %lu\n",(uint64_t)(openair0_cfg->rx_freq[0])); printf("[oxgrf %d] Failed to set RX frequency\n", rfid);
if ((status = oxgrf_set_rx_sampling_freq(oxgrf->dev, 0, (uint32_t)(openair0_cfg->sample_rate))) < 0) { } else
printf("[oxgrf] Failed to set RX sample rate\n"); printf("[oxgrf %d] set RX frequency to %lu\n", rfid,(uint64_t)(openair0_cfg->rx_freq[0]));
} else if ((status = oxgrf_set_rx_sampling_freq(oxgrf->dev, rfid, (uint32_t)(openair0_cfg->sample_rate))) < 0) {
printf("[oxgrf] set RX sample rate to %u\n", (uint32_t)(openair0_cfg->sample_rate)); printf("[oxgrf %d] Failed to set RX sample rate\n", rfid);
if ((status = oxgrf_set_rx_rf_bandwidth(oxgrf->dev, 0, (uint32_t)(openair0_cfg->rx_bw))) < 0) { } else
printf("[oxgrf] Failed to set RX bandwidth\n"); printf("[oxgrf %d] set RX sample rate to %u\n", rfid, (uint32_t)(openair0_cfg->sample_rate));
} else if ((status = oxgrf_set_rx_rf_bandwidth(oxgrf->dev, rfid, (uint32_t)(openair0_cfg->rx_bw))) < 0) {
printf("[oxgrf] set RX bandwidth to %u\n",(uint32_t)(openair0_cfg->rx_bw)); printf("[oxgrf %d] Failed to set RX bandwidth\n, rfid");
} else
if ((status = oxgrf_set_rx1_gain_control_mode(oxgrf->dev, 0, 0)) < 0){ printf("[oxgrf %d] set RX bandwidth to %u\n", rfid,(uint32_t)(openair0_cfg->rx_bw));
printf("[oxgrf] Failed to set RX1 Gain Control Mode\n");
} else
printf("[oxgrf] set RX1 Gain Control Mode MGC\n");
if ((status = oxgrf_set_rx1_rf_gain(oxgrf->dev, 0, (uint32_t)(openair0_cfg->rx_gain[0] > 65?65:openair0_cfg->rx_gain[0]))) < 0) {
printf("[oxgrf] Failed to set RX1 gain\n");
} else
printf("[oxgrf] set RX1 gain to %u\n",(uint32_t)(openair0_cfg->rx_gain[0]));
if(oxgrf->rx_num_channels > 1) { if ((status = oxgrf_set_rx1_gain_control_mode(oxgrf->dev, rfid, 0)) < 0){
if ((status = oxgrf_set_rx2_gain_control_mode(oxgrf->dev, 0, 0)) < 0){ printf("[oxgrf %d] Failed to set RX1 Gain Control Mode\n", rfid);
printf("[oxgrf] Failed to set RX2 Gain Control Mode\n");
} else } else
printf("[oxgrf] set RX2 Gain Control Mode MGC\n"); printf("[oxgrf %d] set RX1 Gain Control Mode MGC\n", rfid);
if ((status = oxgrf_set_rx2_rf_gain(oxgrf->dev, 0, (uint32_t)(openair0_cfg->rx_gain[1] > 65?65:openair0_cfg->rx_gain[1]))) < 0) { if ((status = oxgrf_set_rx1_rf_gain(oxgrf->dev, rfid, (uint32_t)(openair0_cfg->rx_gain[0] > 65?65:openair0_cfg->rx_gain[0]))) < 0) {
printf("[oxgrf] Failed to set RX2 gain\n"); printf("[oxgrf %d] Failed to set RX1 gain\n", rfid);
} else } else
printf("[oxgrf] set RX2 gain to %u\n",(uint32_t)(openair0_cfg->rx_gain[1])); printf("[oxgrf %d] set RX1 gain to %u\n", rfid,(uint32_t)(openair0_cfg->rx_gain[0]));
if(oxgrf->rx_num_channels > rfid*2+1) {
if ((status = oxgrf_set_rx2_gain_control_mode(oxgrf->dev, rfid, 0)) < 0){
printf("[oxgrf %d] Failed to set RX2 Gain Control Mode\n", rfid);
} else
printf("[oxgrf %d] set RX2 Gain Control Mode MGC\n", rfid);
if ((status = oxgrf_set_rx2_rf_gain(oxgrf->dev, rfid, (uint32_t)(openair0_cfg->rx_gain[1] > 65?65:openair0_cfg->rx_gain[1]))) < 0) {
printf("[oxgrf %d] Failed to set RX2 gain\n", rfid);
} else
printf("[oxgrf %d] set RX2 gain to %u\n", rfid, (uint32_t)(openair0_cfg->rx_gain[1]));
}
} }
// TX port Initialize // TX port Initialize
if ((status = oxgrf_set_tx_lo_freq(oxgrf->dev, 0, (uint64_t)openair0_cfg->tx_freq[0])) < 0) { for (int rfid = 0; rfid < tx_rf_num; rfid++)
printf("[oxgrf] Failed to set TX frequency\n"); {
} else oxgrf_set_tx_fir_en_dis (oxgrf->dev, 0, 0);
printf("[oxgrf] set TX Frequency to %lu\n", (uint64_t)openair0_cfg->tx_freq[0]);
if ((status = oxgrf_set_tx_sampling_freq(oxgrf->dev, 0, (uint32_t)openair0_cfg->sample_rate)) < 0) { if ((status = oxgrf_set_tx_lo_freq(oxgrf->dev, rfid, (uint64_t)openair0_cfg->tx_freq[0])) < 0) {
printf("[oxgrf] Failed to set TX sample rate\n"); printf("[oxgrf %d] Failed to set TX frequency\n", rfid);
} else } else
printf("[oxgrf] set TX sampling rate to %u\n", (uint32_t)openair0_cfg->sample_rate); printf("[oxgrf %d] set TX Frequency to %lu\n", rfid, (uint64_t)openair0_cfg->tx_freq[0]);
if ((status = oxgrf_set_tx_rf_bandwidth(oxgrf->dev, 0, (uint32_t)openair0_cfg->tx_bw)) <0) { if ((status = oxgrf_set_tx_sampling_freq(oxgrf->dev, rfid, (uint32_t)openair0_cfg->sample_rate)) < 0) {
printf("[oxgrf] Failed to set TX bandwidth\n"); printf("[oxgrf %d] Failed to set TX sample rate\n", rfid, rfid);
} else } else
printf("[oxgrf] set TX bandwidth to %u\n", (uint32_t)openair0_cfg->tx_bw); printf("[oxgrf %d] set TX sampling rate to %u\n", rfid, (uint32_t)openair0_cfg->sample_rate);
int tx_gain = ((uint32_t)openair0_cfg->tx_gain[0] > 90?90:(uint32_t)openair0_cfg->tx_gain[0]); if ((status = oxgrf_set_tx_rf_bandwidth(oxgrf->dev, rfid, (uint32_t)openair0_cfg->tx_bw)) <0) {
if ((status = oxgrf_set_tx1_attenuation(oxgrf->dev, 0, (90 - tx_gain) * 1000)) < 0) { printf("[oxgrf %d] Failed to set TX bandwidth\n", rfid);
printf("[oxgrf] Failed to set TX1 gain\n"); } else
} else printf("[oxgrf %d] set TX bandwidth to %u\n", rfid, (uint32_t)openair0_cfg->tx_bw);
printf("[oxgrf] set the TX1 gain to %d\n", (uint32_t)openair0_cfg->tx_gain[0]);
if(oxgrf->tx_num_channels > 1) { int tx_gain = ((uint32_t)openair0_cfg->tx_gain[0] > 90?90:(uint32_t)openair0_cfg->tx_gain[0]);
tx_gain = ((uint32_t)openair0_cfg->tx_gain[1] > 90?90:(uint32_t)openair0_cfg->tx_gain[1]); if ((status = oxgrf_set_tx1_attenuation(oxgrf->dev, rfid, (90 - tx_gain) * 1000)) < 0) {
if ((status = oxgrf_set_tx2_attenuation(oxgrf->dev, 0, (90 - tx_gain) * 1000)) < 0) { printf("[oxgrf %d] Failed to set TX1 gain\n", rfid);
printf("[oxgrf] Failed to set TX2 gain\n");
} else } else
printf("[oxgrf] set the TX2 gain to %d\n", (uint32_t)openair0_cfg->tx_gain[1]); printf("[oxgrf %d] set the TX1 gain to %d\n", rfid, (uint32_t)openair0_cfg->tx_gain[0]);
if(oxgrf->tx_num_channels > rfid*2+1) {
tx_gain = ((uint32_t)openair0_cfg->tx_gain[1] > 90?90:(uint32_t)openair0_cfg->tx_gain[1]);
if ((status = oxgrf_set_tx2_attenuation(oxgrf->dev, rfid, (90 - tx_gain) * 1000)) < 0) {
printf("[oxgrf %d] Failed to set TX2 gain\n", rfid);
} else
printf("[oxgrf %d] set the TX2 gain to %d\n", rfid, (uint32_t)openair0_cfg->tx_gain[1]);
}
} }
oxgrf_enable_timestamp(oxgrf->dev, 0, 0); oxgrf_enable_timestamp(oxgrf->dev, 0, 0);
usleep(5); usleep(5);
oxgrf_enable_timestamp(oxgrf->dev, 0, 1); oxgrf_enable_timestamp(oxgrf->dev, 0, 1);
......
...@@ -29,7 +29,7 @@ gNBs = ...@@ -29,7 +29,7 @@ gNBs =
min_rxtxtime = 6; min_rxtxtime = 6;
pdsch_AntennaPorts_XP = 1; pdsch_AntennaPorts_XP = 1;
pusch_AntennaPorts = 2; pusch_AntennaPorts = 2;
do_CSIRS = 1; #do_CSIRS = 1;
do_SRS = 1; do_SRS = 1;
ul_prbblacklist = "135,136,137,138" ul_prbblacklist = "135,136,137,138"
...@@ -238,8 +238,8 @@ MACRLCs = ( ...@@ -238,8 +238,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150; pusch_TargetSNRx10 = 250;
pucch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 300;
pusch_FailureThres = 1000; pusch_FailureThres = 1000;
ulsch_max_frame_inactivity = 0; ulsch_max_frame_inactivity = 0;
} }
...@@ -264,7 +264,7 @@ RUs = ( ...@@ -264,7 +264,7 @@ RUs = (
bands = [78]; bands = [78];
num_tp_cores = 8; num_tp_cores = 8;
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 45; max_rxgain = 15;
eNB_instances = [0]; eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas ##beamforming 1x2 matrix: 1 layer x 2 antennas
#bf_weights = [0x00007fff, 0x0000]; #bf_weights = [0x00007fff, 0x0000];
......
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