Commit 6463bb93 authored by Florian Kaltenberger's avatar Florian Kaltenberger

deleting some old unused files

oaisim now also compiles with OPENAIR2=0
PDCCH now generates dummy data instead of zeors (needed for power measurements)
fixed bug in DAC (power levels)


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4483 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c0ea1f68
......@@ -2065,9 +2065,10 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
y[0] = &yseq0[0];
y[1] = &yseq1[0];
//memset(e,0,DCI_BITS_MAX);
// reset all bits to <NIL>, here we set <NIL> elements as 2
memset(e, 2, DCI_BITS_MAX);
//memset(e, 2, DCI_BITS_MAX);
// here we interpred NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0;i<DCI_BITS_MAX;i++) e[i]=taus()&1;
e_ptr = e;
// generate DCIs in order of decreasing aggregation level, then common/ue spec
......
......@@ -57,6 +57,7 @@ extern char mode_string[4][20];
#ifndef OPENAIR2
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
extern unsigned char NB_RN_INST;
#endif
extern int flag_LA;
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <execinfo.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.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"
#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;
unsigned int bigphys_top;
unsigned int mem_base;
int setup_oai_hw(LTE_DL_FRAME_PARMS *frame_parms) {
int i;
int openair_fd,fc;
printf("Setting frequency to %d,%d,%d,%d Hz, Gain to %d,%d,%d,%d dB\n",
frame_parms->carrier_freq[0],frame_parms->carrier_freq[1],frame_parms->carrier_freq[2],frame_parms->carrier_freq[3],
frame_parms->rxgain[0],frame_parms->rxgain[1],frame_parms->rxgain[2],frame_parms->rxgain[3]);
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);
}
return(openair_fd);
}
#ifdef OPENAIR_LTE
void setup_ue_buffers(PHY_VARS_UE *phy_vars_ue, LTE_DL_FRAME_PARMS *frame_parms, int carrier) {
int i;
if (phy_vars_ue) {
if ((frame_parms->nb_antennas_rx>1) && (carrier>0)) {
printf("RX antennas > 1 and carrier > 0 not possible\n");
exit(-1);
}
if ((frame_parms->nb_antennas_tx>1) && (carrier>0)) {
printf("TX antennas > 1 and carrier > 0 not possible\n");
exit(-1);
}
// 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] = (s32*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[i+carrier]-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] = (s32*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[i+carrier]-bigphys_top+mem_base);
printf("txdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.txdata[i]);
}
}
}
void setup_eNB_buffers(PHY_VARS_eNB *phy_vars_eNB, LTE_DL_FRAME_PARMS *frame_parms, int carrier) {
int i,j;
if (phy_vars_eNB) {
if ((frame_parms->nb_antennas_rx>1) && (carrier>0)) {
printf("RX antennas > 1 and carrier > 0 not possible\n");
exit(-1);
}
if ((frame_parms->nb_antennas_tx>1) && (carrier>0)) {
printf("TX antennas > 1 and carrier > 0 not possible\n");
exit(-1);
}
// 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] = (s32*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[i+carrier]-bigphys_top+mem_base);
printf("rxdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
for (j=0;j<16;j++) {
printf("rxbuffer %d: %x\n",j,phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i][j]);
phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i][j] = 16-j;
}
}
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] = (s32*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[i+carrier]-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);
}
}
}
#endif
#ifdef OPENAIR_ITS
void setup_dot11_buffers(s32 **rxdata,s32 **txdata,int antenna_index) {
int i;
printf("rxdata %p,txdata %p : Antenna %d\n",rxdata,txdata,antenna_index);
*rxdata = (s32*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[antenna_index]-bigphys_top+mem_base);
printf("rxdata @ %p\n",*rxdata);
*txdata = (s32*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[antenna_index]-bigphys_top+mem_base);
printf("txdata @ %p\n",*txdata);
for (i=0;i<76800;i++) {
if (i<1024)
((uint32_t *)*txdata)[i] = 0x0;
else
((uint32_t *)*txdata)[i] = 0x00010001;
}
}
#endif
#include "PHY/defs.h"
#ifdef OPENAIR_LTE
int setup_oai_hw(LTE_DL_FRAME_PARMS *frame_parms);
void setup_ue_buffers(PHY_VARS_UE *phy_vars_ue, LTE_DL_FRAME_PARMS *frame_parms, int carrier);
void setup_eNB_buffers(PHY_VARS_eNB *phy_vars_eNB, LTE_DL_FRAME_PARMS *frame_parms);
#endif
#ifdef OPENAIR_ITS
int setup_oai_hw();
void setup_dot11_buffers(s32 **rxdata,s32 **txdata,int antenna_index);
#endif
......@@ -64,14 +64,13 @@ double dac_fixed_gain(double **s_re,
int aa;
double amp,amp1;
amp = pow(10.0,.05*txpwr_dBm);
amp = amp/sqrt(nb_tx_antennas); //this is amp per tx antenna
amp = pow(10.0,.05*txpwr_dBm)/sqrt(nb_tx_antennas); //this is amp per tx antenna
amp1 = sqrt((double)signal_energy((s32*)&input[0][input_offset_meas],length_meas));
if (nb_tx_antennas>1) {
amp1 += sqrt((double)signal_energy((s32*)&input[1][input_offset_meas],length_meas));
amp1/=2;
amp1 = 0;
for (aa=0;aa<nb_tx_antennas;aa++) {
amp1 += sqrt((double)signal_energy((s32*)&input[aa][input_offset_meas],length_meas) * (512.0/300.0));
}
amp1/=nb_tx_antennas;
//printf("UL: amp1 %f dB (%d,%d), tx_power %f\n",20*log10(amp1),input_offset,input_offset_meas,txpwr_dBm);
......
......@@ -4,7 +4,7 @@ include Makerules
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux
CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ; else if grep --silent User\ Mode\ Linux /proc/cpuinfo ; then echo "-mssse3" ; else echo ""; fi; fi)
CPUFLAGS += $(shell if grep --silent sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
......@@ -20,7 +20,7 @@ SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP
export S1AP_DIR
export COMMON_UTILS_DIR
CFLAGS = -Wall -fno-strict-aliasing -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -g -ggdb $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS = -O2 -Wall -fno-strict-aliasing -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -g -ggdb $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
ifdef ENABLE_ITTI
CFLAGS += -DENABLE_ITTI
......@@ -418,6 +418,9 @@ rrm_std_cellular:
cleanall: clean cleanasn1
@if [ -d $(S1AP_DIR) ];then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB cleanall; fi
cleanalmostall: clean
rm -f $(ASN1_MSG_OBJS1)
clean:
@$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean
@$(RM_F_V) oaisim
......@@ -458,6 +461,9 @@ cleancell:
@$(RM_F_V) $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.o
@$(RM_F_V) $(OPENAIR2_DIR)/NAS/SIMU_CELLULAR/*.d
cleanlfds:
$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean
print:
# @echo $(cygwin)
@echo "OBJ " $(OBJ)
......
......@@ -546,11 +546,13 @@ void *l2l1_task(void *args_p) {
EMU,
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n", eNB_id, frame, slot, next_slot >> 1, last_slot>>1, PHY_vars_eNB_g[eNB_id]->lte_frame_parms.frame_type, PHY_vars_eNB_g[eNB_id]->lte_frame_parms.tdd_config, PHY_vars_eNB_g[eNB_id]->lte_frame_parms.Nid_cell);
#ifdef OPENAIR2
//Appliation: traffic gen
update_otg_eNB (eNB_id, oai_emulation.info.time_ms);
//IP/OTG to PDCP and PDCP to IP operation
pdcp_run (frame, 1, 0, eNB_id); //PHY_vars_eNB_g[eNB_id]->Mod_id
#endif
// PHY_vars_eNB_g[eNB_id]->frame = frame;
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, no_relay, NULL);
......@@ -594,11 +596,13 @@ void *l2l1_task(void *args_p) {
if (frame > 0) {
PHY_vars_UE_g[UE_id]->frame = frame;
#ifdef OPENAIR2
//Application
update_otg_UE (UE_id, oai_emulation.info.time_ms);
//Access layer
pdcp_run (frame, 0, UE_id, 0);
#endif
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag, normal_txrx,
no_relay, NULL);
......
......@@ -446,7 +446,7 @@ void check_and_adjust_params() {
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
#if defined(ENABLE_PDCP_NETLINK_FIFO)
#if defined(ENABLE_PDCP_NETLINK_FIFO) && defined(OPENAIR2)
pdcp_netlink_init();
#endif
......@@ -471,6 +471,7 @@ void check_and_adjust_params() {
}
#ifdef OPENAIR2
void init_omv() {
if (oai_emulation.info.omv_enabled == 1) {
......@@ -506,6 +507,7 @@ if(close( pfd[0] ) == -1 ) // we close the write desc.
perror("close on read\n" );
}
}
#endif
void init_seed(u8 set_seed) {
......@@ -804,8 +806,9 @@ void update_ocm() {
}
}
#ifdef OPENAIR2
void update_otg_eNB(int module_id, unsigned int ctime) {
#if defined(USER_MODE) && defined(OAI_EMU)
#if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ) {
int dst_id, app_id;
......@@ -980,6 +983,7 @@ void update_otg_UE(int UE_id, unsigned int ctime) {
}
#endif
}
#endif
int init_slot_isr(void)
{
......
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