Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canghaiwuhen
OpenXG-RAN
Commits
c57a990f
Commit
c57a990f
authored
Dec 02, 2016
by
Xiwen JIANG
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature-21-TM7
parents
c20b26f2
a78ef7c9
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1015 additions
and
117 deletions
+1015
-117
cmake_targets/autotests/README.txt
cmake_targets/autotests/README.txt
+9
-0
cmake_targets/autotests/run_exec_lte-softmodem_tests.py
cmake_targets/autotests/run_exec_lte-softmodem_tests.py
+14
-9
cmake_targets/autotests/test_case_list.xml
cmake_targets/autotests/test_case_list.xml
+733
-95
common/utils/T/T_messages.txt
common/utils/T/T_messages.txt
+2
-2
common/utils/T/tracer/enb.c
common/utils/T/tracer/enb.c
+40
-0
common/utils/T/tracer/gui/xy_plot.c
common/utils/T/tracer/gui/xy_plot.c
+7
-7
common/utils/T/tracer/logger/Makefile
common/utils/T/tracer/logger/Makefile
+1
-1
common/utils/T/tracer/logger/logger.h
common/utils/T/tracer/logger/logger.h
+5
-0
common/utils/T/tracer/logger/ticked_ttilog.c
common/utils/T/tracer/logger/ticked_ttilog.c
+196
-0
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+8
-3
No files found.
cmake_targets/autotests/README.txt
View file @
c57a990f
...
...
@@ -268,6 +268,15 @@ Obj.# Case# Test# Description
02 55 22 Band 7 FDD 10MHz DL Throughput (TCP) for 300 sec for 2TX/2RX (TM2)
02 55 23 Band 7 FDD 20MHz DL Throughput (TCP) for 300 sec for 2TX/2RX (TM2)
02 57 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ OAI UE
02 57 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
02 57 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
02 57 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
02 57 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
02 57 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
02 57 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 64 lte-softmodem-noS1 tests
02 Functional test case
...
...
cmake_targets/autotests/run_exec_lte-softmodem_tests.py
View file @
c57a990f
...
...
@@ -552,7 +552,7 @@ def wait_testcaseclass_generic_threads(threadListGeneric, timeout = 1):
# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml)
# \param ExmimoRfStop command to stop EXMIMO Card
# \param nruns_lte-softmodem global parameter to override number of runs (nruns) within the test case
def
handle_testcaseclass_softmodem
(
testcase
,
oldprogramList
,
logdirOAI5GRepo
,
logdirOpenaircnRepo
,
MachineList
,
user
,
password
,
CleanUpAluLteBox
,
ExmimoRfStop
,
nruns_lte_softmodem
,
timeout_cmd
):
def
handle_testcaseclass_softmodem
(
testcase
,
oldprogramList
,
logdirOAI5GRepo
,
logdirOpenaircnRepo
,
MachineList
,
user
,
password
,
CleanUpAluLteBox
,
ExmimoRfStop
,
nruns_lte_softmodem
,
GitOAI5GRepoBranch
,
GitOpenaircnRepoBranch
,
timeout_cmd
):
#We ignore the password sent to this function for secuirity reasons for password present in log files
#It is recommended to add a line in /etc/sudoers that looks something like below. The line below will run sudo without password prompt
# your_user_name ALL=(ALL:ALL) NOPASSWD: ALL
...
...
@@ -583,7 +583,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
RRH_main_exec
=
testcase
.
findtext
(
'RRH_main_exec'
,
default
=
''
)
RRH_main_exec_args
=
testcase
.
findtext
(
'RRH_main_exec_args'
,
default
=
''
)
RRH_terminate_missing_procs
=
testcase
.
findtext
(
'RRH_terminate_missing_procs'
,
default
=
'False'
)
RRH_branch
=
testcase
.
findtext
(
'RRH_branch'
,
default
=
GitOAI5GRepoBranch
)
eNBMachine
=
testcase
.
findtext
(
'eNB'
,
default
=
''
)
eNB_config_file
=
testcase
.
findtext
(
'eNB_config_file'
,
default
=
''
)
...
...
@@ -599,6 +599,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
eNB_search_expr_true
=
testcase
.
findtext
(
'eNB_search_expr_true'
,
''
)
if
re
.
compile
(
'\w+'
).
match
(
eNB_search_expr_true
)
!=
None
:
eNB_search_expr_true
=
eNB_search_expr_true
+
' duration='
+
str
(
timeout_cmd
-
90
)
+
's'
eNB_branch
=
testcase
.
findtext
(
'eNB_branch'
,
default
=
GitOAI5GRepoBranch
)
UEMachine
=
testcase
.
findtext
(
'UE'
,
default
=
''
)
UE_config_file
=
testcase
.
findtext
(
'UE_config_file'
,
default
=
''
)
...
...
@@ -615,6 +616,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
UE_stop_script
=
testcase
.
findtext
(
'UE_stop_script'
,
''
)
if
re
.
compile
(
'\w+'
).
match
(
UE_search_expr_true
)
!=
None
:
UE_search_expr_true
=
UE_search_expr_true
+
' duration='
+
str
(
timeout_cmd
-
90
)
+
's'
UE_branch
=
testcase
.
findtext
(
'UE_branch'
,
default
=
GitOAI5GRepoBranch
)
EPCMachine
=
testcase
.
findtext
(
'EPC'
,
default
=
''
)
EPC_config_file
=
testcase
.
findtext
(
'EPC_config_file'
,
default
=
''
)
...
...
@@ -633,6 +635,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
EPC_traffic_exec_args
=
testcase
.
findtext
(
'EPC_traffic_exec_args'
,
default
=
''
)
EPC_terminate_missing_procs
=
testcase
.
findtext
(
'EPC_terminate_missing_procs'
,
default
=
'False'
)
EPC_search_expr_true
=
testcase
.
findtext
(
'EPC_search_expr_true'
,
''
)
EPC_branch
=
testcase
.
findtext
(
'EPC_branch'
,
default
=
GitOpenaircnRepoBranch
)
if
re
.
compile
(
'\w+'
).
match
(
EPC_search_expr_true
)
!=
None
:
EPC_search_expr_true
=
EPC_search_expr_true
+
' duration='
+
str
(
timeout_cmd
-
90
)
+
's'
...
...
@@ -709,7 +713,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
logfile_task_RRH_out
=
logdir_RRH
+
'/RRH_task_out'
+
'_'
+
str
(
run
)
+
'_.log'
logfile_task_RRH
=
logdir_local_testcase
+
'/RRH_task'
+
'_'
+
str
(
run
)
+
'_.log'
task_RRH_compile
=
' ( uname -a ; date
\n
'
task_RRH_compile
=
task_RRH_compile
+
'cd '
+
logdirOAI5GRepo
+
' ; source oaienv ; source cmake_targets/tools/build_helper
\n
'
task_RRH_compile
=
task_RRH_compile
+
'cd '
+
logdirOAI5GRepo
+
'; git reset --hard HEAD ; git checkout '
+
RRH_branch
+
' ; source oaienv
\n
'
task_RRH_compile
=
task_RRH_compile
+
' source cmake_targets/tools/build_helper
\n
'
task_RRH_compile
=
task_RRH_compile
+
'env |grep OPENAIR
\n
'
task_RRH_compile
=
task_RRH_compile
+
update_config_file
(
oai_RRH
,
RRH_config_file
,
logdirOAI5GRepo
,
'$OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py'
)
+
'
\n
'
if
RRH_compile_prog
!=
""
:
...
...
@@ -749,7 +754,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
logfile_pcap_tmp_eNB
=
'/tmp/'
+
'/eNB_tshark'
+
'_'
+
str
(
run
)
+
'_.pcap'
task_eNB_compile
=
' ( uname -a ; date
\n
'
task_eNB_compile
=
task_eNB_compile
+
'cd '
+
logdirOAI5GRepo
+
' ; source oaienv ; source cmake_targets/tools/build_helper
\n
'
task_eNB_compile
=
task_eNB_compile
+
'cd '
+
logdirOAI5GRepo
+
'; git reset --hard HEAD ; git checkout '
+
eNB_branch
+
' ; source oaienv
\n
'
task_eNB_compile
=
task_eNB_compile
+
' source cmake_targets/tools/build_helper
\n
'
task_eNB_compile
=
task_eNB_compile
+
'env |grep OPENAIR
\n
'
task_eNB_compile
=
task_eNB_compile
+
update_config_file
(
oai_eNB
,
eNB_config_file
,
logdirOAI5GRepo
,
'$OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py'
)
+
'
\n
'
if
eNB_compile_prog
!=
""
:
...
...
@@ -799,8 +805,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
task_UE_compile
=
' ( uname -a ; date
\n
'
task_UE_compile
=
task_UE_compile
+
'array_exec_pid=()'
+
'
\n
'
task_UE_compile
=
task_UE_compile
+
'cd '
+
logdirOAI5GRepo
+
'
\n
'
task_UE_compile
=
task_UE_compile
+
'source oaienv
\n
'
task_UE_compile
=
task_UE_compile
+
'cd '
+
logdirOAI5GRepo
+
'; git reset --hard HEAD ; git checkout '
+
UE_branch
+
' ; source oaienv
\n
'
task_UE_compile
=
task_UE_compile
+
'source cmake_targets/tools/build_helper
\n
'
task_UE_compile
=
task_UE_compile
+
'env |grep OPENAIR
\n
'
task_UE_compile
=
task_UE_compile
+
update_config_file
(
oai_UE
,
UE_config_file
,
logdirOAI5GRepo
,
'$OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py'
)
+
'
\n
'
...
...
@@ -850,7 +855,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
task_EPC_compile
=
' ( uname -a ; date
\n
'
task_EPC_compile
=
task_EPC_compile
+
'array_exec_pid=()'
+
'
\n
'
task_EPC_compile
=
task_EPC_compile
+
'cd '
+
logdirOpenaircnRepo
+
'
; source oaienv
\n
'
task_EPC_compile
=
task_EPC_compile
+
'cd '
+
logdirOpenaircnRepo
+
'
; git reset --hard HEAD ; git checkout '
+
EPC_branch
+
' ; source oaienv
\n
'
task_EPC_compile
=
task_EPC_compile
+
update_config_file
(
oai_EPC
,
EPC_config_file
,
logdirOpenaircnRepo
,
logdirOpenaircnRepo
+
'/TEST/autotests/tools/search_repl.py'
)
+
'
\n
'
task_EPC_compile
=
task_EPC_compile
+
'source BUILD/TOOLS/build_helper
\n
'
if
EPC_compile_prog
!=
""
:
...
...
@@ -2203,7 +2208,7 @@ for testcase in testcaseList:
print
"eNBMachine : "
+
eNBMachine
+
"UEMachine : "
+
UEMachine
+
"EPCMachine : "
+
EPCMachine
+
"MachineList : "
+
','
.
join
(
MachineList
)
print
"testcasename = "
+
testcasename
+
" class = "
+
testcaseclass
#cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop)
handle_testcaseclass_softmodem
(
testcase
,
CleanUpOldProgs
,
logdirOAI5GRepo
,
logdirOpenaircnRepo
,
MachineList
,
user
,
pw
,
CleanUpAluLteBox
,
ExmimoRfStop
,
nruns_lte_softmodem
,
Timeout_cmd
)
handle_testcaseclass_softmodem
(
testcase
,
CleanUpOldProgs
,
logdirOAI5GRepo
,
logdirOpenaircnRepo
,
MachineList
,
user
,
pw
,
CleanUpAluLteBox
,
ExmimoRfStop
,
nruns_lte_softmodem
,
GitOAI5GRepoBranch
,
GitOpenaircnRepoBranch
,
Timeout_cmd
)
#The lines below are copied from below to trace the failure of some of the machines in test setup. These lines below need to be removed in long term
print
"Creating xml file for overall results..."
...
...
cmake_targets/autotests/test_case_list.xml
View file @
c57a990f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
common/utils/T/T_messages.txt
View file @
c57a990f
...
...
@@ -16,7 +16,7 @@ ID = ENB_PHY_DL_TICK
ID = ENB_PHY_DLSCH_UE_DCI
DESC = eNodeB downlink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid
: int,mcs
ID = ENB_PHY_DLSCH_UE_ACK
DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
GROUP = ALL:PHY:GRAPHIC:ENB
...
...
@@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK
ID = ENB_PHY_ULSCH_UE_DCI
DESC = eNodeB uplink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
: int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION
DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top)
GROUP = ALL:PHY:GRAPHIC:ENB
...
...
common/utils/T/tracer/enb.c
View file @
c57a990f
...
...
@@ -32,6 +32,8 @@ typedef struct {
widget
*
pucch1_energy_ue_xy_plot
;
widget
*
pucch_iq_ue_xy_plot
;
widget
*
dl_ul_harq_ue_label
;
widget
*
dl_mcs_xy_plot
;
widget
*
ul_mcs_xy_plot
;
logger
*
pusch_iq_ue_logger
;
logger
*
ul_estimate_ue_logger
;
logger
*
pucch1_energy_ue_threshold_logger
;
...
...
@@ -44,6 +46,8 @@ typedef struct {
logger
*
ul_dci_retransmission_logger
[
8
];
logger
*
ul_ack_logger
[
8
];
logger
*
ul_nack_logger
[
8
];
logger
*
dl_mcs_logger
;
logger
*
ul_mcs_logger
;
}
enb_gui
;
typedef
struct
{
...
...
@@ -137,6 +141,10 @@ static void set_current_ue(gui *g, enb_data *e, int ue)
xy_plot_set_title
(
g
,
e
->
e
->
pucch_iq_ue_xy_plot
,
s
);
sprintf
(
s
,
"DL/UL HARQ (x8) [UE %d]"
,
ue
);
label_set_text
(
g
,
e
->
e
->
dl_ul_harq_ue_label
,
s
);
sprintf
(
s
,
"DL MCS [UE %d]"
,
ue
);
xy_plot_set_title
(
g
,
e
->
e
->
dl_mcs_xy_plot
,
s
);
sprintf
(
s
,
"UL MCS [UE %d]"
,
ue
);
xy_plot_set_title
(
g
,
e
->
e
->
ul_mcs_xy_plot
,
s
);
logger_set_filter
(
e
->
e
->
pusch_iq_ue_logger
,
filter_eq
(
...
...
@@ -175,6 +183,14 @@ static void set_current_ue(gui *g, enb_data *e, int ue)
logger_set_filter
(
e
->
e
->
ul_nack_logger
[
i
],
ticktime_filter
(
e
->
database
,
"ENB_PHY_ULSCH_UE_NACK"
,
i
,
ue
));
}
logger_set_filter
(
e
->
e
->
dl_mcs_logger
,
filter_eq
(
filter_evarg
(
e
->
database
,
"ENB_PHY_DLSCH_UE_DCI"
,
"UE_id"
),
filter_int
(
ue
)));
logger_set_filter
(
e
->
e
->
ul_mcs_logger
,
filter_eq
(
filter_evarg
(
e
->
database
,
"ENB_PHY_ULSCH_UE_DCI"
,
"UE_id"
),
filter_int
(
ue
)));
}
static
void
click
(
void
*
private
,
gui
*
g
,
...
...
@@ -309,6 +325,30 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
logger_add_view
(
l
,
v
);
e
->
pucch_iq_ue_logger
=
l
;
/* UE x DL mcs */
line
=
new_container
(
g
,
HORIZONTAL
);
widget_add_child
(
g
,
top_container
,
line
,
-
1
);
w
=
new_xy_plot
(
g
,
128
,
55
,
""
,
20
);
xy_plot_set_range
(
g
,
w
,
0
,
1024
*
10
,
-
2
,
30
);
e
->
dl_mcs_xy_plot
=
w
;
widget_add_child
(
g
,
line
,
w
,
-
1
);
l
=
new_ticked_ttilog
(
h
,
database
,
"ENB_PHY_DL_TICK"
,
"frame"
,
"subframe"
,
"ENB_PHY_DLSCH_UE_DCI"
,
"mcs"
,
0
,
-
1
);
v
=
new_view_tti
(
10
,
g
,
w
,
new_color
(
g
,
"#0c0c72"
));
logger_add_view
(
l
,
v
);
e
->
dl_mcs_logger
=
l
;
/* UE x UL mcs */
w
=
new_xy_plot
(
g
,
128
,
55
,
""
,
20
);
xy_plot_set_range
(
g
,
w
,
0
,
1024
*
10
,
-
2
,
30
);
e
->
ul_mcs_xy_plot
=
w
;
widget_add_child
(
g
,
line
,
w
,
-
1
);
l
=
new_ticked_ttilog
(
h
,
database
,
"ENB_PHY_DL_TICK"
,
"frame"
,
"subframe"
,
"ENB_PHY_ULSCH_UE_DCI"
,
"mcs"
,
0
,
-
1
);
v
=
new_view_tti
(
10
,
g
,
w
,
new_color
(
g
,
"#0c0c72"
));
logger_add_view
(
l
,
v
);
e
->
ul_mcs_logger
=
l
;
/* downlink/uplink UE DCIs */
widget_add_child
(
g
,
top_container
,
new_label
(
g
,
"DL/UL TICK/DCI/ACK/NACK [all UEs]"
),
-
1
);
...
...
common/utils/T/tracer/gui/xy_plot.c
View file @
c57a990f
...
...
@@ -70,7 +70,7 @@ static void paint(gui *_gui, widget *_this)
*/
char
v
[
64
];
int
vwidth
,
dummy
;
floa
t
x
=
(
k
*
ticstep
-
allocated_xmin
)
/
in
t
x
=
(
k
*
ticstep
-
allocated_xmin
)
/
(
allocated_xmax
-
allocated_xmin
)
*
(
allocated_plot_width
-
1
);
x_draw_line
(
g
->
x
,
g
->
xwin
,
FOREGROUND_COLOR
,
...
...
@@ -85,7 +85,7 @@ static void paint(gui *_gui, widget *_this)
this
->
common
.
y
+
this
->
common
.
height
-
this
->
label_height
*
2
+
this
->
label_baseline
,
v
);
LOGD
(
"tic k %d val %g x %
g
\n
"
,
k
,
k
*
ticstep
,
x
);
LOGD
(
"tic k %d val %g x %
d
\n
"
,
k
,
k
*
ticstep
,
x
);
}
/* vertical tics */
...
...
@@ -112,7 +112,7 @@ static void paint(gui *_gui, widget *_this)
for
(
k
=
kmin
;
k
<=
kmax
;
k
++
)
{
char
v
[
64
];
int
vwidth
,
dummy
;
floa
t
y
=
(
k
*
ticstep
-
allocated_ymin
)
/
in
t
y
=
(
k
*
ticstep
-
allocated_ymin
)
/
(
allocated_ymax
-
allocated_ymin
)
*
(
allocated_plot_height
-
1
);
sprintf
(
v
,
"%g"
,
k
*
ticstep
);
...
...
common/utils/T/tracer/logger/Makefile
View file @
c57a990f
...
...
@@ -2,7 +2,7 @@ CC=gcc
CFLAGS
=
-Wall
-g
-pthread
-I
..
OBJS
=
logger.o textlog.o framelog.o ttilog.o timelog.o ticklog.o iqlog.o
\
iqdotlog.o
iqdotlog.o
ticked_ttilog.o
logger.a
:
$(OBJS)
ar cr logger.a
$(OBJS)
...
...
common/utils/T/tracer/logger/logger.h
View file @
c57a990f
...
...
@@ -10,6 +10,10 @@ logger *new_textlog(void *event_handler, void *database,
logger
*
new_ttilog
(
void
*
event_handler
,
void
*
database
,
char
*
event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
data_varname
,
int
convert_to_dB
);
logger
*
new_ticked_ttilog
(
void
*
event_handler
,
void
*
database
,
char
*
tick_event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
event_name
,
char
*
data_varname
,
int
convert_to_dB
,
float
empty_value
);
logger
*
new_timelog
(
void
*
event_handler
,
void
*
database
,
char
*
event_name
);
logger
*
new_ticklog
(
void
*
event_handler
,
void
*
database
,
char
*
event_name
,
char
*
frame_name
,
char
*
subframe_name
);
...
...
@@ -28,5 +32,6 @@ void textlog_dump_buffer(logger *_this, int dump_buffer);
void
logger_add_view
(
logger
*
l
,
view
*
v
);
void
logger_set_filter
(
logger
*
l
,
void
*
filter
);
void
ticked_ttilog_set_tick_filter
(
logger
*
l
,
void
*
filter
);
#endif
/* _LOGGER_H_ */
common/utils/T/tracer/logger/ticked_ttilog.c
0 → 100644
View file @
c57a990f
#include "logger.h"
#include "logger_defs.h"
#include "event.h"
#include "database.h"
#include "handler.h"
#include "filter/filter.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
struct
ticked_ttilog
{
struct
logger
common
;
void
*
database
;
int
tick_frame_arg
;
int
tick_subframe_arg
;
int
data_frame_arg
;
int
data_subframe_arg
;
int
data_arg
;
int
convert_to_dB
;
int
last_tick_frame
;
int
last_tick_subframe
;
float
last_value
;
float
empty_value
;
char
*
tick_event_name
;
unsigned
long
tick_handler_id
;
/* tick filter - NULL is no filter set */
void
*
tick_filter
;
};
static
void
_event
(
void
*
p
,
event
e
)
{
struct
ticked_ttilog
*
l
=
p
;
int
frame
;
int
subframe
;
float
value
;
if
(
l
->
common
.
filter
!=
NULL
&&
filter_eval
(
l
->
common
.
filter
,
e
)
==
0
)
return
;
frame
=
e
.
e
[
l
->
data_frame_arg
].
i
;
subframe
=
e
.
e
[
l
->
data_subframe_arg
].
i
;
if
(
frame
!=
l
->
last_tick_frame
||
subframe
!=
l
->
last_tick_subframe
)
{
printf
(
"WARNING: %s:%d: data comes without previous tick!
\n
"
,
__FILE__
,
__LINE__
);
return
;
}
switch
(
e
.
e
[
l
->
data_arg
].
type
)
{
case
EVENT_INT
:
value
=
e
.
e
[
l
->
data_arg
].
i
;
break
;
case
EVENT_ULONG
:
value
=
e
.
e
[
l
->
data_arg
].
ul
;
break
;
default:
printf
(
"%s:%d: unsupported type
\n
"
,
__FILE__
,
__LINE__
);
abort
();
}
if
(
l
->
convert_to_dB
)
value
=
10
*
log10
(
value
);
l
->
last_value
=
value
;
}
static
void
_tick_event
(
void
*
p
,
event
e
)
{
struct
ticked_ttilog
*
l
=
p
;
int
i
;
int
frame
;
int
subframe
;
if
(
l
->
tick_filter
!=
NULL
&&
filter_eval
(
l
->
tick_filter
,
e
)
==
0
)
return
;
frame
=
e
.
e
[
l
->
tick_frame_arg
].
i
;
subframe
=
e
.
e
[
l
->
tick_subframe_arg
].
i
;
for
(
i
=
0
;
i
<
l
->
common
.
vsize
;
i
++
)
l
->
common
.
v
[
i
]
->
append
(
l
->
common
.
v
[
i
],
frame
,
subframe
,
l
->
last_value
);
l
->
last_value
=
l
->
empty_value
;
l
->
last_tick_frame
=
frame
;
l
->
last_tick_subframe
=
subframe
;
}
logger
*
new_ticked_ttilog
(
event_handler
*
h
,
void
*
database
,
char
*
tick_event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
event_name
,
char
*
data_varname
,
int
convert_to_dB
,
float
empty_value
)
{
struct
ticked_ttilog
*
ret
;
int
event_id
;
database_event_format
f
;
int
i
;
ret
=
calloc
(
1
,
sizeof
(
struct
ticked_ttilog
));
if
(
ret
==
NULL
)
abort
();
ret
->
common
.
event_name
=
strdup
(
event_name
);
if
(
ret
->
common
.
event_name
==
NULL
)
abort
();
ret
->
database
=
database
;
ret
->
convert_to_dB
=
convert_to_dB
;
ret
->
tick_event_name
=
strdup
(
tick_event_name
);
if
(
ret
->
tick_event_name
==
NULL
)
abort
();
ret
->
empty_value
=
empty_value
;
ret
->
last_value
=
empty_value
;
/* tick event */
event_id
=
event_id_from_name
(
database
,
tick_event_name
);
ret
->
tick_handler_id
=
register_handler_function
(
h
,
event_id
,
_tick_event
,
ret
);
f
=
get_format
(
database
,
event_id
);
/* look for frame and subframe */
ret
->
tick_frame_arg
=
-
1
;
ret
->
tick_subframe_arg
=
-
1
;
for
(
i
=
0
;
i
<
f
.
count
;
i
++
)
{
if
(
!
strcmp
(
f
.
name
[
i
],
frame_varname
))
ret
->
tick_frame_arg
=
i
;
if
(
!
strcmp
(
f
.
name
[
i
],
subframe_varname
))
ret
->
tick_subframe_arg
=
i
;
}
if
(
ret
->
tick_frame_arg
==
-
1
)
{
printf
(
"%s:%d: frame argument '%s' not found in event '%s'
\n
"
,
__FILE__
,
__LINE__
,
frame_varname
,
event_name
);
abort
();
}
if
(
ret
->
tick_subframe_arg
==
-
1
)
{
printf
(
"%s:%d: subframe argument '%s' not found in event '%s'
\n
"
,
__FILE__
,
__LINE__
,
subframe_varname
,
event_name
);
abort
();
}
if
(
strcmp
(
f
.
type
[
ret
->
tick_frame_arg
],
"int"
)
!=
0
)
{
printf
(
"%s:%d: argument '%s' has wrong type (should be 'int')
\n
"
,
__FILE__
,
__LINE__
,
frame_varname
);
abort
();
}
if
(
strcmp
(
f
.
type
[
ret
->
tick_subframe_arg
],
"int"
)
!=
0
)
{
printf
(
"%s:%d: argument '%s' has wrong type (should be 'int')
\n
"
,
__FILE__
,
__LINE__
,
subframe_varname
);
abort
();
}
/* data event */
event_id
=
event_id_from_name
(
database
,
event_name
);
ret
->
common
.
handler_id
=
register_handler_function
(
h
,
event_id
,
_event
,
ret
);
f
=
get_format
(
database
,
event_id
);
/* look for frame, subframe and data args */
ret
->
data_frame_arg
=
-
1
;
ret
->
data_subframe_arg
=
-
1
;
ret
->
data_arg
=
-
1
;
for
(
i
=
0
;
i
<
f
.
count
;
i
++
)
{
if
(
!
strcmp
(
f
.
name
[
i
],
frame_varname
))
ret
->
data_frame_arg
=
i
;
if
(
!
strcmp
(
f
.
name
[
i
],
subframe_varname
))
ret
->
data_subframe_arg
=
i
;
if
(
!
strcmp
(
f
.
name
[
i
],
data_varname
))
ret
->
data_arg
=
i
;
}
if
(
ret
->
data_frame_arg
==
-
1
)
{
printf
(
"%s:%d: frame argument '%s' not found in event '%s'
\n
"
,
__FILE__
,
__LINE__
,
frame_varname
,
event_name
);
abort
();
}
if
(
ret
->
data_subframe_arg
==
-
1
)
{
printf
(
"%s:%d: subframe argument '%s' not found in event '%s'
\n
"
,
__FILE__
,
__LINE__
,
subframe_varname
,
event_name
);
abort
();
}
if
(
ret
->
data_arg
==
-
1
)
{
printf
(
"%s:%d: data argument '%s' not found in event '%s'
\n
"
,
__FILE__
,
__LINE__
,
data_varname
,
event_name
);
abort
();
}
if
(
strcmp
(
f
.
type
[
ret
->
data_frame_arg
],
"int"
)
!=
0
)
{
printf
(
"%s:%d: argument '%s' has wrong type (should be 'int')
\n
"
,
__FILE__
,
__LINE__
,
frame_varname
);
abort
();
}
if
(
strcmp
(
f
.
type
[
ret
->
data_subframe_arg
],
"int"
)
!=
0
)
{
printf
(
"%s:%d: argument '%s' has wrong type (should be 'int')
\n
"
,
__FILE__
,
__LINE__
,
subframe_varname
);
abort
();
}
if
(
strcmp
(
f
.
type
[
ret
->
data_arg
],
"int"
)
!=
0
&&
strcmp
(
f
.
type
[
ret
->
data_arg
],
"float"
)
!=
0
)
{
printf
(
"%s:%d: argument '%s' has wrong type"
" (should be 'int' or 'float')
\n
"
,
__FILE__
,
__LINE__
,
data_varname
);
abort
();
}
return
ret
;
}
void
ticked_ttilog_set_tick_filter
(
logger
*
_l
,
void
*
filter
)
{
struct
ticked_ttilog
*
l
=
(
struct
ticked_ttilog
*
)
_l
;
free
(
l
->
tick_filter
);
l
->
tick_filter
=
filter
;
}
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
c57a990f
...
...
@@ -763,7 +763,8 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
T
(
T_ENB_PHY_DLSCH_UE_DCI
,
T_INT
(
eNB
->
Mod_id
),
T_INT
(
frame
),
T_INT
(
subframe
),
T_INT
(
UE_id
),
T_INT
(
dci_alloc
->
rnti
),
T_INT
(
dci_alloc
->
format
),
T_INT
(
eNB
->
dlsch
[(
int
)
UE_id
][
0
]
->
current_harq_pid
));
T_INT
(
eNB
->
dlsch
[(
int
)
UE_id
][
0
]
->
current_harq_pid
),
T_INT
(
eNB
->
dlsch
[(
int
)
UE_id
][
0
]
->
harq_processes
[
eNB
->
dlsch
[(
int
)
UE_id
][
0
]
->
current_harq_pid
]
->
mcs
));
eNB
->
dlsch
[(
uint8_t
)
UE_id
][
0
]
->
nCCE
[
subframe
]
=
dci_alloc
->
firstCCE
;
...
...
@@ -857,8 +858,12 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
eNB
->
ulsch
[(
uint32_t
)
UE_id
]
->
harq_processes
[
harq_pid
]
->
subframe_scheduling_flag
=
1
;
T
(
T_ENB_PHY_ULSCH_UE_DCI
,
T_INT
(
eNB
->
Mod_id
),
T_INT
(
frame
),
T_INT
(
subframe
),
T_INT
(
UE_id
),
T_INT
(
dci_alloc
->
rnti
),
T_INT
(
harq_pid
));
T_INT
(
dci_alloc
->
rnti
),
T_INT
(
harq_pid
),
T_INT
(
eNB
->
ulsch
[(
uint32_t
)
UE_id
]
->
harq_processes
[
harq_pid
]
->
mcs
),
T_INT
(
eNB
->
ulsch
[(
uint32_t
)
UE_id
]
->
harq_processes
[
harq_pid
]
->
round
),
T_INT
(
eNB
->
ulsch
[(
uint32_t
)
UE_id
]
->
harq_processes
[
harq_pid
]
->
first_rb
),
T_INT
(
eNB
->
ulsch
[(
uint32_t
)
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
),
T_INT
(
eNB
->
ulsch
[(
uint32_t
)
UE_id
]
->
harq_processes
[
harq_pid
]
->
TBS
));
}
void
pdsch_procedures
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
LTE_eNB_DLSCH_t
*
dlsch
,
LTE_eNB_DLSCH_t
*
dlsch1
,
LTE_eNB_UE_stats
*
ue_stats
,
int
ra_flag
,
int
num_pdcch_symbols
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment