Commit a1bf3268 authored by Florian Kaltenberger's avatar Florian Kaltenberger

moving old simulators

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7228 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 486b48f9
This diff is collapsed.
include $(OPENAIR_HOME)/common/utils/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -rdynamic -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat
LFLAGS = -lm -lblas -lxml2 -lrt
CFLAGS += -m32 -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
# Debugging flags
#CFLAGS += -DDEBUG_DLSCH_CODING
#CFLAGS += -DDEBUG_DLSCH_DECODING
#CFLAGS += -DDEBUG_LOGMAP
# Always use this flag with relaysim. Will be fixed in future versions.
CFLAGS += -DREL_AMPLIFY_FORWARD
# Use this flag if you want to run relaysim with only 1 relay node.
#CFLAGS += -DSINGLE_RELAY
# This is a flag to use different patterns for RVI (redundancy versions)
# Normally it is (0,0,1,1). If you use this flag, it is used as (0,1,1,0).
CFLAGS += -DRVI_PATTERN_ALT
# This flag is used in relayQMFsim where relays are Quantize-Forward relays.
# with this option you get results which assumes there is no error in the first link (Source-Relays).
# This kind of an upper bound to the performance of QMF relays in this scenario after LLR adjustment at the destination.
#CFLAGS += -DQF_UPPER_BOUND
CFLAGS += -DNO_RRM #-DOPENAIR2 -DPHY_ABSTRACTION
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
ifdef BIT8_TX
CFLAGS += -DBIT8_TX
endif
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
ifdef ENABLE_FXP
CFLAGS += -DENABLE_FXP # Fxp only
else
ifdef ENABLE_FLP
CFLAGS += -DENABLE_FLP # dual_stream_correlation(), channel_compensation_prec() and qam16_qam16_mu_mimo() are flp (independently)
else
ifdef ENABLE_FULL_FLP
CFLAGS += -DENABLE_FULL_FLP # Flp inside of rx_pdsch() (dlsch_detection_mrc(), dual_stream_correlation(), channel_compensation_prec(), qam16_qam16_mu_mimo() and dlsch_16qam_16qam_llr)
else
CFLAGS += -DENABLE_FXP # Fxp only by default
endif
endif
endif
ifdef COMPARE_FLP_AND_FXP
CFLAGS += -DCOMPARE_FLP_AND_FXP
endif
include $(TOP_DIR)/PHY/Makefile.inc
#SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) $(UTIL_incl)
# EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) #$(ASN1_MSG_OBJS)
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
OBJ += openair_hw.o
all: relaysim
$(OBJ) : %.o : %.c
@echo
@echo Compiling $< ...
$(CC) -c $(CFLAGS) -o $@ $<
relaysim : $(OBJ) relaysim.c
@echo "Compiling relaysim.c ..."
$(CC) relaysim.c -o relaysim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f relaysim
rm -f *.exe*
showcflags :
@echo $(CFLAGS)
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <execinfo.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "SIMULATION/TOOLS/defs.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "MAC_INTERFACE/extern.h"
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
#include "ARCH/COMMON/defs.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "LAYER2/MAC/extern.h"
TX_RX_VARS dummy_tx_rx_vars;
int pci_buffers[2*NB_ANTENNAS_RX];
int openair_fd,fc;
unsigned int bigphys_top;
unsigned int mem_base;
int setup_oai_hw(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *phy_vars_ue,
PHY_VARS_eNB *phy_vars_eNB)
{
int i,j;
frame_parms->dual_tx = 0;
frame_parms->freq_idx = 0;
fc = 0;
printf("Opening /dev/openair0\n");
if ((openair_fd = open("/dev/openair0", O_RDWR)) <0) {
fprintf(stderr,"Error %d opening /dev/openair0\n",openair_fd);
exit(-1);
}
ioctl(openair_fd,openair_DUMP_CONFIG,frame_parms);
sleep(1);
// ioctl(openair_fd,openair_GET_BUFFER,(void *)&fc);
ioctl(openair_fd,openair_GET_VARS,&dummy_tx_rx_vars);
ioctl(openair_fd,openair_GET_BIGPHYSTOP,(void *)&bigphys_top);
if (dummy_tx_rx_vars.TX_DMA_BUFFER[0]==NULL) {
printf("pci_buffers not allocated\n");
close(openair_fd);
exit(-1);
}
printf("BIGPHYS top 0x%x\n",bigphys_top);
printf("RX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.RX_DMA_BUFFER[0]);
printf("TX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.TX_DMA_BUFFER[0]);
mem_base = (unsigned int) mmap(0,
BIGPHYS_NUMPAGES*4096,
PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_FIXED,//MAP_SHARED,
openair_fd,
0);
if (mem_base != -1)
msg("MEM base= 0x%x\n",mem_base);
else {
msg("Could not map physical memory\n");
close(openair_fd);
exit(-1);
}
if (phy_vars_ue) {
// replace RX signal buffers with mmaped HW versions
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
free(phy_vars_ue->lte_ue_common_vars.rxdata[i]);
phy_vars_ue->lte_ue_common_vars.rxdata[i] = (int32_t*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("rxdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.rxdata[i]);
}
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
free(phy_vars_ue->lte_ue_common_vars.txdata[i]);
phy_vars_ue->lte_ue_common_vars.txdata[i] = (int32_t*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("txdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.txdata[i]);
}
}
if (phy_vars_eNB) {
// replace RX signal buffers with mmaped HW versions
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
free(phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i] = (int32_t*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("rxdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
}
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
free(phy_vars_eNB->lte_eNB_common_vars.txdata[0][i]);
phy_vars_eNB->lte_eNB_common_vars.txdata[0][i] = (int32_t*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[0]-bigphys_top+mem_base);
printf("txdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.txdata[0][i]);
for (j=0; j<16; j++) {
printf("txbuffer %d: %x\n",j,phy_vars_eNB->lte_eNB_common_vars.txdata[0][i][j]);
phy_vars_eNB->lte_eNB_common_vars.txdata[0][i][j] = 16-j;
}
// msync(openair_fd);
}
}
return(openair_fd);
}
This file is created by Emre Atsan. emre.atsan@epfl.ch, ARNI, EPFL, CH.
------------------------------------------------------------
Link level simulations for CONECT project Diamond Relay Network Scenario.
We assume Half-Duplex relays and a proper scheduling in which two relays never transmit at the same time.
* relaysim: This file is an extension to dlsim with additional channels created for the second source-relay and relay-destination paths. Relays are AF (Amplify-Forward relays in this simulation).
* relayQMFsim: Similar to relaysim, except relays are Quantize-Forward relays.
This diff is collapsed.
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