Merge remote-tracking branch 'origin/develop' into issue332-dft-initializations
This commit is contained in:
@@ -99,7 +99,7 @@ multicast_link_init(void)
|
||||
SOCK_DGRAM,
|
||||
&group_list[group].port, &sin);
|
||||
|
||||
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
LOG_D(PHY, "multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
group_list[group].socket,group,group_list[group].port);
|
||||
|
||||
/* Used so we can re-bind to our port while a previous connection is still
|
||||
@@ -107,17 +107,17 @@ multicast_link_init(void)
|
||||
*/
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuse_addr, sizeof (reuse_addr)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
LOG_E(PHY, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (multicast_if != NULL) {
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
|
||||
multicast_if, strlen(multicast_if)) < 0) {
|
||||
LOG_E(EMU,
|
||||
LOG_E(PHY,
|
||||
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
|
||||
multicast_if);
|
||||
LOG_E(EMU,
|
||||
LOG_E(PHY,
|
||||
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ multicast_link_init(void)
|
||||
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
&multicast_loop, sizeof (multicast_loop)) < 0) {
|
||||
LOG_E(EMU,
|
||||
LOG_E(PHY,
|
||||
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
|
||||
__FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
@@ -143,13 +143,13 @@ multicast_link_init(void)
|
||||
command.imr_interface.s_addr = htonl (INADDR_ANY);
|
||||
|
||||
if (command.imr_multiaddr.s_addr == -1) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
LOG_E(PHY, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||
&command, sizeof (command)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
|
||||
LOG_E(PHY, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
|
||||
__LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -202,13 +202,13 @@ multicast_link_read_data (int groupP)
|
||||
if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
|
||||
if ((num_bytes = recvfrom (group_list[groupP].socket,
|
||||
group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
|
||||
LOG_E(PHY, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
|
||||
errno, strerror(errno), __FILE__, __LINE__);
|
||||
} else {
|
||||
rx_handler(num_bytes,group_list[groupP].rx_buffer);
|
||||
}
|
||||
} else {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
|
||||
LOG_E(PHY, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
|
||||
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
|
||||
(struct sockaddr *) &group_list[groupP].sock_remote_addr,
|
||||
sizeof (group_list[groupP].sock_remote_addr))) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
|
||||
LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
|
||||
errno, strerror(errno),
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
@@ -274,22 +274,19 @@ int multicast_link_read_data_from_sock(uint8_t is_master)
|
||||
|
||||
multicast_link_build_select_list ();
|
||||
|
||||
LOG_D(EMU, "Stuck on select with timeout %s\n",
|
||||
LOG_D(PHY, "Stuck on select with timeout %s\n",
|
||||
timeout_p == NULL ? "infinite" : "15000 usecs");
|
||||
|
||||
readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
|
||||
|
||||
if (readsocks < 0) {
|
||||
LOG_E(EMU, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
|
||||
LOG_E(PHY, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else if (readsocks > 0) {
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "Multicast Normal read\n");
|
||||
#endif
|
||||
multicast_link_read();
|
||||
} else {
|
||||
/* Timeout */
|
||||
LOG_I(EMU, "Multicast select time-out\n");
|
||||
LOG_I(PHY, "Multicast select time-out\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -311,21 +308,21 @@ void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
|
||||
rx_handler = rx_handlerP;
|
||||
multicast_group = _multicast_group;
|
||||
multicast_if = multicast_ifname;
|
||||
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
LOG_I(PHY, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
|
||||
rx_handler);
|
||||
multicast_link_init ();
|
||||
#if ! defined(ENABLE_NEW_MULTICAST)
|
||||
LOG_D(EMU, "[MULTICAST] multicast link start thread\n");
|
||||
LOG_D(PHY, "[MULTICAST] multicast link start thread\n");
|
||||
|
||||
if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop,
|
||||
NULL) != 0) {
|
||||
LOG_E(EMU, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
|
||||
LOG_E(PHY, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
|
||||
errno, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
pthread_detach(main_loop_thread); // disassociate from parent
|
||||
LOG_I(EMU, "[MULTICAST LINK] Thread detached\n");
|
||||
LOG_I(PHY, "[MULTICAST LINK] Thread detached\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -524,6 +524,7 @@ int main(int argc, char **argv)
|
||||
int k,i,j,aa;
|
||||
int re;
|
||||
|
||||
|
||||
int s,Kr,Kr_bytes;
|
||||
|
||||
double SNR,snr0=-2.0,snr1,rate = 0;
|
||||
@@ -1140,10 +1141,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else {
|
||||
eNB->te = dlsch_encoding_2threads;
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
init_td_thread(eNB,NULL);
|
||||
init_te_thread(eNB,NULL);
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *);
|
||||
init_td_thread(eNB);
|
||||
init_te_thread(eNB);
|
||||
}
|
||||
|
||||
// callback functions required for phy_procedures_tx
|
||||
@@ -1309,7 +1310,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti;
|
||||
UE->n_connected_eNB = 1;
|
||||
|
||||
printf("Allocating %dx%d eNB->UE channel descriptor\n",eNB->frame_parms.nb_antennas_tx,UE->frame_parms.nb_antennas_rx);
|
||||
eNB2UE[0] = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
@@ -1321,8 +1324,10 @@ int main(int argc, char **argv)
|
||||
rx_sample_offset,
|
||||
0);
|
||||
|
||||
reset_meas(&eNB2UE[0]->random_channel);
|
||||
reset_meas(&eNB2UE[0]->interp_time);
|
||||
if(num_rounds>1) {
|
||||
for(n=1; n<4; n++)
|
||||
for(n=1; n<4; n++) {
|
||||
eNB2UE[n] = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
UE->frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
@@ -1331,8 +1336,11 @@ int main(int argc, char **argv)
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
reset_meas(&eNB2UE[n]->random_channel);
|
||||
reset_meas(&eNB2UE[n]->interp_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (eNB2UE[0]==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
exit(-1);
|
||||
|
||||
@@ -126,7 +126,6 @@ fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
{
|
||||
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
|
||||
|
||||
// printf("filling ul_config_pdu: modulation type %d, rvidx %d\n",modulation_type,redundancy_version);
|
||||
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
|
||||
@@ -147,6 +146,8 @@ fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size;
|
||||
|
||||
//printf("Filling ul_config_pdu : Q %d, TBS %d, rv %d, ndi %d\n", modulation_type,size,redundancy_version,new_data_indication);
|
||||
|
||||
if (cqi_req == 1) {
|
||||
// Add CQI portion
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
|
||||
@@ -183,6 +184,7 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
int mcs,
|
||||
int modulation_type,
|
||||
int ndi,
|
||||
int TBS,
|
||||
int cqi_flag,
|
||||
uint8_t beta_CQI,
|
||||
uint8_t beta_RI,
|
||||
@@ -191,7 +193,7 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
nfapi_ul_config_request_body_t *ul_req=&sched_resp->UL_req->ul_config_request_body;
|
||||
int harq_pid = ((frame*10)+subframe)&7;
|
||||
|
||||
// printf("ulsch in frame %d, subframe %d => harq_pid %d, mcs %d, ndi %d\n",frame,subframe,harq_pid,mcs,ndi);
|
||||
//printf("ulsch in frame %d, subframe %d => harq_pid %d, mcs %d, ndi %d\n",frame,subframe,harq_pid,mcs,ndi);
|
||||
|
||||
switch (eNB->frame_parms.N_RB_UL) {
|
||||
case 6:
|
||||
@@ -297,7 +299,7 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
get_TBS_UL(mcs,nb_rb));
|
||||
TBS);
|
||||
|
||||
sched_resp->UL_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
|
||||
ul_req->number_of_pdus=1;
|
||||
@@ -446,14 +448,14 @@ int main(int argc, char **argv)
|
||||
"cannot load configuration module, exiting\n");
|
||||
|
||||
logInit();
|
||||
/*
|
||||
|
||||
// enable these lines if you need debug info
|
||||
// however itti will catch all signals, so ctrl-c won't work anymore
|
||||
// alternatively you can disable ITTI completely in CMakeLists.txt
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
|
||||
set_glog(LOG_DEBUG,LOG_MED);
|
||||
*/
|
||||
//itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
//set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
|
||||
//set_glog(LOG_DEBUG,LOG_MED);
|
||||
|
||||
|
||||
while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF")) != -1) {
|
||||
switch (c) {
|
||||
@@ -887,9 +889,9 @@ int main(int argc, char **argv)
|
||||
|
||||
if (parallel_flag == 1) {
|
||||
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
init_fep_thread(eNB,NULL);
|
||||
init_td_thread(eNB,NULL);
|
||||
init_td_thread(eNB);
|
||||
}
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
@@ -1142,7 +1144,7 @@ int main(int argc, char **argv)
|
||||
else if (mcs < 21) modulation_type = 4;
|
||||
else if (mcs < 29) modulation_type = 6;
|
||||
|
||||
fill_ulsch_dci(eNB,proc_rxtx->frame_rx,subframe,&sched_resp,14,(void*)&UL_alloc_pdu,first_rb,nb_rb,(round==0)?mcs:(28+rvidx[round]),modulation_type,ndi,cqi_flag,beta_CQI,beta_RI,cqi_size);
|
||||
fill_ulsch_dci(eNB,proc_rxtx->frame_rx,subframe,&sched_resp,14,(void*)&UL_alloc_pdu,first_rb,nb_rb,(round==0)?mcs:(28+rvidx[round]),modulation_type,ndi,get_TBS_UL(mcs,nb_rb),cqi_flag,beta_CQI,beta_RI,cqi_size);
|
||||
|
||||
UE->ulsch_Msg3_active[eNB_id] = 0;
|
||||
UE->ul_power_control_dedicated[eNB_id].accumulationEnabled=1;
|
||||
@@ -1324,7 +1326,6 @@ int main(int argc, char **argv)
|
||||
ru->feprx(ru);
|
||||
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx);
|
||||
|
||||
|
||||
if (cqi_flag > 0) {
|
||||
cqi_error = 0;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
openair0_device openair0;
|
||||
int oai_exit=0;
|
||||
volatile int oai_exit=0;
|
||||
|
||||
void exit_fun(const char *s) { exit(-1); }
|
||||
|
||||
|
||||
@@ -38,12 +38,7 @@ void adc(double *r_re[2],
|
||||
for (aa=0; aa<nb_rx_antennas; aa++) {
|
||||
((short *)output[aa])[((i+output_offset)<<1)] = (short)(r_re[aa][i+input_offset]*gain);
|
||||
((short *)output[aa])[1+((i+output_offset)<<1)] = (short)(r_im[aa][i+input_offset]*gain);
|
||||
|
||||
if ((r_re[aa][i+input_offset]*gain) > 30000) {
|
||||
//("Adc outputs %d %e %d \n",i,((short *)output[0])[((i+output_offset)<<1)], ((i+output_offset)<<1) );
|
||||
}
|
||||
}
|
||||
|
||||
//printf("Adc outputs %d %e %d \n",i,((short *)output[0])[((i+output_offset)<<1)], ((i+output_offset)<<1) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "rf.h"
|
||||
void dac(double *s_re[2],
|
||||
double *s_im[2],
|
||||
uint32_t **input,
|
||||
int32_t **input,
|
||||
uint32_t input_offset,
|
||||
uint32_t nb_tx_antennas,
|
||||
uint32_t length,
|
||||
@@ -76,7 +76,7 @@ void dac(double *s_re[2],
|
||||
|
||||
double dac_fixed_gain(double *s_re[2],
|
||||
double *s_im[2],
|
||||
uint32_t **input,
|
||||
int32_t **input,
|
||||
uint32_t input_offset,
|
||||
uint32_t nb_tx_antennas,
|
||||
uint32_t length,
|
||||
|
||||
@@ -69,14 +69,14 @@ void adc(double *r_re[2],
|
||||
double *r_im[2],
|
||||
unsigned int input_offset,
|
||||
unsigned int output_offset,
|
||||
int **output,
|
||||
int32_t **output,
|
||||
unsigned int nb_rx_antennas,
|
||||
unsigned int length,
|
||||
unsigned char B);
|
||||
|
||||
void dac(double *s_re[2],
|
||||
double *s_im[2],
|
||||
unsigned int **input,
|
||||
int32_t **input,
|
||||
unsigned int input_offset,
|
||||
unsigned int nb_tx_antennas,
|
||||
unsigned int length,
|
||||
@@ -87,7 +87,7 @@ void dac(double *s_re[2],
|
||||
|
||||
double dac_fixed_gain(double *s_re[2],
|
||||
double *s_im[2],
|
||||
unsigned int **input,
|
||||
int32_t **input,
|
||||
unsigned int input_offset,
|
||||
unsigned int nb_tx_antennas,
|
||||
unsigned int length,
|
||||
|
||||
@@ -0,0 +1,487 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log_if.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OPT/opt.h" // to test OPT
|
||||
|
||||
#include "UTIL/FIFO/types.h"
|
||||
|
||||
#define RF
|
||||
//#define DEBUG_SIM
|
||||
|
||||
//#undef LOG_D
|
||||
//#define LOG_D(A,B,C...) printf(B,C)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void do_DL_sig(sim_t *sim,
|
||||
uint16_t subframe,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms,
|
||||
uint8_t UE_id,
|
||||
int CC_id)
|
||||
{
|
||||
|
||||
int32_t **txdata,**rxdata;
|
||||
|
||||
uint32_t ru_id=0;
|
||||
double tx_pwr;
|
||||
double rx_pwr;
|
||||
int32_t rx_pwr2;
|
||||
uint32_t i,aa;
|
||||
uint32_t sf_offset;
|
||||
|
||||
uint8_t hold_channel=0;
|
||||
uint8_t nb_antennas_rx = sim->RU2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
|
||||
uint8_t nb_antennas_tx = sim->RU2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
|
||||
|
||||
double s_re0[30720];
|
||||
double s_re1[30720];
|
||||
double *s_re[2];
|
||||
double s_im0[30720];
|
||||
double s_im1[30720];
|
||||
double *s_im[2];
|
||||
double r_re00[30720];
|
||||
double r_re01[30720];
|
||||
double *r_re0[2];
|
||||
double r_im00[30720];
|
||||
double r_im01[30720];
|
||||
double *r_im0[2];
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
s_re[0] = s_re0;
|
||||
s_im[0] = s_im0;
|
||||
s_re[1] = s_re1;
|
||||
s_im[1] = s_im1;
|
||||
|
||||
r_re0[0] = r_re00;
|
||||
r_im0[0] = r_im00;
|
||||
r_re0[1] = r_re01;
|
||||
r_im0[1] = r_im01;
|
||||
|
||||
if (subframe==0)
|
||||
hold_channel = 0;
|
||||
else
|
||||
hold_channel = 1;
|
||||
|
||||
pthread_mutex_lock(&sim->RU_output_mutex[UE_id]);
|
||||
|
||||
if (sim->RU_output_mask[UE_id] == 0) { // This is the first eNodeB for this UE, clear the buffer
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
memset((void*)sim->r_re_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double));
|
||||
memset((void*)sim->r_im_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double));
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&sim->RU_output_mutex[UE_id]);
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
txdata = RC.ru[ru_id]->common.txdata;
|
||||
frame_parms = &RC.ru[ru_id]->frame_parms;
|
||||
|
||||
// sf_offset = (subframe*frame_parms->samples_per_tti) + offset;
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti);
|
||||
LOG_D(OCM,">>>>>>>>>>>>>>>>>TXPATH: RU %d : DL_sig reading TX for subframe %d (sf_offset %d, length %d) from %p\n",ru_id,subframe,sf_offset,length,txdata[0]+sf_offset);
|
||||
int length_meas = frame_parms->ofdm_symbol_size;
|
||||
if (sf_offset+length <= frame_parms->samples_per_tti*10) {
|
||||
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset+offset,
|
||||
nb_antennas_tx,
|
||||
length,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&sim->ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
|
||||
}
|
||||
else {
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
(frame_parms->samples_per_tti*10)-sf_offset,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&sim->ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
length+sf_offset-(frame_parms->samples_per_tti*10),
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&sim->ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
}
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(OCM,"[SIM][DL] subframe %d: txp (time) %d dB\n",
|
||||
subframe,dB_fixed(signal_energy(&txdata[0][sf_offset],length_meas)));
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] RU %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d\n",
|
||||
ru_id,CC_id,
|
||||
10*log10(tx_pwr),
|
||||
frame_parms->pdsch_config_common.referenceSignalPower,
|
||||
subframe);
|
||||
|
||||
#endif
|
||||
tx_pwr = signal_energy_fp(s_re,s_im,nb_antennas_tx,
|
||||
length<length_meas?length:length_meas,
|
||||
0)/(12.0*frame_parms->N_RB_DL);
|
||||
|
||||
//RU2UE[eNB_id][UE_id]->path_loss_dB = 0;
|
||||
multipath_channel(sim->RU2UE[ru_id][UE_id][CC_id],s_re,s_im,r_re0,r_im0,
|
||||
length,hold_channel);
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp2(sim->RU2UE[ru_id][UE_id][CC_id]->ch[0],
|
||||
sim->RU2UE[ru_id][UE_id][CC_id]->channel_length)*sim->RU2UE[ru_id][UE_id][CC_id]->channel_length;
|
||||
LOG_D(OCM,"[SIM][DL] Channel RU %d => UE %d (CCid %d): Channel gain %f dB (%f)\n",ru_id,UE_id,CC_id,10*log10(rx_pwr),rx_pwr);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
|
||||
for (i=0; i<sim->RU2UE[ru_id][UE_id][CC_id]->channel_length; i++)
|
||||
LOG_D(OCM,"channel(%d,%d)[%d] : (%f,%f)\n",ru_id,UE_id,i,sim->RU2UE[ru_id][UE_id][CC_id]->ch[0][i].x,sim->RU2UE[ru_id][UE_id][CC_id]->ch[0][i].y);
|
||||
|
||||
#endif
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] Channel RU %d => UE %d (CCid %d): tx_power %.1f dBm/RE, path_loss %1.f dB\n",
|
||||
ru_id,UE_id,CC_id,
|
||||
(double)frame_parms->pdsch_config_common.referenceSignalPower,
|
||||
sim->RU2UE[ru_id][UE_id][CC_id]->path_loss_dB);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,
|
||||
length<length_meas?length:length_meas,
|
||||
0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr %f dBm/RE (%f dBm RSSI,tx %f dB)for subframe %d (length %d)\n",UE_id,
|
||||
10*log10(rx_pwr),
|
||||
10*log10(rx_pwr*(double)frame_parms->N_RB_DL*12),
|
||||
10*log10(tx_pwr),subframe,
|
||||
length<length_meas?length:length_meas);
|
||||
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for subframe %d\n",
|
||||
UE_id,
|
||||
10*log10(sim->RU2UE[ru_id][UE_id][CC_id]->sampling_rate*1e6)-174,
|
||||
10*log10(sim->RU2UE[ru_id][UE_id][CC_id]->sampling_rate*1e6*12*frame_parms->N_RB_DL/(double)frame_parms->ofdm_symbol_size)-174,
|
||||
subframe);
|
||||
#endif
|
||||
|
||||
if (sim->RU2UE[ru_id][UE_id][CC_id]->first_run == 1)
|
||||
sim->RU2UE[ru_id][UE_id][CC_id]->first_run = 0;
|
||||
|
||||
|
||||
// RF model
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(OCM,"[SIM][DL] UE %d (CCid %d): rx_gain %d dB (-ADC %f) for subframe %d\n",UE_id,CC_id,PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB-66.227,subframe);
|
||||
#endif
|
||||
|
||||
rf_rx_simple(r_re0,
|
||||
r_im0,
|
||||
nb_antennas_rx,
|
||||
length,
|
||||
1e3/sim->RU2UE[ru_id][UE_id][CC_id]->sampling_rate, // sampling time (ns)
|
||||
(double)PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,
|
||||
nb_antennas_rx,
|
||||
length<length_meas?length:length_meas,
|
||||
0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in (RU %d) %f dBm/RE for subframe %d\n",
|
||||
UE_id,ru_id,
|
||||
10*log10(rx_pwr),subframe);
|
||||
#endif
|
||||
|
||||
|
||||
pthread_mutex_lock(&sim->RU_output_mutex[UE_id]);
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
sim->r_re_DL[UE_id][aa][i]+=r_re0[aa][i];
|
||||
sim->r_im_DL[UE_id][aa][i]+=r_im0[aa][i];
|
||||
}
|
||||
}
|
||||
sim->RU_output_mask[UE_id] |= (1<<ru_id);
|
||||
if (sim->RU_output_mask[UE_id] == (1<<RC.nb_RU)-1) {
|
||||
sim->RU_output_mask[UE_id]=0;
|
||||
|
||||
|
||||
|
||||
double *r_re_p[2] = {sim->r_re_DL[UE_id][0],sim->r_re_DL[UE_id][1]};
|
||||
double *r_im_p[2] = {sim->r_im_DL[UE_id][0],sim->r_im_DL[UE_id][1]};
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,length<length_meas?length:length_meas,0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dBm/RE for subframe %d\n",UE_id,10*log10(rx_pwr),subframe);
|
||||
#endif
|
||||
|
||||
rxdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.rxdata;
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti)+offset;
|
||||
|
||||
|
||||
adc(r_re_p,
|
||||
r_im_p,
|
||||
0,
|
||||
sf_offset,
|
||||
rxdata,
|
||||
nb_antennas_rx,
|
||||
length,
|
||||
12);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr2 = signal_energy(rxdata[0]+sf_offset,length<length_meas?length:length_meas)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (ADC out) %f dB/RE (%d) for subframe %d, writing to %p, length %d\n",UE_id, 10*log10((double)rx_pwr2),rx_pwr2,subframe,rxdata,length<length_meas?length:length_meas);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (ADC out) %f dB for subframe %d\n",UE_id,10*log10((double)rx_pwr2*12*frame_parms->N_RB_DL) ,subframe);
|
||||
#else
|
||||
UNUSED_VARIABLE(rx_pwr2);
|
||||
UNUSED_VARIABLE(tx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr);
|
||||
#endif
|
||||
|
||||
} // RU_output_mask
|
||||
pthread_mutex_unlock(&sim->RU_output_mutex[UE_id]);
|
||||
} // ru_id
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void do_UL_sig(sim_t *sim,
|
||||
uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,int ru_id,uint8_t CC_id)
|
||||
{
|
||||
|
||||
int32_t **txdata,**rxdata;
|
||||
uint8_t UE_id=0;
|
||||
|
||||
uint8_t nb_antennas_rx = sim->UE2RU[0][0][CC_id]->nb_rx; // number of rx antennas at eNB
|
||||
uint8_t nb_antennas_tx = sim->UE2RU[0][0][CC_id]->nb_tx; // number of tx antennas at UE
|
||||
|
||||
double tx_pwr, rx_pwr;
|
||||
int32_t rx_pwr2;
|
||||
uint32_t i,aa;
|
||||
uint32_t sf_offset,sf_offset_tdd;
|
||||
|
||||
uint8_t hold_channel=0;
|
||||
|
||||
double s_re0[30720];
|
||||
double s_re1[30720];
|
||||
double *s_re[2];
|
||||
double s_im0[30720];
|
||||
double s_im1[30720];
|
||||
double *s_im[2];
|
||||
double r_re00[30720];
|
||||
double r_re01[30720];
|
||||
double *r_re0[2];
|
||||
double r_im00[30720];
|
||||
double r_im01[30720];
|
||||
double *r_im0[2];
|
||||
|
||||
s_re[0] = s_re0;
|
||||
s_im[0] = s_im0;
|
||||
s_re[1] = s_re1;
|
||||
s_im[1] = s_im1;
|
||||
|
||||
r_re0[0] = r_re00;
|
||||
r_im0[0] = r_im00;
|
||||
r_re0[1] = r_re01;
|
||||
r_im0[1] = r_im01;
|
||||
|
||||
pthread_mutex_lock(&sim->UE_output_mutex[ru_id]);
|
||||
// Clear RX signal for eNB = eNB_id
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
sim->r_re_UL[ru_id][aa][i]=0.0;
|
||||
sim->r_im_UL[ru_id][aa][i]=0.0;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&sim->UE_output_mutex[ru_id]);
|
||||
|
||||
// Compute RX signal for eNB = eNB_id
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
|
||||
txdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.txdata;
|
||||
AssertFatal(txdata != NULL,"txdata is null\n");
|
||||
|
||||
sf_offset = subframe*frame_parms->samples_per_tti;
|
||||
if (subframe>0) sf_offset_tdd = sf_offset - PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset;
|
||||
else sf_offset_tdd = sf_offset;
|
||||
|
||||
LOG_D(OCM,"txdata for subframe %d (%d), power %d\n",subframe,sf_offset_tdd,dB_fixed(signal_energy(&txdata[0][sf_offset_tdd],frame_parms->samples_per_tti)));
|
||||
|
||||
if (((double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe] +
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->path_loss_dB) <= -125.0) {
|
||||
// don't simulate a UE that is too weak
|
||||
LOG_D(OCM,"[SIM][UL] ULPOWERS UE %d tx_pwr %d dBm (num_RE %d) for subframe %d (sf_offset %d,sf_offset_tdd %d)\n",
|
||||
UE_id,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
|
||||
subframe,sf_offset,sf_offset_tdd);
|
||||
} else {
|
||||
tx_pwr = dac_fixed_gain((double**)s_re,
|
||||
(double**)s_im,
|
||||
txdata,
|
||||
sf_offset_tdd,
|
||||
nb_antennas_tx,
|
||||
frame_parms->samples_per_tti,
|
||||
sf_offset_tdd,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
14,
|
||||
(double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe]-10*log10((double)PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]),
|
||||
1,
|
||||
NULL,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]); // This make the previous argument the total power
|
||||
LOG_D(OCM,"[SIM][UL] ULPOWERS UE %d tx_pwr %f dBm (target %d dBm, num_RE %d) for subframe %d (sf_offset %d,sf_offset_tdd %d)\n",
|
||||
UE_id,
|
||||
10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]),
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
|
||||
subframe,sf_offset,sf_offset_tdd);
|
||||
|
||||
|
||||
multipath_channel(sim->UE2RU[UE_id][ru_id][CC_id],s_re,s_im,r_re0,r_im0,
|
||||
frame_parms->samples_per_tti,hold_channel);
|
||||
|
||||
|
||||
rx_pwr = signal_energy_fp2(sim->UE2RU[UE_id][ru_id][CC_id]->ch[0],
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->channel_length)*sim->UE2RU[UE_id][ru_id][CC_id]->channel_length;
|
||||
|
||||
LOG_D(OCM,"[SIM][UL] subframe %d Channel UE %d => RU %d : %f dB (hold %d,length %d, PL %f)\n",subframe,UE_id,ru_id,10*log10(rx_pwr),
|
||||
hold_channel,sim->UE2RU[UE_id][ru_id][CC_id]->channel_length,
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->path_loss_dB);
|
||||
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,frame_parms->samples_per_tti,0);
|
||||
LOG_D(OCM,"[SIM][UL] RU %d (%d/%d rx antennas) : rx_pwr %f dBm (tx_pwr - PL %f) for subframe %d, sptti %d\n",
|
||||
ru_id,nb_antennas_rx,sim->UE2RU[UE_id][ru_id][CC_id]->nb_rx,10*log10(rx_pwr),10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe])+sim->UE2RU[UE_id][ru_id][CC_id]->path_loss_dB,subframe,frame_parms->samples_per_tti);
|
||||
/*
|
||||
if (abs(10*log10(rx_pwr)-10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe])-UE2RU[UE_id][ru_id][CC_id]->path_loss_dB)>3) {
|
||||
write_output("txsig_re.m","s_re",s_re[0],frame_parms->samples_per_tti,1,7);
|
||||
write_output("txsig_im.m","s_im",s_im[0],frame_parms->samples_per_tti,1,7);
|
||||
write_output("rxsig_re.m","r_re",r_re0[0],frame_parms->samples_per_tti,1,7);
|
||||
write_output("rxsig_im.m","r_im",r_im0[0],frame_parms->samples_per_tti,1,7);
|
||||
exit(-1);
|
||||
}*/
|
||||
|
||||
if (sim->UE2RU[UE_id][ru_id][CC_id]->first_run == 1)
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->first_run = 0;
|
||||
|
||||
|
||||
pthread_mutex_lock(&sim->UE_output_mutex[ru_id]);
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
sim->r_re_UL[ru_id][aa][i]+=r_re0[aa][i];
|
||||
sim->r_im_UL[ru_id][aa][i]+=r_im0[aa][i];
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&sim->UE_output_mutex[ru_id]);
|
||||
}
|
||||
} //UE_id
|
||||
|
||||
double *r_re_p[2] = {sim->r_re_UL[ru_id][0],sim->r_re_UL[ru_id][1]};
|
||||
double *r_im_p[2] = {sim->r_im_UL[ru_id][0],sim->r_im_UL[ru_id][1]};
|
||||
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->samples_per_tti,0);
|
||||
LOG_D(OCM,"[SIM][UL] RU %d (%d/%d rx antennas) : rx_pwr %f dBm (before RF) for subframe %d, gain %f\n",
|
||||
ru_id,nb_antennas_rx,nb_antennas_rx,10*log10(rx_pwr),subframe,
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx - 66.227);
|
||||
rf_rx_simple(r_re_p,
|
||||
r_im_p,
|
||||
nb_antennas_rx,
|
||||
frame_parms->samples_per_tti,
|
||||
1e3/sim->UE2RU[0][ru_id][CC_id]->sampling_rate, // sampling time (ns)
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->samples_per_tti,0);//*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL;
|
||||
LOG_D(OCM,"[SIM][UL] rx_pwr (ADC in) %f dB for subframe %d (rx_gain %f)\n",10*log10(rx_pwr),subframe,
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx);
|
||||
#endif
|
||||
|
||||
rxdata = RC.ru[ru_id]->common.rxdata;
|
||||
sf_offset = subframe*frame_parms->samples_per_tti;
|
||||
if (subframe>0) sf_offset_tdd = sf_offset - RC.ru[ru_id]->N_TA_offset;
|
||||
else sf_offset_tdd = sf_offset;
|
||||
|
||||
|
||||
adc(r_re_p,
|
||||
r_im_p,
|
||||
0,
|
||||
sf_offset_tdd,
|
||||
rxdata,
|
||||
nb_antennas_rx,
|
||||
frame_parms->samples_per_tti,
|
||||
12);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr2 = signal_energy(rxdata[0]+sf_offset_tdd,frame_parms->samples_per_tti)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][UL] RU %d rx_pwr (ADC out) %f dB (%d) for subframe %d (offset %d) = %p\n",ru_id,10*log10((double)rx_pwr2),rx_pwr2,subframe,sf_offset,rxdata[0]+sf_offset_tdd);
|
||||
#else
|
||||
UNUSED_VARIABLE(tx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr2);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef __SIMULATION_TOOLS_DEFS_H__
|
||||
#define __SIMULATION_TOOLS_DEFS_H__
|
||||
#include "PHY/defs_common.h"
|
||||
|
||||
#include <pthread.h>
|
||||
/** @defgroup _numerical_ Useful Numerical Functions
|
||||
*@{
|
||||
The present clause specifies several numerical functions for testing of digital communication systems.
|
||||
@@ -181,6 +181,31 @@ typedef enum {
|
||||
EPA_high,
|
||||
} SCM_t;
|
||||
|
||||
#include "platform_constants.h"
|
||||
|
||||
typedef struct {
|
||||
channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
double r_re_DL[NUMBER_OF_UE_MAX][2][30720];
|
||||
double r_im_DL[NUMBER_OF_UE_MAX][2][30720];
|
||||
double r_re_UL[NUMBER_OF_eNB_MAX][2][30720];
|
||||
double r_im_UL[NUMBER_OF_eNB_MAX][2][30720];
|
||||
int RU_output_mask[NUMBER_OF_UE_MAX];
|
||||
int UE_output_mask[NUMBER_OF_RU_MAX];
|
||||
pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX];
|
||||
pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX];
|
||||
pthread_mutex_t subframe_mutex;
|
||||
int subframe_ru_mask;
|
||||
int subframe_UE_mask;
|
||||
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
openair0_timestamp last_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
double ru_amp[NUMBER_OF_RU_MAX];
|
||||
pthread_t rfsim_thread;
|
||||
} sim_t;
|
||||
|
||||
|
||||
/**
|
||||
\brief This routine initializes a new channel descriptor
|
||||
\param nb_tx Number of TX antennas
|
||||
@@ -373,6 +398,20 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
double N_RB2sampling_rate(uint16_t N_RB);
|
||||
double N_RB2channel_bandwidth(uint16_t N_RB);
|
||||
|
||||
#include "targets/RT/USER/rfsim.h"
|
||||
|
||||
void do_DL_sig(sim_t *sim,
|
||||
uint16_t subframe,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms,
|
||||
uint8_t UE_id,
|
||||
int CC_id);
|
||||
|
||||
void do_UL_sig(sim_t *sim,
|
||||
uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,int ru_id,uint8_t CC_id);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user