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
c4fdf44d
Commit
c4fdf44d
authored
May 21, 2019
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test on simulator
parent
cac65016
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
28 deletions
+42
-28
executables/gNBmain.c
executables/gNBmain.c
+41
-28
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+1
-0
No files found.
executables/gNBmain.c
View file @
c4fdf44d
...
...
@@ -316,7 +316,8 @@ void gNB_top(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, char *string, struct
L1_proc
->
frame_tx
=
(
L1_proc
->
slot_rx
>
(
fp
->
slots_per_frame
-
1
-
sl_ahead
))
?
(
L1_proc
->
frame_rx
+
1
)
&
1023
:
L1_proc
->
frame_rx
;
L1_proc
->
slot_tx
=
(
L1_proc
->
slot_rx
+
sl_ahead
)
%
fp
->
slots_per_frame
;
if
(
rxtx
(
gNB
,
L1_proc
,
string
)
<
0
)
LOG_E
(
PHY
,
"gNB %d CC_id %d failed during execution
\n
"
,
gNB
->
Mod_id
,
gNB
->
CC_id
);
if
(
rxtx
(
gNB
,
L1_proc
,
string
)
<
0
)
LOG_E
(
PHY
,
"gNB %d CC_id %d failed during execution
\n
"
,
gNB
->
Mod_id
,
gNB
->
CC_id
);
ru_proc
->
timestamp_tx
=
L1_proc
->
timestamp_tx
;
ru_proc
->
tti_tx
=
L1_proc
->
slot_tx
;
...
...
@@ -441,6 +442,7 @@ static void *ru_thread_prach( void *param ) {
ru_thread_prach_status
=
0
;
return
&
ru_thread_prach_status
;
}
void
fill_rf_config
(
RU_t
*
ru
,
char
*
rf_config_file
)
{
int
i
;
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
...
...
@@ -744,7 +746,6 @@ static void *ru_thread( void *param ) {
AssertFatal
(
setup_RU_buffers
(
ru
),
"Exiting, cannot initialize RU Buffers
\n
"
);
// Start RF device if any
if
(
ru
->
start_rf
)
{
if
(
ru
->
start_rf
(
ru
)
!=
0
)
...
...
@@ -752,16 +753,19 @@ static void *ru_thread( void *param ) {
else
LOG_I
(
PHY
,
"RU %d rf device ready
\n
"
,
ru
->
idx
);
}
else
LOG_I
(
PHY
,
"RU %d no rf device
\n
"
,
ru
->
idx
);
// The RU initializationis in the middle of gNB one
// so , we signal and wait the gNB finishes it's init
// before running the main loop
static
notifiedFIFO_t
ruThreadFIFO
;
initNotifiedFIFO
(
&
ruThreadFIFO
);
LOG_I
(
PHY
,
"Signaling main thread that RU %d is ready
\n
"
,
ru
->
idx
);
notifiedFIFO_elt_t
*
msg
=
newNotifiedFIFO_elt
(
0
,
doneInitRU
,
&
ruThreadFIFO
,
NULL
);
notifiedFIFO_elt_t
*
msg
=
newNotifiedFIFO_elt
(
0
,
doneInitRU
,
&
ruThreadFIFO
,
NULL
);
pushNotifiedFIFO
(
&
mainThreadFIFO
,
msg
);
LOG_I
(
PHY
,
"wait main thread that RU %d is ready
\n
"
,
ru
->
idx
);
delNotifiedFIFO_elt
(
pullNotifiedFIFO
(
&
ruThreadFIFO
));
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while
(
!
oai_exit
)
{
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
// They are set on the first rx/tx in the underly FH routines.
...
...
@@ -776,7 +780,6 @@ static void *ru_thread( void *param ) {
// synchronization on input FH interface, acquire signals/data and block
AssertFatal
(
ru
->
fh_south_in
,
"No fronthaul interface at south port"
);
ru
->
fh_south_in
(
ru
,
&
frame
,
&
slot
);
LOG_D
(
PHY
,
"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0][0]:[RX:%d%d TX(SFN):%d]
\n
"
,
frame
,
slot
,
proc
->
frame_rx
,
proc
->
tti_rx
,
...
...
@@ -825,7 +828,8 @@ static void *ru_thread( void *param ) {
ru
->
fh_north_out
(
ru
);
}
}
notifiedFIFO_elt_t
*
msg2
=
newNotifiedFIFO_elt
(
0
,
AbortRU
,
NULL
,
NULL
);
notifiedFIFO_elt_t
*
msg2
=
newNotifiedFIFO_elt
(
0
,
AbortRU
,
NULL
,
NULL
);
pushNotifiedFIFO
(
&
mainThreadFIFO
,
msg2
);
return
NULL
;
}
...
...
@@ -1295,19 +1299,28 @@ int main( int argc, char **argv ) {
f
(
&
p
);
}
// Fixme: a sleep is needed because some external (thread?)
// has to populate something
// remove the sleep, you will see the assert
sleep
(
1
);
number_of_cards
=
1
;
init_gNB
(
single_thread_flag
,
wait_for_sync
);
init_RU
(
rf_config_file
);
notifiedFIFO_elt_t
*
msg
=
pullNotifiedFIFO
(
&
mainThreadFIFO
);
notifiedFIFO_elt_t
*
msgs
[
RC
.
nb_RU
];
for
(
int
ru
=
0
;
ru
<
RC
.
nb_RU
;
ru
++
)
msgs
[
ru
]
=
pullNotifiedFIFO
(
&
mainThreadFIFO
);
init_eNB_afterRU
();
pushNotifiedFIFO
(
msg
->
reponseFifo
,
msg
);
for
(
int
ru
=
0
;
ru
<
RC
.
nb_RU
;
ru
++
)
pushNotifiedFIFO
(
msgs
[
ru
]
->
reponseFifo
,
msgs
[
ru
]);
pthread_mutex_lock
(
&
sync_mutex
);
sync_var
=
0
;
pthread_cond_broadcast
(
&
sync_cond
);
pthread_mutex_unlock
(
&
sync_mutex
);
while
(
oai_exit
==
0
)
sleep
(
1
);
// When threads leaves, they send a final message to main
notifiedFIFO_elt_t
*
msg
=
pullNotifiedFIFO
(
&
mainThreadFIFO
);
return
0
;
}
targets/ARCH/rfsimulator/simulator.c
View file @
c4fdf44d
...
...
@@ -457,6 +457,7 @@ int rfsimulator_set_gains(openair0_device *device, openair0_config_t *openair0_c
__attribute__
((
__visibility__
(
"default"
)))
int
device_init
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
//set_log(HW,OAILOG_DEBUG);
set_log
(
TMR
,
OAILOG_DEBUG
);
//set_log(PHY,OAILOG_DEBUG);
rfsimulator_state_t
*
rfsimulator
=
(
rfsimulator_state_t
*
)
calloc
(
sizeof
(
rfsimulator_state_t
),
1
);
...
...
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