Commit 087dc65d authored by thomas's avatar thomas
Browse files

Fixed include paths in mexfiles and modified makefiles


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4241 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2d784ce8
include $(OPENAIR1_DIR)/SIMULATION/LTE_PHY/Makefile
CFLAGS += -DMEX
CFLAGS += -I/packages/matlab_r2012a/extern/include/
CFLAGS += -I/opt/MATLAB/extern/include/
# Set mex extension, can be determined with mexext function in Matlab
MEXEXT = mexglx
# Just compile all the PHY objects
OBJ = $(PHY_OBJS) $(TOP_DIR)/SIMULATION/TOOLS/taus.o
OBJ = $(PHY_OBJS) $(TOP_DIR)/SIMULATION/TOOLS/taus.o $(LOG_DIR)/log.o $(LOG_DIR)/vcd_signal_dumper.o
# List of all mex-files to compile
MEX_FILES += ./PHY/LTE_TRANSPORT/mexfiles/get_tbs.$(MEXEXT)
......@@ -43,7 +43,7 @@ libs : $(OBJ)
$(MEX_FILES) : %.$(MEXEXT) : %.c
@echo
@echo Compiling $< ...
@mex CFLAGS="$(CFLAGS)" -f /homes/wagner/.matlab/R2012a/mexopts.sh -l$(LIBNAME) -L$(LIBDIR) -output $@ $<
@mex CFLAGS="$(CFLAGS)" -l$(LIBNAME) -L$(LIBDIR) -output $@ $<
mex : $(MEX_FILES)
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_channel_compensation_prec.c
*
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_channel_level_prec.c
*
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_encoding.c
......@@ -33,7 +33,7 @@ void mexFunction( int mlhs, mxArray *plhs[],
LTE_UE_DLSCH_t* dlsch;
LTE_DL_FRAME_PARMS *frame_parms;
PHY_VARS_UE *phy_vars_ue;
extern int *pi2tab[188],*pi5tab[188],*pi4tab[188],*pi6tab[188];
extern int *pi2tab16[188],*pi5tab16[188],*pi4tab16[188],*pi6tab16[188];
unsigned int *ptr_td;
int *tmp[1];
......@@ -54,7 +54,7 @@ void mexFunction( int mlhs, mxArray *plhs[],
#endif
/* Create new dlsch */
dlsch = new_ue_dlsch(Kmimo,Mdlharq,abstraction_flag);
dlsch = new_ue_dlsch(Kmimo,Mdlharq,8,25,abstraction_flag);
// Init CRC tables
crcTableInit();
......@@ -70,16 +70,16 @@ void mexFunction( int mlhs, mxArray *plhs[],
#endif
memcpy(&tmp[0], &ptr_td[0], sizeof(ptr_td[0]));
memcpy(&pi2tab[0], tmp[0], 188*sizeof(pi2tab[0]));
memcpy(&pi2tab16[0], tmp[0], 188*sizeof(pi2tab16[0]));
memcpy(&tmp[0], &ptr_td[1], sizeof(ptr_td[1]));
memcpy(&pi4tab[0], tmp[0], 188*sizeof(pi4tab[0]));
memcpy(&pi4tab16[0], tmp[0], 188*sizeof(pi4tab16[0]));
memcpy(&tmp[0], &ptr_td[2], sizeof(ptr_td[2]));
memcpy(&pi5tab[0], tmp[0], 188*sizeof(pi5tab[0]));
memcpy(&pi5tab16[0], tmp[0], 188*sizeof(pi5tab16[0]));
memcpy(&tmp[0], &ptr_td[3], sizeof(ptr_td[3]));
memcpy(&pi6tab[0], tmp[0], 188*sizeof(pi6tab[0]));
memcpy(&pi6tab16[0], tmp[0], 188*sizeof(pi6tab16[0]));
harq_pid = (unsigned char) mxGetScalar(mxGetField(prhs[2],0,"harq_pid"));
dlsch->current_harq_pid = harq_pid;
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_encoding_init.c
*
* Returns the decoded bit sequence.
*
* example: dlsch_encoding_init(struct1)
* example: dlsch_decoding_init(struct1)
*
* Author: Sebastian Wagner
* Date: 23-07-2012
......@@ -18,7 +18,7 @@ void mexFunction( int mlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[]
)
{
extern int *pi2tab[188],*pi5tab[188],*pi4tab[188],*pi6tab[188];
extern int *pi2tab16[188],*pi5tab16[188],*pi4tab16[188],*pi6tab16[188];
int i;
unsigned int *ptr;
int **tmp[1];
......@@ -31,20 +31,20 @@ void mexFunction( int mlhs, mxArray *plhs[],
plhs[0] = mxCreateNumericMatrix(4,1, mxUINT32_CLASS, mxREAL);
ptr = (unsigned int*) mxGetData(plhs[0]);
tmp[0] = &pi2tab[0];
tmp[0] = &pi2tab16[0];
memcpy(&ptr[0], tmp, sizeof(tmp[0]));
tmp[0] = &pi4tab[0];
tmp[0] = &pi4tab16[0];
memcpy(&ptr[1], tmp, sizeof(tmp[0]));
tmp[0] = &pi5tab[0];
tmp[0] = &pi5tab16[0];
memcpy(&ptr[2], tmp, sizeof(tmp[0]));
tmp[0] = &pi6tab[0];
tmp[0] = &pi6tab16[0];
memcpy(&ptr[3], tmp, sizeof(tmp[0]));
#ifdef DEBUG_DLSCH_DECODING_INIT
mexPrintf("pi2tab %p\n",&pi2tab[0]);
mexPrintf("pi4tab %p\n",&pi4tab[0]);
mexPrintf("pi5tab %p\n",&pi5tab[0]);
mexPrintf("pi6tab %p\n",&pi6tab[0]);
mexPrintf("pi2tab %p\n",&pi2tab16[0]);
mexPrintf("pi4tab %p\n",&pi4tab16[0]);
mexPrintf("pi5tab %p\n",&pi5tab16[0]);
mexPrintf("pi6tab %p\n",&pi6tab16[0]);
mexPrintf("ptr0 %p\n",ptr[0]);
mexPrintf("ptr1 %p\n",ptr[1]);
......@@ -55,9 +55,9 @@ void mexFunction( int mlhs, mxArray *plhs[],
// The memory here is never explictly freed via mxFree. It is implicitly taken
// care of by clear functions at the beginning of the simulation.
for (i=0;i<188;i++) {
mexMakeMemoryPersistent((void *) pi2tab[i]);
mexMakeMemoryPersistent((void *) pi5tab[i]);
mexMakeMemoryPersistent((void *) pi4tab[i]);
mexMakeMemoryPersistent((void *) pi6tab[i]);
mexMakeMemoryPersistent((void *) pi2tab16[i]);
mexMakeMemoryPersistent((void *) pi5tab16[i]);
mexMakeMemoryPersistent((void *) pi4tab16[i]);
mexMakeMemoryPersistent((void *) pi6tab16[i]);
}
}
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_detection_mrc.c
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_dual_stream_correlation.c
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_encoding.c
......@@ -71,7 +71,7 @@ void mexFunction( int nlhs, mxArray *plhs[],
abstraction_flag = (unsigned char) mxGetScalar(tmp);
}
dlsch = new_eNB_dlsch(Kmimo,Mdlharq,abstraction_flag);
dlsch = new_eNB_dlsch(Kmimo,Mdlharq,25,abstraction_flag);
/* Allocate input */
input_buffer = (unsigned char*) mxGetData(prhs[0]);
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* dlsch_mu_mimo_llr.c
*
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* get_tbs.c
......
#include "defs.h"
#include "../../../defs.h"
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[]
......
......@@ -47,8 +47,13 @@ simparms.tseeds = set_taus_seed(1); % taus seeds
simparms.ptr_td = dlsch_decoding_init();
% Init codewords
% simparms.codeword(1) = InitCodeword(simparms,mcs(1));
% simparms.codeword(2) = InitCodeword(simparms,mcs(2));
simparms.codeword(1) = InitCodeword(simparms,mcs(1));
simparms.codeword(2) = InitCodeword(simparms,mcs(2));
% simparms.codeword(3) = InitCodeword(simparms,mcs(1));
% simparms.codeword(4) = InitCodeword(simparms,mcs(1));
end
......
......@@ -29,13 +29,12 @@ addpath('../../../PHY/TOOLS/mexfiles');
addpath('../../../SIMULATION/TOOLS/mexfiles');
% profile on;
%% System parameters
nt = 2; % number of transmit antennas
nr = 2; % number of receive antennas
N = 100; % number of frames (or subframes, codewords)
nSNR = 1; % number of SNR points
SNRdB = 20; % SNR per receive antenna in dB
SNRdB = 5; % SNR per receive antenna in dB
% nSNR = 13;
% SNRdB = linspace(8,20,nSNR);
MCS = [16 16]; % MCS for the 2 users
......@@ -84,7 +83,7 @@ noise = zeros(simparms.NB_ANTENNAS_RX,simparms.nb_re);
%% XFORMS
if (XFORMS)
scrsz = get(0,'ScreenSize');
scrsz = get(0,'ScreenSize');mu_mimo
figure('Position',[1 scrsz(4)/2 scrsz(3)/2 scrsz(4)/2])
subplot(1,2,1);
xlim([1 simparms.codeword(1).G]);
......@@ -199,7 +198,7 @@ for iSNR=1:length(simparms.snr)
Hmagb0(idxs:idxe,:)]...
= dlsch_channel_compensation_prec(y_fxp_t,H_fxp_t,pmi_ext,simparms,simparms.codeword(1),symbol-1);
% Interfering user
% Interfering stream
[ymf1(idxs:idxe,:)...
Heff1(idxs:idxe,:)...
Hmag1(idxs:idxe,:)...
......
......@@ -18,15 +18,16 @@ addpath('../../../PHY/TOOLS/mexfiles');
addpath('../../../SIMULATION/TOOLS/mexfiles');
% profile on;
tic
%% System parameters
nt = 2;
nr = 1;
nr = 2;
N = 1000; % number of frames (codewords)
nSNR = 1;
SNRdB = 30;
%SNRdB = [1:20];
SNRdB = 10;
% nSNR = 13;
% SNRdB = linspace(8,20,nSNR);
%SNRdB = linspace(1,20,nSNR);
MCS = [9 9]; % MCS for the 2 users, currently it is assumed that mcs(2)=mcs(1)
j = sqrt(-1);
amp = 1/32;
......@@ -237,12 +238,12 @@ for iSNR=1:length(simparms.snr)
end
%% Post Processing
% total_frame_erros = sum(frame_errors,2);
% fer = total_frame_erros/N;
% figure; semilogy(SNRdB,fer); grid;
% total_frame_erros = sum(simparms.frame_errors,2);
% fer = total_frame_erros/N;
% figure; semilogy(SNRdB,fer); grid;
%
% disp(fer);
%
% disp(fer);
% profile viewer
toc
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* set_taus_seed.c
......
#include "defs.h"
#include "../../../defs.h"
/*==============================================================================
* taus.c
......@@ -62,7 +62,6 @@ void mexFunction( int nlhs, mxArray *plhs[],
for(i=0;i<len;i++)
out[i] = (unsigned char)(mtaus()&0xff);
tseeds_out[0] = s0;
tseeds_out[1] = s1;
tseeds_out[2] = s2;
......
#include "./lib/mex.h"
#include "mex.h"
#include "../../SIMULATION/TOOLS/defs.h"
#include "../../PHY/types.h"
#include "../../PHY/defs.h"
......
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