Merge remote-tracking branch 'origin/develop' into develop-NR_SA_F1AP_5GRECORDS
# Conflicts: # cmake_targets/CMakeLists.txt # cmake_targets/build_oai # openair1/PHY/INIT/nr_init_ru.c # openair1/PHY/NR_TRANSPORT/nr_ulsch.c # openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c # openair1/SCHED_NR/phy_procedures_nr_gNB.c # openair1/SIMULATION/NR_PHY/ulsim.c # openair2/COMMON/platform_constants.h # openair2/ENB_APP/enb_config.c # openair2/F1AP/f1ap_cu_interface_management.c # openair2/F1AP/f1ap_cu_rrc_message_transfer.c # openair2/F1AP/f1ap_cu_ue_context_management.c # openair2/F1AP/f1ap_du_interface_management.c # openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c # openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c # openair2/RRC/LTE/rrc_eNB.c # openair2/RRC/NR/rrc_gNB.c # openair2/RRC/NR_UE/rrc_UE.c
This commit is contained in:
@@ -40,7 +40,8 @@
|
||||
#include "assertions.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
//#include "targets/RT/USER/lte-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
char *get_devname(int devtype) {
|
||||
char *devnames[MAX_RF_DEV_TYPE]=DEVTYPE_NAMES;
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "ethernet_lib.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
//#define DEBUG 1
|
||||
|
||||
@@ -414,7 +413,7 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi
|
||||
char *temp_rx0 = ((char *)&temp_rx[1])-APP_HEADER_SIZE_BYTES;
|
||||
#endif
|
||||
#elif defined(__arm__) || defined(__aarch64__)
|
||||
int nsamps2 = (payload_size>>4)+1
|
||||
int nsamps2 = (payload_size>>4)+1;
|
||||
int16x8_t temp_rx[nsamps2];
|
||||
char *temp_rx0 = ((char *)&temp_rx[1])-APP_HEADER_SIZE_BYTES;
|
||||
#else
|
||||
|
||||
@@ -464,6 +464,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHI
|
||||
write_package[end].buff[i] = buff[i];
|
||||
write_thread->count_write++;
|
||||
write_thread->end = (write_thread->end + 1)% MAX_WRITE_THREAD_PACKAGE;
|
||||
LOG_D(HW,"Signaling TX TS %llu\n",(unsigned long long)timestamp);
|
||||
pthread_cond_signal(&write_thread->cond_write);
|
||||
pthread_mutex_unlock(&write_thread->mutex_write);
|
||||
return 0;
|
||||
@@ -624,24 +625,48 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifdef __AVX2__
|
||||
nsamps2 = (nsamps+7)>>3;
|
||||
__m256i buff_tmp[2][nsamps2];
|
||||
__m256i buff_tmp[4][nsamps2];
|
||||
#else
|
||||
nsamps2 = (nsamps+3)>>2;
|
||||
__m128i buff_tmp[2][nsamps2];
|
||||
__m128i buff_tmp[4][nsamps2];
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
nsamps2 = (nsamps+3)>>2;
|
||||
int16x8_t buff_tmp[2][nsamps2];
|
||||
int16x8_t buff_tmp[4][nsamps2];
|
||||
#endif
|
||||
|
||||
if (cc>1) {
|
||||
int rxshift;
|
||||
switch (device->type) {
|
||||
case USRP_B200_DEV:
|
||||
rxshift=4;
|
||||
break;
|
||||
case USRP_X300_DEV:
|
||||
case USRP_N300_DEV:
|
||||
rxshift=2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Shouldn't be here\n");
|
||||
}
|
||||
if (cc>1) {
|
||||
// receive multiple channels (e.g. RF A and RF B)
|
||||
std::vector<void *> buff_ptrs;
|
||||
|
||||
for (int i=0; i<cc; i++) buff_ptrs.push_back(buff_tmp[i]);
|
||||
samples_received=0;
|
||||
|
||||
samples_received = s->rx_stream->recv(buff_ptrs, nsamps, s->rx_md);
|
||||
} else {
|
||||
while (samples_received != nsamps) {
|
||||
for (int i=0; i<cc; i++) buff_ptrs.push_back(buff_tmp[i]+samples_received);
|
||||
samples_received += s->rx_stream->recv(buff_ptrs,nsamps-samples_received, s->rx_md);
|
||||
|
||||
|
||||
if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE))
|
||||
break;
|
||||
|
||||
if ((s->wait_for_first_pps == 1) && (samples_received != nsamps)) {
|
||||
printf("sleep...\n"); //usleep(100);
|
||||
}
|
||||
}
|
||||
if (samples_received == nsamps) s->wait_for_first_pps=0;
|
||||
} else {
|
||||
// receive a single channel (e.g. from connector RF A)
|
||||
samples_received=0;
|
||||
|
||||
@@ -667,17 +692,17 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
|
||||
|
||||
if ((((uintptr_t) buff[i])&0x1F)==0) {
|
||||
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4);
|
||||
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],rxshift);
|
||||
} else {
|
||||
((__m128i *)buff[i])[2*j] = _mm_srai_epi16(((__m128i *)buff_tmp[i])[2*j],4);
|
||||
((__m128i *)buff[i])[2*j+1] = _mm_srai_epi16(((__m128i *)buff_tmp[i])[2*j+1],4);
|
||||
((__m128i *)buff[i])[2*j] = _mm_srai_epi16(((__m128i *)buff_tmp[i])[2*j],rxshift);
|
||||
((__m128i *)buff[i])[2*j+1] = _mm_srai_epi16(((__m128i *)buff_tmp[i])[2*j+1],rxshift);
|
||||
}
|
||||
|
||||
#else
|
||||
((__m128i *)buff[i])[j] = _mm_srai_epi16(buff_tmp[i][j],4);
|
||||
((__m128i *)buff[i])[j] = _mm_srai_epi16(buff_tmp[i][j],rxshift);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
((int16x8_t *)buff[i])[j] = vshrq_n_s16(buff_tmp[i][j],4);
|
||||
((int16x8_t *)buff[i])[j] = vshrq_n_s16(buff_tmp[i][j],rxshift);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1288,10 +1313,12 @@ extern "C" {
|
||||
|
||||
LOG_I(HW,"rx_max_num_samps %zu\n",
|
||||
s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps());
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].rx_num_channels; i++)
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].rx_num_channels; i++) {
|
||||
LOG_I(HW,"setting rx channel %d\n",i);
|
||||
stream_args_rx.channels.push_back(i);
|
||||
|
||||
}
|
||||
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
||||
|
||||
|
||||
@@ -61,10 +61,7 @@
|
||||
#define MAX_SIMULATION_CONNECTED_NODES 5
|
||||
#define GENERATE_CHANNEL 10 //each frame in DL
|
||||
|
||||
// Fixme: datamodel, external variables in .h files, ...
|
||||
#include <common/ran_context.h>
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
//
|
||||
|
||||
#define RFSIMU_SECTION "rfsimulator"
|
||||
|
||||
@@ -6,23 +6,39 @@
|
||||
# define NUMBER_OF_gNB_MAX 1
|
||||
# define NUMBER_OF_RU_MAX 2
|
||||
# define NUMBER_OF_NR_RU_MAX 2
|
||||
# define NUMBER_OF_UCI_MAX 16
|
||||
# define NUMBER_OF_ULSCH_MAX 8
|
||||
# define NUMBER_OF_DLSCH_MAX 8
|
||||
# define NUMBER_OF_SRS_MAX 16
|
||||
# define NUMBER_OF_NR_ULSCH_MAX 8
|
||||
# define NUMBER_OF_NR_DLSCH_MAX 8
|
||||
# define NUMBER_OF_NR_UCI_MAX 16
|
||||
# define nUMBER_OF_NR_SRS_MAX 16
|
||||
# define NUMBER_OF_SCH_STATS_MAX 16
|
||||
|
||||
# define NUMBER_OF_NR_SCH_STATS_MAX 16
|
||||
|
||||
# define NUMBER_OF_NR_PUCCH_MAX 16
|
||||
# define NUMBER_OF_NR_SR_MAX 16
|
||||
# define NUMBER_OF_NR_PDCCH_MAX 16
|
||||
|
||||
#define MAX_MANAGED_ENB_PER_MOBILE 2
|
||||
#define MAX_MANAGED_GNB_PER_MOBILE 2
|
||||
|
||||
# ifndef PHYSIM
|
||||
# ifndef UE_EXPANSION
|
||||
# define NUMBER_OF_UE_MAX 4
|
||||
# define NUMBER_OF_NR_UE_MAX 4
|
||||
# define NUMBER_OF_UCI_VARS_MAX 14
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 256
|
||||
# define NUMBER_OF_UCI_VARS_MAX 256
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
# endif
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 4
|
||||
# define NUMBER_OF_NR_UE_MAX 4
|
||||
# define NUMBER_OF_UCI_VARS_MAX 56
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
# endif
|
||||
|
||||
@@ -33,7 +33,7 @@ gNBs =
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP), points to Subcarrier 0 of RB#10 of SSB block
|
||||
absoluteFrequencySSB = 641032;
|
||||
dl_frequencyBand = 78;
|
||||
# this is 3600 MHz
|
||||
@@ -46,13 +46,13 @@ gNBs =
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=41,L=24 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6368;
|
||||
# this is RBstart=33 (Start RB of SSB block),L=24 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6358; #6368;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 0; #12;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
@@ -76,7 +76,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 6368;
|
||||
initialULBWPlocationAndBandwidth = 6358;#6368;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
|
||||
@@ -33,7 +33,7 @@ gNBs =
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP). points to Subcarrier 0 of RB#10 of SSB block
|
||||
absoluteFrequencySSB = 641032;
|
||||
dl_frequencyBand = 78;
|
||||
# this is 3600 MHz
|
||||
@@ -46,13 +46,13 @@ gNBs =
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6368;
|
||||
# this is RBstart=33 (Start RB of SSB block),L=24 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6358; #6368;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 0;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
@@ -77,7 +77,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 6368;
|
||||
initialULBWPlocationAndBandwidth = 6358; #6368;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
|
||||
@@ -33,7 +33,7 @@ gNBs =
|
||||
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP)
|
||||
# this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP). Points to Subcarrier 0 of RB#10 of SSB block
|
||||
absoluteFrequencySSB = 642016;#642364;
|
||||
dl_frequencyBand = 78;
|
||||
# this is 3600 MHz
|
||||
@@ -46,13 +46,13 @@ gNBs =
|
||||
dl_carrierBandwidth = 217;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=84,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13559;
|
||||
# this is RBstart=74 (Start RB of SSB block),L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13549;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 0;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
@@ -76,7 +76,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 13559;
|
||||
initialULBWPlocationAndBandwidth = 13549;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
@@ -233,6 +233,7 @@ L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 8;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -275,7 +276,7 @@ log_config :
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="debug";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
|
||||
@@ -46,13 +46,13 @@ gNBs =
|
||||
dl_carrierBandwidth = 217;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=84,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13559;
|
||||
# this is RBstart=74,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13549;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 0;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
@@ -76,7 +76,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 13559;
|
||||
initialULBWPlocationAndBandwidth = 13549;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
@@ -217,6 +217,7 @@ L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 8;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -46,13 +46,13 @@ gNBs =
|
||||
dl_carrierBandwidth = 273;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=84,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13559;
|
||||
# this is RBstart=74,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13549;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 0;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
@@ -76,7 +76,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 13559;
|
||||
initialULBWPlocationAndBandwidth = 13549;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
@@ -217,6 +217,7 @@ L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
pusch_proc_threads = 8;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
[*]
|
||||
[*] GTKWave Analyzer v3.3.66 (w)1999-2015 BSI
|
||||
[*] Sun May 19 21:39:57 2019
|
||||
[*] Tue Jan 26 21:45:57 2021
|
||||
[*]
|
||||
[dumpfile] "/tmp/openair_dump_eNB.vcd"
|
||||
[dumpfile_mtime] "Sun May 19 21:30:25 2019"
|
||||
[dumpfile_size] 11590554
|
||||
[savefile] "/home/sphex/raymond/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
|
||||
[timestart] 7629910000
|
||||
[size] 1840 795
|
||||
[dumpfile] "/home/eurecom/raymond/gtkw/openair_dump_eNB.vcd"
|
||||
[dumpfile_mtime] "Tue Jan 26 21:26:33 2021"
|
||||
[dumpfile_size] 180869253
|
||||
[savefile] "/home/eurecom/raymond/openairinterface5g_2/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
|
||||
[timestart] 11468800000
|
||||
[size] 1693 785
|
||||
[pos] -1 -1
|
||||
*-21.832302 7639830000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[sst_width] 386
|
||||
@@ -16,17 +16,22 @@
|
||||
[sst_vpaned_height] 303
|
||||
@28
|
||||
functions.trx_read
|
||||
@29
|
||||
functions.trx_write_thread
|
||||
@28
|
||||
functions.trx_write
|
||||
@24
|
||||
variables.trx_ts[63:0]
|
||||
variables.trx_tst[63:0]
|
||||
variables.trx_write_flags[63:0]
|
||||
@28
|
||||
functions.eNB_thread_rxtx0
|
||||
@420
|
||||
variables.l1_proc_tx_ic[63:0]
|
||||
variables.l1_proc_ic[63:0]
|
||||
@24
|
||||
variables.frame_number_RX0_RU[63:0]
|
||||
@25
|
||||
variables.tti_number_RX0_RU[63:0]
|
||||
@24
|
||||
variables.frame_number_TX0_RU[63:0]
|
||||
variables.tti_number_TX0_RU[63:0]
|
||||
@28
|
||||
|
||||
+79
-62
@@ -70,6 +70,7 @@
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
@@ -96,6 +97,9 @@
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
//#define DEBUG_THREADS 1
|
||||
|
||||
//#define USRP_DEBUG 1
|
||||
@@ -261,7 +265,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
|
||||
eNB->UL_INFO.subframe = proc->subframe_rx;
|
||||
eNB->UL_INFO.module_id = eNB->Mod_id;
|
||||
eNB->UL_INFO.CC_id = eNB->CC_id;
|
||||
eNB->if_inst->UL_indication(&eNB->UL_INFO, proc);
|
||||
eNB->if_inst->UL_indication(&eNB->UL_INFO, (void*)proc);
|
||||
AssertFatal((ret= pthread_mutex_unlock(&eNB->UL_INFO_mutex))==0,"error unlocking UL_INFO_mutex, return %d\n",ret);
|
||||
/* this conflict resolution may be totally wrong, to be tested */
|
||||
/* CONFLICT RESOLUTION: BEGIN */
|
||||
@@ -323,7 +327,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
|
||||
static void *L1_thread_tx(void *param) {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
PHY_VARS_eNB *eNB = eNB_proc->eNB;
|
||||
char thread_name[100];
|
||||
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
@@ -331,6 +335,7 @@ static void *L1_thread_tx(void *param) {
|
||||
|
||||
//wait_sync("tx_thread");
|
||||
|
||||
proc->respEncode = eNB->proc.L1_proc.respEncode;
|
||||
while (!oai_exit) {
|
||||
LOG_D(PHY,"Waiting for TX (IC %d)\n",proc->instance_cnt);
|
||||
|
||||
@@ -351,21 +356,19 @@ static void *L1_thread_tx(void *param) {
|
||||
LOG_D(PHY,"L1 TX processing %d.%d\n",proc->frame_tx,proc->subframe_tx);
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
AssertFatal((ret= pthread_mutex_lock( &proc->mutex ))==0,"error locking L1_proc_tx mutex, return %d\n",ret);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,proc->instance_cnt);
|
||||
int subframe_tx = proc->subframe_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
uint64_t timestamp_tx = proc->timestamp_tx;
|
||||
proc->instance_cnt = -1;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,proc->instance_cnt);
|
||||
LOG_D(PHY,"L1 TX signaling done for %d.%d\n",proc->frame_tx,proc->subframe_tx);
|
||||
// the thread can now be woken up
|
||||
LOG_D(PHY,"L1_thread_tx: signaling completion in %d.%d\n",proc->frame_tx,proc->subframe_tx);
|
||||
|
||||
if (pthread_cond_signal(&proc->cond) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
|
||||
AssertFatal((ret=pthread_cond_signal(&proc->cond))== 0, "ERROR pthread_cond_signal for eNB TXnp4 thread ret %d\n",ret);
|
||||
AssertFatal((ret= pthread_mutex_unlock( &proc->mutex ))==0,"error unlocking L1_proc_tx mutex, return %d\n",ret);
|
||||
|
||||
|
||||
wakeup_txfh(eNB,proc,frame_tx,subframe_tx,timestamp_tx);
|
||||
}
|
||||
|
||||
@@ -391,6 +394,8 @@ static void *L1_thread( void *param ) {
|
||||
}
|
||||
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
|
||||
|
||||
char thread_name[100];
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
@@ -402,7 +407,7 @@ static void *L1_thread( void *param ) {
|
||||
LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid));
|
||||
|
||||
while (!oai_exit) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0, 0 );
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
LOG_D(PHY,"L1RX waiting for RU RX\n");
|
||||
|
||||
@@ -410,7 +415,7 @@ static void *L1_thread( void *param ) {
|
||||
|
||||
LOG_D(PHY,"L1RX starting in %d.%d\n",proc->frame_rx,proc->subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB,proc->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB,proc->subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB,proc->frame_tx);
|
||||
@@ -424,6 +429,8 @@ static void *L1_thread( void *param ) {
|
||||
|
||||
LOG_D(PHY,"L1 RX %d.%d done\n",proc->frame_rx,proc->subframe_rx);
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC, proc->instance_cnt);
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx,proc->timestamp_tx);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) {
|
||||
@@ -432,9 +439,7 @@ static void *L1_thread( void *param ) {
|
||||
}
|
||||
}
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
} // while !oai_exit
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||
LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
|
||||
eNB_thread_rxtx_status = 0;
|
||||
@@ -530,6 +535,7 @@ int wakeup_txfh(PHY_VARS_eNB *eNB,
|
||||
AssertFatal(pthread_cond_signal(&ru_proc->cond_eNBs) == 0,
|
||||
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&ru_proc->mutex_eNBs))==0,"mutex_unlock returned %d\n",ret);
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
@@ -542,19 +548,19 @@ int wakeup_tx(PHY_VARS_eNB *eNB,
|
||||
int frame_tx,
|
||||
int subframe_tx,
|
||||
uint64_t timestamp_tx) {
|
||||
L1_rxtx_proc_t *L1_proc = &eNB->proc.L1_proc;
|
||||
L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx;
|
||||
int ret;
|
||||
LOG_D(PHY,"ENTERED wakeup_tx (IC %d)\n",L1_proc_tx->instance_cnt);
|
||||
// check if subframe is a has TX else return
|
||||
if (subframe_select(&eNB->frame_parms,subframe_tx) == SF_UL) return 0;
|
||||
AssertFatal((ret = pthread_mutex_lock(&L1_proc_tx->mutex))==0,"mutex_lock returns %d\n",ret);
|
||||
LOG_D(PHY,"L1 RX %d.%d Waiting to wake up L1 TX %d.%d (IC L1TX %d)\n",L1_proc->frame_rx,L1_proc->subframe_rx,L1_proc->frame_tx,L1_proc->subframe_tx,L1_proc_tx->instance_cnt);
|
||||
LOG_D(PHY,"L1 RX %d.%d Waiting to wake up L1 TX %d.%d (IC L1TX %d)\n",frame_rx,subframe_rx,frame_tx,subframe_tx,L1_proc_tx->instance_cnt);
|
||||
|
||||
while(L1_proc_tx->instance_cnt == 0) {
|
||||
pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"L1 RX Got signal that TX %d.%d is done\n",L1_proc_tx->frame_tx,L1_proc_tx->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,L1_proc_tx->instance_cnt);
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,L1_proc_tx->instance_cnt);
|
||||
L1_proc_tx->subframe_rx = subframe_rx;
|
||||
@@ -563,9 +569,11 @@ int wakeup_tx(PHY_VARS_eNB *eNB,
|
||||
L1_proc_tx->frame_tx = frame_tx;
|
||||
L1_proc_tx->timestamp_tx = timestamp_tx;
|
||||
// the thread can now be woken up
|
||||
LOG_D(PHY,"L1 RX Waking up L1 TX %d.%d\n",L1_proc->frame_tx,L1_proc->subframe_tx);
|
||||
LOG_D(PHY,"L1 RX Waking up L1 TX %d.%d\n",frame_tx,subframe_tx);
|
||||
|
||||
AssertFatal(pthread_cond_signal(&L1_proc_tx->cond) == 0, "ERROR pthread_cond_signal for eNB L1 thread tx\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&L1_proc_tx->mutex))==0,"mutex_unlock returns %d\n",ret);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -585,10 +593,16 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"mutex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
/* AssertFatal(1==0,"L1_thread isn't ready in %d.%d (L1RX %d.%d), aborting RX, exiting\n",
|
||||
ru_proc->frame_rx,ru_proc->tti_rx,L1_proc->frame_rx,L1_proc->subframe_rx);
|
||||
*/
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC, L1_proc->instance_cnt);
|
||||
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// transmitted timestamp of the next TX slot (first).
|
||||
@@ -606,14 +620,12 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_TX_RU+ru->idx, L1_proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU+ru->idx, L1_proc->subframe_tx);
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&L1_proc->cond) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// the thread can now be woken up
|
||||
AssertFatal((ret=pthread_cond_signal(&L1_proc->cond))== 0, "ERROR pthread_cond_signal for eNB RXn-TXnp4 thread, ret %d\n",ret);
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"mutex_unlock return %d\n",ret);
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -837,6 +849,21 @@ static void *process_stats_thread(void *param) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void *L1_stats_thread(void *param) {
|
||||
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
|
||||
wait_sync("L1_stats_thread");
|
||||
FILE *fd;
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
fd=fopen("L1_stats.log","w");
|
||||
AssertFatal(fd!=NULL,"Cannot open L1_stats.log\n");
|
||||
dump_I0_stats(fd,eNB);
|
||||
dump_ulsch_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
|
||||
dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
|
||||
fclose(fd);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void init_eNB_proc(int inst) {
|
||||
/*int i=0;*/
|
||||
@@ -858,6 +885,7 @@ void init_eNB_proc(int inst) {
|
||||
L1_proc_tx->instance_cnt = -1;
|
||||
L1_proc->instance_cnt_RUs = 0;
|
||||
L1_proc_tx->instance_cnt_RUs = 0;
|
||||
proc->eNB = eNB;
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_synch = -1;
|
||||
@@ -930,6 +958,7 @@ void init_eNB_proc(int inst) {
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
pthread_create(&proc->L1_stats_thread,NULL,L1_stats_thread,(void*)eNB);
|
||||
}
|
||||
|
||||
//for multiple CCs: setup master and slaves
|
||||
@@ -1060,60 +1089,47 @@ void print_opp_meas(void) {
|
||||
|
||||
|
||||
void free_transport(PHY_VARS_eNB *eNB) {
|
||||
for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||
for (int i=0; i<NUMBER_OF_DLSCH_MAX; i++) {
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffers for DLSCH %d\n",i);
|
||||
|
||||
for (int j=0; j<2; j++) free_eNB_dlsch(eNB->dlsch[i][j]);
|
||||
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||
free_eNB_ulsch(eNB->ulsch[1+i]);
|
||||
}
|
||||
|
||||
free_eNB_ulsch(eNB->ulsch[0]);
|
||||
for (int i=0;i<NUMBER_OF_ULSCH_MAX;i++) {
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffer for ULSCH %d\n",i);
|
||||
free_eNB_ulsch(eNB->ulsch[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_transport(PHY_VARS_eNB *eNB) {
|
||||
int i;
|
||||
int j;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
LOG_I(PHY, "Initialise transport\n");
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||
for (int i=0;i<NUMBER_OF_DLSCH_MAX; i++) {
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d/%d\n",i,NUMBER_OF_DLSCH_MAX,(i-NUMBER_OF_DLSCH_MAX)<0);
|
||||
|
||||
for (j=0; j<2; j++) {
|
||||
for (int j=0; j<2; j++) {
|
||||
eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL,0,fp);
|
||||
|
||||
LOG_I(PHY,"eNB->dlsch[%d][%d] %p\n",i,j,eNB->dlsch[i][j]);
|
||||
if (!eNB->dlsch[i][j]) {
|
||||
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
|
||||
LOG_E(PHY,"Can't get eNB dlsch structures for DLSCH %d \n", i);
|
||||
exit(-1);
|
||||
} else {
|
||||
eNB->dlsch[i][j]->rnti=0;
|
||||
LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,eNB->dlsch[i][j], eNB->dlsch[i][j]->rnti);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0;i<NUMBER_OF_ULSCH_MAX; i++) {
|
||||
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||
eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0);
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,NUMBER_OF_ULSCH_MAX);
|
||||
eNB->ulsch[i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0);
|
||||
|
||||
if (!eNB->ulsch[1+i]) {
|
||||
if (!eNB->ulsch[i]) {
|
||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// this is the transmission mode for the signalling channels
|
||||
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
|
||||
eNB->transmission_mode[i] = fp->nb_antenna_ports_eNB==1 ? 1 : 2;
|
||||
}
|
||||
|
||||
// ULSCH for RA
|
||||
eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, fp->N_RB_UL, 0);
|
||||
|
||||
if (!eNB->ulsch[0]) {
|
||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
eNB->dlsch_SI = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
||||
@@ -1126,7 +1142,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
|
||||
eNB->rx_total_gain_dB=130;
|
||||
|
||||
for(i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||
for(int i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||
eNB->mu_mimo_mode[i].dl_pow_off = 2;
|
||||
|
||||
eNB->check_for_total_transmissions = 0;
|
||||
@@ -1134,11 +1150,13 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
eNB->FULL_MUMIMO_transmissions = 0;
|
||||
eNB->check_for_SUMIMO_transmissions = 0;
|
||||
fp->pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
if (eNB->use_DTX == 0) fill_subframe_mask(eNB);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void init_eNB_afterRU(void) {
|
||||
int inst,CC_id,ru_id,i,aa;
|
||||
int inst,CC_id,i;
|
||||
PHY_VARS_eNB *eNB;
|
||||
LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst);
|
||||
|
||||
@@ -1148,13 +1166,14 @@ void init_eNB_afterRU(void) {
|
||||
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
||||
LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.eNB[inst][CC_id]);
|
||||
eNB = RC.eNB[inst][CC_id];
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
|
||||
// map antennas and PRACH signals to eNB RX
|
||||
if (0) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
||||
|
||||
// map antennas and PRACH signals to eNB RX
|
||||
LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
|
||||
eNB->frame_parms.nb_antennas_rx = 0;
|
||||
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
|
||||
if (NFAPI_MODE==NFAPI_MODE_PNF) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
||||
for (int ru_id=0; ru_id<eNB->num_RU; ru_id++)
|
||||
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
LOG_I(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
|
||||
eNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||
|
||||
@@ -1163,10 +1182,8 @@ void init_eNB_afterRU(void) {
|
||||
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||
}
|
||||
|
||||
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
|
||||
|
||||
for (ru_id=0,aa=0; ru_id<eNB->num_RU; ru_id++) {
|
||||
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
||||
for (int ru_id=0,aa=0; ru_id<eNB->num_RU; ru_id++) {
|
||||
|
||||
AssertFatal(eNB->RU_list[ru_id]->common.rxdataF!=NULL,
|
||||
"RU %d : common.rxdataF is NULL\n",
|
||||
@@ -1214,7 +1231,7 @@ void init_eNB_afterRU(void) {
|
||||
init_eNB_proc(inst);
|
||||
}
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id);
|
||||
RC.ru[ru_id]->wakeup_rxtx = wakeup_rxtx;
|
||||
RC.ru[ru_id]->wakeup_prach_eNB = wakeup_prach_eNB;
|
||||
|
||||
+280
-260
File diff suppressed because it is too large
Load Diff
@@ -163,12 +163,16 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
}
|
||||
|
||||
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
|
||||
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
|
||||
extern void init_eNB_afterRU(void);
|
||||
|
||||
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
|
||||
|
||||
int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
@@ -426,7 +430,6 @@ int stop_L1L2(module_id_t enb_id) {
|
||||
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
|
||||
*/
|
||||
int restart_L1L2(module_id_t enb_id) {
|
||||
RU_t *ru = RC.ru[enb_id];
|
||||
int cc_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
LOG_W(ENB_APP, "restarting lte-softmodem\n");
|
||||
@@ -437,10 +440,12 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
|
||||
for (cc_id = 0; cc_id < RC.nb_L1_CC[enb_id]; cc_id++) {
|
||||
RC.eNB[enb_id][cc_id]->configured = 0;
|
||||
for (int ru_id=0;ru_id<RC.eNB[enb_id][cc_id]->num_RU;ru_id++) {
|
||||
int ru_idx = RC.eNB[enb_id][cc_id]->RU_list[ru_id]->idx;
|
||||
RC.ru_mask |= (1 << ru_idx);
|
||||
set_function_spec_param(RC.ru[ru_idx]);
|
||||
}
|
||||
}
|
||||
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
set_function_spec_param(RC.ru[enb_id]);
|
||||
/* reset the list of connected UEs in the MAC, since in this process with
|
||||
* loose all UEs (have to reconnect) */
|
||||
init_UE_info(&RC.mac[enb_id]->UE_info);
|
||||
@@ -461,9 +466,15 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
||||
* broken, so we cannot test it */
|
||||
wait_eNBs();
|
||||
init_RU_proc(ru);
|
||||
ru->rf_map.card = 0;
|
||||
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||
for (int cc_id=0;cc_id<RC.nb_L1_CC[enb_id]; cc_id++) {
|
||||
for (int ru_id=0;ru_id<RC.eNB[enb_id][cc_id]->num_RU;ru_id++) {
|
||||
int ru_idx = RC.eNB[enb_id][cc_id]->RU_list[ru_id]->idx;
|
||||
|
||||
init_RU_proc(RC.ru[ru_idx]);
|
||||
RC.ru[ru_idx]->rf_map.card = 0;
|
||||
RC.ru[ru_idx]->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||
}
|
||||
}
|
||||
wait_RUs();
|
||||
init_eNB_afterRU();
|
||||
printf("Sending sync to all threads\n");
|
||||
@@ -576,7 +587,7 @@ int main ( int argc, char **argv )
|
||||
/* We need to read RU configuration before FlexRAN starts so it knows what
|
||||
* splits to report. Actual RU start comes later. */
|
||||
if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
RCconfig_RU();
|
||||
RC.ru = RCconfig_RU(RC.nb_RU,RC.nb_L1_inst,RC.eNB,&RC.ru_mask,&RC.ru_mutex,&RC.ru_cond);
|
||||
LOG_I(PHY,
|
||||
"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
|
||||
RC.nb_L1_inst, RC.nb_RU, get_nprocs());
|
||||
@@ -653,6 +664,7 @@ int main ( int argc, char **argv )
|
||||
for (int x=0; x < RC.nb_L1_inst; x++)
|
||||
for (int CC_id=0; CC_id<RC.nb_L1_CC[x]; CC_id++) {
|
||||
L1_rxtx_proc_t *L1proc= &RC.eNB[x][CC_id]->proc.L1_proc;
|
||||
L1_rxtx_proc_t *L1proctx= &RC.eNB[x][CC_id]->proc.L1_proc_tx;
|
||||
L1proc->threadPool=(tpool_t*)malloc(sizeof(tpool_t));
|
||||
L1proc->respEncode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
L1proc->respDecode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
@@ -660,9 +672,11 @@ int main ( int argc, char **argv )
|
||||
initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool, true);
|
||||
else
|
||||
initTpool("n", L1proc->threadPool, true);
|
||||
initNotifiedFIFO(L1proc->respEncode);
|
||||
initNotifiedFIFO(L1proc->respDecode);
|
||||
RC.eNB[x][CC_id]->proc.L1_proc_tx.threadPool = L1proc->threadPool;
|
||||
initNotifiedFIFO(L1proc->respEncode);
|
||||
initNotifiedFIFO(L1proc->respDecode);
|
||||
L1proctx->threadPool=L1proc->threadPool;
|
||||
L1proctx->respEncode=L1proc->respEncode;
|
||||
L1proctx->nbEncode=L1proc->nbEncode;
|
||||
}
|
||||
|
||||
|
||||
@@ -677,7 +691,7 @@ int main ( int argc, char **argv )
|
||||
// some initialization is necessary and init_ru_vnf do this.
|
||||
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
printf("Initializing RU threads\n");
|
||||
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
|
||||
init_RU(RC.ru,RC.nb_RU,RC.eNB,RC.nb_L1_inst,RC.nb_L1_CC,get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
RC.ru[ru_id]->rf_map.card=0;
|
||||
|
||||
@@ -97,7 +97,6 @@
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#define CMDLINE_UEPARAMS_DESC { \
|
||||
{"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \
|
||||
{"U", CONFIG_HLP_NUMUE, 0, u16ptr:&NB_UE_INST, defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \
|
||||
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \
|
||||
@@ -171,7 +170,7 @@ extern void init_RU_proc(RU_t *ru);
|
||||
extern void stop_RU(int nb_ru);
|
||||
extern void kill_RU_proc(RU_t *ru);
|
||||
extern void set_function_spec_param(RU_t *ru);
|
||||
extern void init_RU(char *, int send_dmrssync);
|
||||
extern void init_RU(RU_t **rup,int nb_RU,PHY_VARS_eNB ***eNBp,int nb_L1,int *nb_CC,char *rf_config_file, int send_dmrssync);
|
||||
|
||||
// In lte-ue.c
|
||||
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
@@ -199,7 +198,6 @@ extern void init_te_thread(PHY_VARS_eNB *);
|
||||
extern void kill_td_thread(PHY_VARS_eNB *);
|
||||
extern void kill_te_thread(PHY_VARS_eNB *);
|
||||
|
||||
extern void RCConfig_sim(void);
|
||||
extern void init_ocm(void);
|
||||
extern void init_ue_devices(PHY_VARS_UE *);
|
||||
|
||||
|
||||
@@ -283,13 +283,7 @@ void init_UE(int nb_inst,
|
||||
|
||||
LOG_I(PHY,"Allocating UE context %d\n",inst);
|
||||
|
||||
if ( !IS_SOFTMODEM_SIML1 ) PHY_vars_UE_g[inst][0] = init_ue_vars(fp0,inst,0);
|
||||
else {
|
||||
// needed for memcopy below. these are not used in the RU, but needed for UE
|
||||
RC.ru[0]->frame_parms->nb_antennas_rx = fp0->nb_antennas_rx;
|
||||
RC.ru[0]->frame_parms->nb_antennas_tx = fp0->nb_antennas_tx;
|
||||
PHY_vars_UE_g[inst][0] = init_ue_vars(RC.ru[0]->frame_parms,inst,0);
|
||||
}
|
||||
PHY_vars_UE_g[inst][0] = init_ue_vars(fp0,inst,0);
|
||||
|
||||
// turn off timing control loop in UE
|
||||
PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction;
|
||||
@@ -371,17 +365,13 @@ void init_UE(int nb_inst,
|
||||
*/
|
||||
UE->N_TA_offset = 0;
|
||||
|
||||
if (IS_SOFTMODEM_SIML1 ) init_ue_devices(UE);
|
||||
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
|
||||
init_UE_threads(inst);
|
||||
|
||||
if (!IS_SOFTMODEM_SIML1 ) {
|
||||
ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
|
||||
ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
|
||||
|
||||
if (ret !=0) {
|
||||
exit_fun("Error loading device library");
|
||||
}
|
||||
if (ret !=0) {
|
||||
exit_fun("Error loading device library");
|
||||
}
|
||||
|
||||
UE->rfdevice.host_type = RAU_HOST;
|
||||
|
||||
@@ -192,6 +192,9 @@ int oaisim_flag=0;
|
||||
*/
|
||||
uint8_t abstraction_flag=0;
|
||||
|
||||
// needed for pdcp.c
|
||||
RAN_CONTEXT_t RC;
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
@@ -285,7 +288,6 @@ static void get_options(void) {
|
||||
int dumpframe=0;
|
||||
int timingadv=0;
|
||||
uint8_t nfapi_mode = NFAPI_MONOLITHIC;
|
||||
int simL1flag =0;
|
||||
|
||||
set_default_frame_parms(frame_parms);
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
@@ -299,8 +301,6 @@ static void get_options(void) {
|
||||
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
|
||||
nfapi_setmode(nfapi_mode);
|
||||
|
||||
if (simL1flag)
|
||||
set_softmodem_optmask(SOFTMODEM_SIML1_BIT);
|
||||
|
||||
if (loopfile != NULL) {
|
||||
printf("Input file for hardware emulation: %s",loopfile);
|
||||
@@ -573,11 +573,6 @@ int main( int argc, char **argv ) {
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 1 && (!IS_SOFTMODEM_SIML1) && NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
|
||||
printf("Running with more than 1 UE instance and simL1 is not active, this will result in undefined behaviour for now, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Checking option of nums_ue_thread.
|
||||
if(NB_THREAD_INST < 1) {
|
||||
printf("Running with 0 UE rxtx thread, exiting.\n");
|
||||
@@ -648,9 +643,6 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
} else init_openair0(frame_parms[0],(int)rx_gain[0][0]);
|
||||
|
||||
if (IS_SOFTMODEM_SIML1 ) {
|
||||
RCConfig_sim();
|
||||
}
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
|
||||
@@ -752,10 +744,6 @@ int main( int argc, char **argv ) {
|
||||
|
||||
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
|
||||
|
||||
if (IS_SOFTMODEM_SIML1 ) {
|
||||
init_ocm();
|
||||
PHY_vars_UE_g[0][0]->no_timing_correction = 1;
|
||||
}
|
||||
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
load_softscope("ue",NULL);
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef __RFSIM__H__
|
||||
#define __RFSIM__H__
|
||||
#include "lte-softmodem.h"
|
||||
#include "openair1/SIMULATION/TOOLS/sim.h"
|
||||
#include "platform_constants.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
|
||||
void init_ocm(void);
|
||||
|
||||
void update_ocm(double snr_dB,double sinr_dB);
|
||||
|
||||
//extern pthread_mutex_t async_server_lock;
|
||||
//extern pthread_cond_t async_server_notify;
|
||||
//extern int async_server_shutdown;
|
||||
|
||||
void init_channel_vars(void);
|
||||
|
||||
#endif
|
||||
@@ -61,30 +61,17 @@
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
#include "UTIL/MATH/oml.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "enb_config.h"
|
||||
|
||||
|
||||
int attach_rru(RU_t *ru);
|
||||
void configure_ru(int idx, void *arg);
|
||||
void configure_rru(int idx, void *arg);
|
||||
void configure_ru(RU_t *ru, void *arg);
|
||||
void configure_rru(RU_t *ru, void *arg);
|
||||
void fill_rf_config(RU_t *ru, char *rf_config_file);
|
||||
void* ru_thread_control( void* param );
|
||||
|
||||
@@ -164,7 +151,7 @@ int send_capab(RU_t *ru)
|
||||
cap->FH_fmt = MBP_IF5;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",RC.ru[0]->function);
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",ru->function);
|
||||
break;
|
||||
}
|
||||
cap->num_bands = ru->num_bands;
|
||||
@@ -224,7 +211,7 @@ int attach_rru(RU_t *ru)
|
||||
LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx);
|
||||
}
|
||||
}
|
||||
configure_ru(ru->idx,
|
||||
configure_ru(ru,
|
||||
(RRU_capabilities_t *)&rru_config_msg.msg[0]);
|
||||
|
||||
rru_config_msg.type = RRU_config;
|
||||
@@ -296,7 +283,7 @@ int connect_rau(RU_t *ru)
|
||||
cap->FH_fmt = MBP_IF5;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",RC.ru[0]->function);
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",ru->function);
|
||||
break;
|
||||
}
|
||||
cap->num_bands = ru->num_bands;
|
||||
@@ -335,7 +322,7 @@ int connect_rau(RU_t *ru)
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_FreqOffset[0],
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
|
||||
|
||||
configure_rru(ru->idx,
|
||||
configure_rru(ru,
|
||||
(void*)&rru_config_msg.msg[0]);
|
||||
configuration_received = 1;
|
||||
}
|
||||
@@ -388,21 +375,20 @@ int check_capabilities(RU_t *ru,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
void configure_ru(int idx,
|
||||
void configure_ru(RU_t *ru,
|
||||
void *arg)
|
||||
{
|
||||
RU_t *ru = RC.ru[idx];
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg;
|
||||
int ret;
|
||||
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n",idx);
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n",ru->idx);
|
||||
|
||||
|
||||
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
|
||||
|
||||
AssertFatal((ret=check_capabilities(ru,capabilities)) == 0,
|
||||
"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret);
|
||||
"Cannot configure RRU %d, check_capabilities returned %d\n", ru->idx,ret);
|
||||
// take antenna capabilities of RRU
|
||||
ru->nb_tx = capabilities->nb_tx[0];
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
@@ -440,11 +426,10 @@ void configure_ru(int idx,
|
||||
phy_init_RU(ru);
|
||||
}
|
||||
|
||||
void configure_rru(int idx,
|
||||
void configure_rru(RU_t *ru,
|
||||
void *arg)
|
||||
{
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RU_t *ru = RC.ru[idx];
|
||||
|
||||
ru->frame_parms->eutra_band = config->band_list[0];
|
||||
ru->frame_parms->dl_CarrierFreq = config->tx_freq[0];
|
||||
@@ -486,7 +471,6 @@ void configure_rru(int idx,
|
||||
static int send_update_rru(RU_t * ru, LTE_DL_FRAME_PARMS * fp){
|
||||
//ssize_t msg_len/*,len*/;
|
||||
int i;
|
||||
//LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
memset((void *)&rru_config_msg,0,sizeof(rru_config_msg));
|
||||
rru_config_msg.type = RRU_config_update;
|
||||
@@ -535,7 +519,7 @@ void* ru_thread_control( void* param )
|
||||
send_tick(ru);
|
||||
|
||||
if (ru->state == RU_RUN && ru->if_south != LOCAL_RF){
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->eNB_list[0]->frame_parms;
|
||||
LOG_D(PHY,"Check MBSFN SF changes\n");
|
||||
if(fp->num_MBSFN_config != ru_sf_update){
|
||||
ru_sf_update = fp->num_MBSFN_config;
|
||||
@@ -579,7 +563,7 @@ void* ru_thread_control( void* param )
|
||||
((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_tx[0],
|
||||
((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_rx[0]);
|
||||
|
||||
configure_ru(ru->idx,(RRU_capabilities_t *)&rru_config_msg.msg[0]);
|
||||
configure_ru(ru,(RRU_capabilities_t *)&rru_config_msg.msg[0]);
|
||||
|
||||
// send config
|
||||
if (send_config(ru,rru_config_msg) == 0) ru->state = RU_CONFIG;
|
||||
@@ -603,7 +587,7 @@ void* ru_thread_control( void* param )
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
|
||||
|
||||
ru->frame_parms = calloc(1, sizeof(*ru->frame_parms));
|
||||
configure_rru(ru->idx, (void*)&rru_config_msg.msg[0]);
|
||||
configure_rru(ru, (void*)&rru_config_msg.msg[0]);
|
||||
|
||||
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
@@ -652,10 +636,10 @@ void* ru_thread_control( void* param )
|
||||
|
||||
|
||||
LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d) is ready in state %s\n",ru->idx,ru->is_slave,ru_states[ru->state]);
|
||||
pthread_mutex_lock(&RC.ru_mutex);
|
||||
RC.ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
pthread_mutex_lock(ru->ru_mutex);
|
||||
*ru->ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(ru->ru_cond);
|
||||
pthread_mutex_unlock(ru->ru_mutex);
|
||||
|
||||
wait_sync("ru_thread_control");
|
||||
|
||||
@@ -710,10 +694,10 @@ void* ru_thread_control( void* param )
|
||||
if (ru->state == RU_READY){
|
||||
|
||||
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
|
||||
pthread_mutex_lock(&RC.ru_mutex);
|
||||
RC.ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
pthread_mutex_lock(ru->ru_mutex);
|
||||
*ru->ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(ru->ru_cond);
|
||||
pthread_mutex_unlock(ru->ru_mutex);
|
||||
|
||||
wait_sync("ru_thread_control");
|
||||
|
||||
@@ -736,7 +720,7 @@ void* ru_thread_control( void* param )
|
||||
break;
|
||||
|
||||
case RRU_sync_ok: //RAU
|
||||
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_config_ok msg...Ignoring\n");
|
||||
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_sync_ok msg...Ignoring\n");
|
||||
else{
|
||||
if (ru->is_slave == 1){
|
||||
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Received RRU_sync_ok from RRU %d\n",ru->idx);
|
||||
|
||||
Reference in New Issue
Block a user