Commit 486b48f9 authored by Florian Kaltenberger's avatar Florian Kaltenberger

moving old simulators


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7227 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 43d5d1f9
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 # -Wno-packed-bitfield-compat
LFLAGS = -lm -lblas -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
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
CFLAGS += -DNO_RRM -DOPENAIR2 #-DPHY_ABSTRACTION
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
all: colabsim
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)
ifdef XFORMS
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
endif
$(OBJ) : %.o : %.c
@echo
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
colabsim : $(OBJ) colabsim.c
@echo "Compiling colabsim.c ..."
@$(CC) colabsim.c -o colabsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f colabsim
rm -f *.exe*
showcflags :
@echo $(CFLAGS)
* TDD mode 1
* [du]lsch_ue_col for collaborative links
* Define TBS_FIX (pilots for several CH)
* Document output result file format
* Add end-to-end HARQ strategy
* AMC?
* Describe placement of data in LTE frame
* Automatic RB allocation
* MR bler statistics
This diff is collapsed.
function r = read_results(f)
%r = read_results(f)
%
%Reads colabsim simulation results from file f.
%
%Arguments:
% f - results file (produced with -r option to colabsim)
%
%Returns:
% r - results structure with the following fields:
% n_relays: number of relays
% channel_model: the used channel model as a string
% n_tests: the number of tests done (each with different SNR)
% n_pdu: the number of sent MAC PDUs for each test
% n_harq: the maximum number of HARQ rounds
% tests: struct array of length n_tests containing the following fields:
% snr_hop{1,2}: SNRs for each link in hop {1,2}
% n_frames_hop{1,2}: number of transmitted LTE frames in hop {1,2}
% n_bits_hop{1,2}: number of correctly received information bits in hop {1,2}
% n_pdu_success_hop{1,2}: number of correctly received MAC PDUs in hop {1,2}
% ber_hop1: vector of average raw BER at relays
% ber_hop2: average raw BER at destination CH
% n_harq_tries_hop{1,2}: number of transmitted MAC PDUs in each HARQ round in hop {1,2}
% n_harq_success_hop{1,2}: number of successfully decoded MAC PDUs in each HARQ round in hop {1,2}
% mcs_hop{1,2}: MCS used in each transmission in hop {1,2}
% tbs_hop{1,2}: TBS used in each transmission in hop {1,2}
% n_rb_hop{1,2}: number of resource blocks used in each transmission in hop {1,2}
% n_transmissions: distribution of the number of required transmissions in each hop for the
% successfully decoded MAC PDUs, n_transmissions(n1,n2) is the number of successfully decoded
% MAC PDUs that required n1 transmissions in hop 1 and n2 transmissions in hop 2
% relay_activity: number of transmissions with different cooperation level of relays,
% for n_relays==2 there are four values: [0 MR1 MR2 MR1+MR2], this is for all transmissions
% over hop 2, even if the PDU was not finally received at the destination CH
fid = fopen(f, 'r');
A = mread(fid, 1, 5);
r.n_relays = A(1);
r.channel_model = parse_channel(A(2));
r.n_tests = A(3);
r.n_pdu = A(4);
r.n_harq = A(5);
n_relays = A(1);
n_tests = A(3);
n_pdu = A(4);
n_harq = A(5);
test_row = 1;
for test = 1:n_tests
r.tests(test).snr_hop1 = mread(fid, 1, n_relays);
r.tests(test).snr_hop2 = mread(fid, 1, n_relays);
A = mread(fid, 1, 6);
r.tests(test).n_frames_hop1 = A(1);
r.tests(test).n_frames_hop2 = A(2);
r.tests(test).n_bits_hop1 = A(3);
r.tests(test).n_bits_hop2 = A(4);
r.tests(test).n_pdu_success_hop1 = A(5);
r.tests(test).n_pdu_success_hop2 = A(6);
A = mread(fid, 1, n_relays+1);
r.tests(test).ber_hop1 = A(1:end-1);
r.tests(test).ber_hop2 = A(end);
r.tests(test).n_harq_tries_hop1 = mread(fid, 1, n_harq);
r.tests(test).n_harq_success_hop1 = mread(fid, 1, n_harq);
r.tests(test).n_harq_tries_hop2 = mread(fid, 1, n_harq);
r.tests(test).n_harq_success_hop2 = mread(fid, 1, n_harq);
r.tests(test).mcs_hop1 = mread(fid, n_pdu, n_harq);
r.tests(test).mcs_hop2 = mread(fid, n_pdu, n_harq);
r.tests(test).tbs_hop1 = mread(fid, n_pdu, n_harq);
r.tests(test).tbs_hop2 = mread(fid, n_pdu, n_harq);
r.tests(test).n_rb_hop1 = mread(fid, n_pdu, n_harq);
r.tests(test).n_rb_hop2 = mread(fid, n_pdu, n_harq);
r.tests(test).n_transmissions = mread(fid, n_harq, n_harq);
r.tests(test).relay_activity = mread(fid, 1, 2^n_relays);
end
fclose(fid);
function s = parse_channel(c)
s = sprintf('%d', c);
function A = mread(fid, nrow, ncol)
A = fscanf(fid, '%f', [ncol,nrow])';
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