Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
openairinterface5G
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
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
zhangtu
openairinterface5G
Commits
17322170
Commit
17322170
authored
Oct 18, 2017
by
David Price
Browse files
Options
Browse Files
Download
Plain Diff
Merged RU-RAU-split as of 18 Oct
parents
1ec934f9
599ba826
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
4443 additions
and
277 deletions
+4443
-277
cmake_targets/autotests/v2/actions/bandrich.txt
cmake_targets/autotests/v2/actions/bandrich.txt
+10
-0
common/utils/T/T.c
common/utils/T/T.c
+1
-1
common/utils/T/local_tracer.c
common/utils/T/local_tracer.c
+5
-5
common/utils/T/tracer/enb.c
common/utils/T/tracer/enb.c
+36
-24
common/utils/T/tracer/extract_input_subframe.c
common/utils/T/tracer/extract_input_subframe.c
+37
-3
nfapi/nfapi_interface.h
nfapi/nfapi_interface.h
+3855
-0
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
+2
-7
openair1/PHY/LTE_TRANSPORT/dci.c
openair1/PHY/LTE_TRANSPORT/dci.c
+7
-0
openair1/PHY/LTE_TRANSPORT/dci_tools.c
openair1/PHY/LTE_TRANSPORT/dci_tools.c
+26
-32
openair1/PHY/LTE_TRANSPORT/phich.c
openair1/PHY/LTE_TRANSPORT/phich.c
+5
-4
openair1/PHY/LTE_TRANSPORT/proto.h
openair1/PHY/LTE_TRANSPORT/proto.h
+1
-1
openair1/PHY/LTE_TRANSPORT/pucch.c
openair1/PHY/LTE_TRANSPORT/pucch.c
+1
-1
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+11
-6
openair1/PHY/MODULATION/ofdm_mod.c
openair1/PHY/MODULATION/ofdm_mod.c
+19
-36
openair1/PHY/TOOLS/time_meas.c
openair1/PHY/TOOLS/time_meas.c
+1
-2
openair1/PHY/defs.h
openair1/PHY/defs.h
+17
-3
openair1/SCHED/fapi_l1.c
openair1/SCHED/fapi_l1.c
+1
-2
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+45
-66
openair1/SCHED/ru_procedures.c
openair1/SCHED/ru_procedures.c
+173
-11
openair2/LAYER2/MAC/config.c
openair2/LAYER2/MAC/config.c
+1
-1
openair2/LAYER2/MAC/defs.h
openair2/LAYER2/MAC/defs.h
+0
-1
openair2/LAYER2/MAC/eNB_scheduler.c
openair2/LAYER2/MAC/eNB_scheduler.c
+10
-2
openair2/LAYER2/MAC/eNB_scheduler_RA.c
openair2/LAYER2/MAC/eNB_scheduler_RA.c
+7
-7
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+23
-9
openair2/LAYER2/MAC/eNB_scheduler_mch.c
openair2/LAYER2/MAC/eNB_scheduler_mch.c
+2
-2
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+14
-1
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+14
-38
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+2
-0
openair2/LAYER2/MAC/ra_procedures.c
openair2/LAYER2/MAC/ra_procedures.c
+2
-0
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+2
-0
openair2/PHY_INTERFACE/IF_Module.c
openair2/PHY_INTERFACE/IF_Module.c
+82
-2
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+31
-10
No files found.
cmake_targets/autotests/v2/actions/bandrich.txt
View file @
17322170
...
...
@@ -13,6 +13,16 @@ containing lines:
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666"
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666"
To avoid NetworkManager to play with the bandrich, add also the line:
ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MM_DEVICE_IGNORE}="1"
Maybe also add; , ENV{ID_MM_DEVICE_IGNORE}="1"
to the two other lines.
Then run: udevadm control --reload-rules
And: service network-manager restart
Change vendor_id/model_id/serial/interface num to match yours.
Use lsusb -v to find values.
...
...
common/utils/T/T.c
View file @
17322170
...
...
@@ -36,7 +36,7 @@ static void get_message(int s)
int
is_on
;
if
(
read
(
s
,
&
t
,
1
)
!=
1
)
QUIT
(
"get_message fails"
);
printf
(
"got mess %d
\n
"
,
t
);
printf
(
"
T tracer:
got mess %d
\n
"
,
t
);
switch
(
t
)
{
case
0
:
/* toggle all those IDs */
...
...
common/utils/T/local_tracer.c
View file @
17322170
...
...
@@ -63,7 +63,7 @@ static int get_connection(char *addr, int port)
socklen_t
alen
;
int
s
,
t
;
printf
(
"waiting for connection on %s:%d
\n
"
,
addr
,
port
);
printf
(
"
T tracer:
waiting for connection on %s:%d
\n
"
,
addr
,
port
);
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
s
==
-
1
)
{
perror
(
"socket"
);
exit
(
1
);
}
...
...
@@ -82,7 +82,7 @@ static int get_connection(char *addr, int port)
if
(
t
==
-
1
)
{
perror
(
"accept"
);
exit
(
1
);
}
close
(
s
);
printf
(
"connected
\n
"
);
printf
(
"
T tracer:
connected
\n
"
);
return
t
;
}
...
...
@@ -150,7 +150,7 @@ process:
while
(
size
)
{
int
l
=
write
(
f
->
socket_remote
,
b
,
size
);
if
(
l
<=
0
)
{
printf
(
"forward error
\n
"
);
printf
(
"
T tracer:
forward error
\n
"
);
close
(
f
->
socket_remote
);
f
->
socket_remote
=
-
1
;
break
;
...
...
@@ -268,7 +268,7 @@ static void *forwarder(int port, int s)
f
->
memusage
=
0
;
f
->
last_warning_memusage
=
0
;
printf
(
"waiting for remote tracer on port %d
\n
"
,
port
);
printf
(
"
T tracer:
waiting for remote tracer on port %d
\n
"
,
port
);
f
->
remote_port
=
port
;
f
->
socket_remote
=
get_connection
(
"0.0.0.0"
,
port
);
...
...
@@ -305,7 +305,7 @@ static void forward(void *_forwarder, char *buf, int size)
if
(
f
->
memusage
>
f
->
last_warning_memusage
&&
f
->
memusage
-
f
->
last_warning_memusage
>
100000000
)
{
f
->
last_warning_memusage
+=
100000000
;
printf
(
"WARNING: memory usage is over %"
PRIu64
"MB
\n
"
,
printf
(
"
T tracer:
WARNING: memory usage is over %"
PRIu64
"MB
\n
"
,
f
->
last_warning_memusage
/
1000000
);
}
else
if
(
f
->
memusage
<
f
->
last_warning_memusage
&&
...
...
common/utils/T/tracer/enb.c
View file @
17322170
...
...
@@ -36,7 +36,8 @@ void reset_ue_ids(void)
int
ue_id_from_rnti
(
void
*
_priv
,
int
rnti
)
{
rnti
=
0
;
/* HACK, to be removed */
if
(
rnti
<
0
)
rnti
=
65534
;
/* HACK, to be removed */
if
(
rnti
<
0
||
rnti
>
65535
)
{
printf
(
"bad rnti %d
\n
"
,
rnti
);
exit
(
1
);
}
/* rnti not seen yet? give it a new ue_id */
if
(
ue_id
[
rnti
]
==
-
1
)
{
...
...
@@ -93,6 +94,7 @@ typedef struct {
enb_gui
*
e
;
int
ue
;
/* what UE is displayed in the UE specific views */
void
*
database
;
int
nb_rb
;
}
enb_data
;
void
is_on_changed
(
void
*
_d
)
...
...
@@ -120,27 +122,6 @@ connection_dies:
if
(
pthread_mutex_unlock
(
&
d
->
lock
))
abort
();
}
void
usage
(
void
)
{
printf
(
"options:
\n
"
" -d <database file> this option is mandatory
\n
"
" -on <GROUP or ID> turn log ON for given GROUP or ID
\n
"
" -off <GROUP or ID> turn log OFF for given GROUP or ID
\n
"
" -ON turn all logs ON
\n
"
" -OFF turn all logs OFF
\n
"
" note: you may pass several -on/-off/-ON/-OFF,
\n
"
" they will be processed in order
\n
"
" by default, all is off
\n
"
" -ip <host> connect to given IP address (default %s)
\n
"
" -p <port> connect to given port (default %d)
\n
"
" -debug-gui activate GUI debug logs
\n
"
,
DEFAULT_REMOTE_IP
,
DEFAULT_REMOTE_PORT
);
exit
(
1
);
}
static
void
*
gui_thread
(
void
*
_g
)
{
gui
*
g
=
_g
;
...
...
@@ -313,14 +294,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
input_signal_plot
=
new_xy_plot
(
g
,
256
,
55
,
"input signal"
,
20
);
widget_add_child
(
g
,
line
,
input_signal_plot
,
-
1
);
xy_plot_set_range
(
g
,
input_signal_plot
,
0
,
7680
*
10
,
20
,
70
);
xy_plot_set_range
(
g
,
input_signal_plot
,
0
,
7680
*
10
*
ed
->
nb_rb
/
25
,
20
,
70
);
input_signal_log
=
new_framelog
(
h
,
database
,
"ENB_PHY_INPUT_SIGNAL"
,
"subframe"
,
"rxdata"
);
/* a skip value of 10 means to process 1 frame over 10, that is
* more or less 10 frames per second
*/
framelog_set_skip
(
input_signal_log
,
10
);
input_signal_view
=
new_view_xy
(
7680
*
10
,
10
,
input_signal_view
=
new_view_xy
(
7680
*
10
*
ed
->
nb_rb
/
25
,
10
,
g
,
input_signal_plot
,
new_color
(
g
,
"#0c0c72"
),
XY_LOOP_MODE
);
logger_add_view
(
input_signal_log
,
input_signal_view
);
...
...
@@ -660,6 +641,28 @@ void view_add_log(view *v, char *log, event_handler *h, void *database,
on_off
(
database
,
log
,
is_on
,
1
);
}
void
usage
(
void
)
{
printf
(
"options:
\n
"
" -d <database file> this option is mandatory
\n
"
" -rb <RBs> setup for this number of RBs (default 25)
\n
"
" -on <GROUP or ID> turn log ON for given GROUP or ID
\n
"
" -off <GROUP or ID> turn log OFF for given GROUP or ID
\n
"
" -ON turn all logs ON
\n
"
" -OFF turn all logs OFF
\n
"
" note: you may pass several -on/-off/-ON/-OFF,
\n
"
" they will be processed in order
\n
"
" by default, all is off
\n
"
" -ip <host> connect to given IP address (default %s)
\n
"
" -p <port> connect to given port (default %d)
\n
"
" -debug-gui activate GUI debug logs
\n
"
,
DEFAULT_REMOTE_IP
,
DEFAULT_REMOTE_PORT
);
exit
(
1
);
}
int
main
(
int
n
,
char
**
v
)
{
extern
int
volatile
gui_logd
;
...
...
@@ -680,6 +683,8 @@ int main(int n, char **v)
reset_ue_ids
();
enb_data
.
nb_rb
=
25
;
/* write on a socket fails if the other end is closed and we get SIGPIPE */
if
(
signal
(
SIGPIPE
,
SIG_IGN
)
==
SIG_ERR
)
abort
();
...
...
@@ -690,6 +695,8 @@ int main(int n, char **v)
if
(
!
strcmp
(
v
[
i
],
"-h"
)
||
!
strcmp
(
v
[
i
],
"--help"
))
usage
();
if
(
!
strcmp
(
v
[
i
],
"-d"
))
{
if
(
i
>
n
-
2
)
usage
();
database_filename
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-rb"
))
{
if
(
i
>
n
-
2
)
usage
();
enb_data
.
nb_rb
=
atoi
(
v
[
++
i
]);
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-ip"
))
{
if
(
i
>
n
-
2
)
usage
();
ip
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-p"
))
{
if
(
i
>
n
-
2
)
usage
();
port
=
atoi
(
v
[
++
i
]);
continue
;
}
...
...
@@ -705,6 +712,11 @@ int main(int n, char **v)
usage
();
}
switch
(
enb_data
.
nb_rb
)
{
case
25
:
case
50
:
case
100
:
break
;
default:
printf
(
"ERROR, bad value for -rb (%d)
\n
"
,
enb_data
.
nb_rb
);
exit
(
1
);
}
if
(
database_filename
==
NULL
)
{
printf
(
"ERROR: provide a database file (-d)
\n
"
);
exit
(
1
);
...
...
common/utils/T/tracer/extract_input_subframe.c
View file @
17322170
...
...
@@ -12,7 +12,9 @@ void usage(void)
"usage: [options] <file> <frame> <subframe>
\n
"
"options:
\n
"
" -d <database file> this option is mandatory
\n
"
" -o <output file> this option is mandatory
\n
"
" -v verbose
\n
"
" -c <number of subframes> default to 1
\n
"
);
exit
(
1
);
}
...
...
@@ -25,15 +27,23 @@ int main(int n, char **v)
int
input_event_id
;
database_event_format
f
;
char
*
file
=
NULL
;
char
*
output_file
=
NULL
;
FILE
*
out
;
int
fd
;
int
frame
=
-
1
,
subframe
=
-
1
;
int
frame_arg
,
subframe_arg
,
buffer_arg
;
int
verbose
=
0
;
int
number_of_subframes
=
1
;
int
processed_subframes
=
0
;
for
(
i
=
1
;
i
<
n
;
i
++
)
{
if
(
!
strcmp
(
v
[
i
],
"-h"
)
||
!
strcmp
(
v
[
i
],
"--help"
))
usage
();
if
(
!
strcmp
(
v
[
i
],
"-d"
))
{
if
(
i
>
n
-
2
)
usage
();
database_filename
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-o"
))
{
if
(
i
>
n
-
2
)
usage
();
output_file
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-c"
))
{
if
(
i
>
n
-
2
)
usage
();
number_of_subframes
=
atoi
(
v
[
++
i
]);
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-v"
))
{
verbose
=
1
;
continue
;
}
if
(
file
==
NULL
)
{
file
=
v
[
i
];
continue
;
}
if
(
frame
==
-
1
)
{
frame
=
atoi
(
v
[
i
]);
continue
;
}
...
...
@@ -47,6 +57,19 @@ int main(int n, char **v)
exit
(
1
);
}
if
(
number_of_subframes
<
1
)
{
printf
(
"bad value for option -c, must be at least 1 and is %d
\n
"
,
number_of_subframes
);
exit
(
1
);
}
if
(
output_file
==
NULL
)
{
printf
(
"gimme -o <output file>, thanks
\n
"
);
exit
(
1
);
}
out
=
fopen
(
output_file
,
"w"
);
if
(
out
==
NULL
){
perror
(
output_file
);
exit
(
1
);}
database
=
parse_database
(
database_filename
);
load_config_file
(
database_filename
);
...
...
@@ -99,11 +122,22 @@ short *x = e.e[buffer_arg].b;
x[i] *= 14;
}
#endif
fwrite
(
e
.
e
[
buffer_arg
].
b
,
e
.
e
[
buffer_arg
].
bsize
,
1
,
stdout
);
fflush
(
stdout
);
return
0
;
if
(
fwrite
(
e
.
e
[
buffer_arg
].
b
,
e
.
e
[
buffer_arg
].
bsize
,
1
,
out
)
!=
1
)
{
perror
(
output_file
);
exit
(
1
);
}
processed_subframes
++
;
number_of_subframes
--
;
if
(
!
number_of_subframes
)
{
if
(
fclose
(
out
))
perror
(
output_file
);
printf
(
"%d subframes dumped
\n
"
,
processed_subframes
);
return
0
;
}
subframe
++
;
if
(
subframe
==
10
)
{
subframe
=
0
;
frame
=
(
frame
+
1
)
%
1024
;
}
}
printf
(
"frame %d subframe %d not found
\n
"
,
frame
,
subframe
);
printf
(
"%d subframes dumped
\n
"
,
processed_subframes
);
fclose
(
out
);
return
0
;
}
nfapi/nfapi_interface.h
0 → 100644
View file @
17322170
This source diff could not be displayed because it is too large. You can
view the blob
instead.
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
View file @
17322170
...
...
@@ -267,33 +267,28 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
#endif
}
// Convert to time domain for visualization
memset
(
temp_in_ifft_0
,
0
,
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
for
(
i
=
0
;
i
<
Msc_RS
;
i
++
)
((
int32_t
*
)
temp_in_ifft_0
)[
i
]
=
ul_ch_estimates
[
aa
][
symbol_offset
+
i
];
switch
(
frame_parms
->
N_RB_DL
)
{
case
6
:
idft128
((
int16_t
*
)
temp_in_ifft_0
,
(
int16_t
*
)
ul_ch_estimates_time
[
aa
],
1
);
break
;
case
25
:
idft512
((
int16_t
*
)
temp_in_ifft_0
,
(
int16_t
*
)
ul_ch_estimates_time
[
aa
],
1
);
break
;
case
50
:
idft1024
((
int16_t
*
)
temp_in_ifft_0
,
(
int16_t
*
)
ul_ch_estimates_time
[
aa
],
1
);
break
;
case
100
:
idft2048
((
int16_t
*
)
temp_in_ifft_0
,
(
int16_t
*
)
ul_ch_estimates_time
[
aa
],
1
);
...
...
openair1/PHY/LTE_TRANSPORT/dci.c
View file @
17322170
...
...
@@ -2262,11 +2262,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
y
[
0
]
=
&
yseq0
[
0
];
y
[
1
]
=
&
yseq1
[
0
];
#if 0
// reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1;
#endif
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
memset
(
e
,
0
,
DCI_BITS_MAX
);
e_ptr
=
e
;
...
...
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
17322170
...
...
@@ -835,11 +835,13 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
LOG_D
(
PHY
,
"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d
\n
"
,
rnti
,
i
,
eNB
->
dlsch
[
i
][
0
]
->
harq_mask
,
eNB
->
dlsch
[
i
][
0
]
->
rnti
,
first_free_index
);
if
((
eNB
->
dlsch
[
i
][
0
]
->
harq_mask
>
0
)
&&
(
eNB
->
dlsch
[
i
][
0
]
->
rnti
==
rnti
))
return
(
i
);
(
eNB
->
dlsch
[
i
][
0
]
->
rnti
==
rnti
))
return
i
;
else
if
((
eNB
->
dlsch
[
i
][
0
]
->
harq_mask
==
0
)
&&
(
first_free_index
==-
1
))
first_free_index
=
i
;
}
if
(
type
==
SEARCH_EXIST
)
return
(
-
1
);
else
return
(
first_free_index
);
if
(
type
==
SEARCH_EXIST
)
return
-
1
;
if
(
first_free_index
!=
-
1
)
eNB
->
dlsch
[
first_free_index
][
0
]
->
rnti
=
0
;
return
first_free_index
;
}
int8_t
find_ulsch
(
uint16_t
rnti
,
PHY_VARS_eNB
*
eNB
,
find_type_t
type
)
...
...
@@ -849,13 +851,15 @@ int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
AssertFatal
(
eNB
!=
NULL
,
"eNB is null
\n
"
);
for
(
i
=
0
;
i
<
NUMBER_OF_UE_MAX
;
i
++
)
{
AssertFatal
(
eNB
->
ulsch
[
i
]
!=
NULL
,
"eNB->
d
lsch[%d] is null
\n
"
,
i
);
AssertFatal
(
eNB
->
ulsch
[
i
]
!=
NULL
,
"eNB->
u
lsch[%d] is null
\n
"
,
i
);
if
((
eNB
->
ulsch
[
i
]
->
harq_mask
>
0
)
&&
(
eNB
->
ulsch
[
i
]
->
rnti
==
rnti
))
return
(
i
);
(
eNB
->
ulsch
[
i
]
->
rnti
==
rnti
))
return
i
;
else
if
((
eNB
->
ulsch
[
i
]
->
harq_mask
==
0
)
&&
(
first_free_index
==-
1
))
first_free_index
=
i
;
}
if
(
type
==
SEARCH_EXIST
)
return
(
-
1
);
else
return
(
first_free_index
);
if
(
type
==
SEARCH_EXIST
)
return
-
1
;
if
(
first_free_index
!=
-
1
)
eNB
->
ulsch
[
first_free_index
]
->
rnti
=
0
;
return
first_free_index
;
}
...
...
@@ -929,7 +933,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
dlsch0_harq
->
round
=
0
;
}
else
{
// process is inactive, so activate and set round to 0
dlsch0
->
harq_mask
|=
(
1
<<
rel8
->
harq_process
);
dlsch0_harq
->
round
=
0
;
}
dlsch0_harq
->
ndi
=
rel8
->
new_data_indicator_1
;
...
...
@@ -937,8 +940,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
dlsch0
->
active
=
1
;
if
(
rel8
->
rnti_type
==
2
)
dlsch0_harq
->
round
=
0
;
LOG_D
(
PHY
,
"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d)
\n
"
,
rel8
->
harq_process
,
dlsch0
->
harq_mask
,
dlsch0_harq
->
round
,
dlsch0_harq
->
ndi
,
rel8
->
new_data_indicator_1
);
LOG_D
(
PHY
,
"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d)
rnti type %d
\n
"
,
rel8
->
harq_process
,
dlsch0
->
harq_mask
,
dlsch0_harq
->
round
,
dlsch0_harq
->
ndi
,
rel8
->
new_data_indicator_1
,
rel8
->
rnti_type
);
switch
(
rel8
->
dci_format
)
{
...
...
@@ -1127,6 +1130,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_
if
(
dlsch0_harq
->
round
==
0
)
dlsch0_harq
->
status
=
ACTIVE
;
dlsch0
->
harq_mask
|=
(
1
<<
rel8
->
harq_process
);
if
(
rel8
->
rnti_type
==
1
)
LOG_I
(
PHY
,
"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x
\n
"
,
dlsch0_harq
->
round
,
rel8
->
mcs_1
,
rel8
->
resource_block_coding
,
rel8
->
redundancy_version_1
,
rel8
->
rnti
);
break
;
...
...
@@ -1288,6 +1293,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_
LOG_D
(
PHY
,
"DCI: Set harq_ids[%d] to %d (%p)
\n
"
,
subframe
,
rel8
->
harq_process
,
dlsch0
);
dlsch0
->
harq_ids
[
subframe
]
=
rel8
->
harq_process
;
dlsch0
->
harq_mask
|=
(
1
<<
rel8
->
harq_process
);
dlsch0
->
rnti
=
rel8
->
rnti
;
...
...
@@ -2283,11 +2289,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
void
fill_dci0
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
DCI_ALLOC_t
*
dci_alloc
,
nfapi_hi_dci0_dci_pdu
*
pdu
)
{
uint8_t
UE_id
;
AssertFatal
((
UE_id
=
find_ulsch
(
pdu
->
dci_pdu_rel8
.
rnti
,
eNB
,
SEARCH_EXIST_OR_FREE
))
>=
0
,
"No existing UE ULSCH for rnti %x
\n
"
,
pdu
->
dci_pdu_rel8
.
rnti
);
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
eNB
->
frame_parms
;
uint32_t
cqi_req
=
pdu
->
dci_pdu_rel8
.
cqi_csi_request
;
...
...
@@ -2447,17 +2448,15 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
}
}
void
fill_ulsch
(
PHY_VARS_eNB
*
eNB
,
nfapi_ul_config_ulsch_pdu
*
ulsch_pdu
,
int
frame
,
int
subframe
)
{
void
fill_ulsch
(
PHY_VARS_eNB
*
eNB
,
nfapi_ul_config_ulsch_pdu
*
ulsch_pdu
,
int
frame
,
int
subframe
)
{
uint8_t
harq_pid
;
uint8_t
UE_id
;
boolean_t
new_ulsch
=
(
find_ulsch
(
ulsch_pdu
->
ulsch_pdu_rel8
.
rnti
,
eNB
,
SEARCH_EXIST
)
==-
1
)
?
TRUE
:
FALSE
;
AssertFatal
((
UE_id
=
find_ulsch
(
ulsch_pdu
->
ulsch_pdu_rel8
.
rnti
,
eNB
,
SEARCH_EXIST_OR_FREE
))
>=
0
,
"No existing/free UE ULSCH for rnti %x
\n
"
,
ulsch_pdu
->
ulsch_pdu_rel8
.
rnti
);
boolean_t
new_ulsch
=
(
find_ulsch
(
ulsch_pdu
->
ulsch_pdu_rel8
.
rnti
,
eNB
,
SEARCH_EXIST
)
==-
1
)
?
TRUE
:
FALSE
;
LTE_eNB_ULSCH_t
*
ulsch
=
eNB
->
ulsch
[
UE_id
];
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
eNB
->
frame_parms
;
...
...
@@ -2465,6 +2464,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
harq_pid
=
ulsch_pdu
->
ulsch_pdu_rel8
.
harq_process_number
;
ulsch
->
harq_mask
|=
1
<<
harq_pid
;
ulsch
->
harq_processes
[
harq_pid
]
->
frame
=
frame
;
ulsch
->
harq_processes
[
harq_pid
]
->
subframe
=
subframe
;
...
...
@@ -2500,12 +2500,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else
if
(
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS
==
7
)
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS2
=
9
;
LOG_D
(
PHY
,
"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d
\n
"
,
eNB
->
Mod_id
,
harq_pid
,
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS2
,
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS
,
frame
,
subframe
);
ulsch
->
harq_processes
[
harq_pid
]
->
rvidx
=
ulsch_pdu
->
ulsch_pdu_rel8
.
redundancy_version
;
ulsch
->
harq_processes
[
harq_pid
]
->
Qm
=
ulsch_pdu
->
ulsch_pdu_rel8
.
modulation_type
;
// Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be
...
...
@@ -2531,8 +2529,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else
ulsch
->
harq_processes
[
harq_pid
]
->
round
++
;
ulsch
->
rnti
=
ulsch_pdu
->
ulsch_pdu_rel8
.
rnti
;
LOG_D
(
PHY
,
"Filling ULSCH %x (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d
\n
"
,
ulsch
->
rnti
,
new_ulsch
,
LOG_D
(
PHY
,
"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d
\n
"
,
ulsch
->
rnti
,
UE_id
,
new_ulsch
,
frame
,
subframe
,
harq_pid
,
...
...
@@ -2542,12 +2542,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
ulsch
->
harq_processes
[
harq_pid
]
->
Qm
,
ulsch
->
harq_processes
[
harq_pid
]
->
TBS
,
ulsch
->
harq_processes
[
harq_pid
]
->
round
);
}
int
dump_dci
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
DCI_ALLOC_t
*
dci
)
{
switch
(
dci
->
format
)
{
...
...
@@ -6420,12 +6416,11 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
return
(
9
);
else
return
((
n
+
6
)
%
10
);
}
uint32_t
pdcch_alloc2ul_frame
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint32_t
frame
,
uint8_t
n
)
{
uint32_t
ul_frame
=
255
;
uint32_t
ul_frame
;
if
((
frame_parms
->
frame_type
==
TDD
)
&&
(
frame_parms
->
tdd_config
==
1
)
&&
...
...
@@ -6443,8 +6438,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
ul_frame
=
(
frame
+
(
n
>=
6
?
1
:
0
));
LOG_D
(
PHY
,
"frame %d subframe %d: PUSCH frame = %d
\n
"
,
frame
,
n
,
ul_frame
);
return
ul_frame
;
return
ul_frame
%
1024
;
}
int32_t
pmi_convert_rank1_from_rank2
(
uint16_t
pmi_alloc
,
int
tpmi
,
int
nb_rb
)
...
...
openair1/PHY/LTE_TRANSPORT/phich.c
View file @
17322170
...
...
@@ -151,18 +151,19 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
return
(
0
);
}
uint8_t
phich_frame2_pusch_frame
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
frame_t
frame
,
uint8_
t
subframe
)
int
phich_frame2_pusch_frame
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
int
frame
,
in
t
subframe
)
{
uint8_t
pusch_frame
=
255
;
int
pusch_frame
;
if
(
frame_parms
->
frame_type
==
FDD
)
{
pusch_frame
=
((
subframe
<
4
)
?
(
frame
-
1
)
:
frame
)
;
pusch_frame
=
subframe
<
4
?
frame
+
1024
-
1
:
frame
;
}
else
{
// Note this is not true, but it doesn't matter, the frame number is irrelevant for TDD!
pusch_frame
=
(
frame
);
}
LOG_D
(
PHY
,
"frame %d subframe %d: PUSCH frame = %d
\n
"
,
frame
,
subframe
,
pusch_frame
);
return
pusch_frame
;
return
pusch_frame
%
1024
;
}
uint8_t
phich_subframe2_pusch_subframe
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
subframe
)
...
...
openair1/PHY/LTE_TRANSPORT/proto.h
View file @
17322170
...
...
@@ -1950,7 +1950,7 @@ uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t s
@param subframe Subframe of received/transmitted PHICH
@returns frame of PUSCH transmission
*/
uint8_t
phich_frame2_pusch_frame
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
frame_t
frame
,
uint8_
t
subframe
);
int
phich_frame2_pusch_frame
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
int
frame
,
in
t
subframe
);
void
print_CQI
(
void
*
o
,
UCI_format_t
uci_format
,
uint8_t
eNB_id
,
int
N_RB_DL
);
...
...
openair1/PHY/LTE_TRANSPORT/pucch.c
View file @
17322170
...
...
@@ -2420,7 +2420,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
if
(
fmt
==
pucch_format1b
)
*
(
1
+
payload
)
=
(
stat_im
<
0
)
?
1
:
2
;
}
else
{
// insufficient energy on PUCCH so NAK
LOG_
D
(
PHY
,
"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d
\n
"
,
subframe
,
sigma2_dB
,
dB_fixed
(
stat_max
),
pucch1_thres
);
LOG_
I
(
PHY
,
"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d
\n
"
,
subframe
,
sigma2_dB
,
dB_fixed
(
stat_max
),
pucch1_thres
);
*
payload
=
4
;
// DTX
((
int16_t
*
)
&
eNB
->
pucch1ab_stats
[
UE_id
][(
subframe
<<
10
)
+
(
eNB
->
pucch1ab_stats_cnt
[
UE_id
][
subframe
])])[
0
]
=
(
int16_t
)(
stat_re
);
((
int16_t
*
)
&
eNB
->
pucch1ab_stats
[
UE_id
][(
subframe
<<
10
)
+
(
eNB
->
pucch1ab_stats_cnt
[
UE_id
][
subframe
])])[
1
]
=
(
int16_t
)(
stat_im
);
...
...
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
View file @
17322170
...
...
@@ -1164,16 +1164,21 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
l
/
(
frame_parms
->
symbols_per_tti
/
2
));
}
int
correction_factor
=
1
;
int
deltaMCS
=
1
;
int
MPR_times_Ks
;
if
(
deltaMCS
==
1
)
{
// Note we're using TBS instead of sumKr, since didn't run segmentation yet!
MPR_times_Ks
=
5
*
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
TBS
/
(
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
*
4
*
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
Nsymb_pusch
);
if
(
MPR_times_Ks
>
0
)
correction_factor
=
(
1
<<
MPR_times_Ks
)
-
1
;
}
for
(
i
=
0
;
i
<
frame_parms
->
nb_antennas_rx
;
i
++
)
{
pusch_vars
->
ulsch_power
[
i
]
=
signal_energy_nodc
(
pusch_vars
->
drs_ch_estimates
[
i
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
);
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
)
/
correction_factor
;
//printf("%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_Ks,correction_factor,dB_fixed_times10(pusch_vars->ulsch_power[i]));
#ifdef LOCALIZATION
pusch_vars
->
subcarrier_power
=
(
int32_t
*
)
malloc
(
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
*
sizeof
(
int32_t
));
pusch_vars
->
active_subcarrier
=
subcarrier_energy
(
pusch_vars
->
drs_ch_estimates
[
i
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
,
pusch_vars
->
subcarrier_power
,
rx_power_correction
);
#endif
}
...
...
openair1/PHY/MODULATION/ofdm_mod.c
View file @
17322170
...
...
@@ -33,47 +33,29 @@ This section deals with basic functions for OFDM Modulation.
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
//static short temp2[2048*4] __attribute__((aligned(16)));
//#define DEBUG_OFDM_MOD
void
normal_prefix_mod
(
int32_t
*
txdataF
,
int32_t
*
txdata
,
uint8_t
nsymb
,
LTE_DL_FRAME_PARMS
*
frame_parms
)
{
uint8_t
i
;
int
short_offset
=
0
;
if
((
2
*
nsymb
)
<
frame_parms
->
symbols_per_tti
)
short_offset
=
1
;
// printf("nsymb %d\n",nsymb);
for
(
i
=
0
;
i
<
((
short_offset
)
+
2
*
nsymb
/
frame_parms
->
symbols_per_tti
);
i
++
)
{
#ifdef DEBUG_OFDM_MOD
printf
(
"slot i %d (txdata offset %d, txoutput %p)
\n
"
,
i
,(
i
*
(
frame_parms
->
samples_per_tti
>>
1
)),
txdata
+
(
i
*
(
frame_parms
->
samples_per_tti
>>
1
)));
#endif
PHY_ofdm_mod
(
txdataF
+
(
i
*
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_tti
>>
1
),
// input
txdata
+
(
i
*
frame_parms
->
samples_per_tti
>>
1
),
// output
frame_parms
->
ofdm_symbol_size
,
1
,
// number of symbols
frame_parms
->
nb_prefix_samples0
,
// number of prefix samples
CYCLIC_PREFIX
);
#ifdef DEBUG_OFDM_MOD
printf
(
"slot i %d (txdata offset %d)
\n
"
,
i
,
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0
+
(
i
*
frame_parms
->
samples_per_tti
>>
1
));
#endif
PHY_ofdm_mod
(
txdataF
+
frame_parms
->
ofdm_symbol_size
+
(
i
*
frame_parms
->
ofdm_symbol_size
*
(
frame_parms
->
symbols_per_tti
>>
1
)),
// input
txdata
+
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0
+
(
i
*
(
frame_parms
->
samples_per_tti
>>
1
)),
// output
frame_parms
->
ofdm_symbol_size
,
(
short_offset
==
1
)
?
1
:
(
frame_parms
->
symbols_per_tti
>>
1
)
-
1
,
//6, // number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples