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
alex037yang
OpenXG-RAN
Commits
9ce7f945
Commit
9ce7f945
authored
Feb 28, 2021
by
Laurent Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
record/replay for 5G, nrscope bug fix
parent
f5a22a74
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
668 additions
and
689 deletions
+668
-689
executables/main-ocp.c
executables/main-ocp.c
+2
-2
executables/nr-ru.c
executables/nr-ru.c
+3
-2
executables/nr-softmodem.c
executables/nr-softmodem.c
+1
-1
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+1
-1
executables/ocp-gnb.c
executables/ocp-gnb.c
+1
-1
executables/softmodem-common.c
executables/softmodem-common.c
+1
-1
executables/softmodem-common.h
executables/softmodem-common.h
+2
-2
openair1/PHY/TOOLS/nr_phy_scope.c
openair1/PHY/TOOLS/nr_phy_scope.c
+62
-46
openair1/PHY/TOOLS/nr_phy_scope.h
openair1/PHY/TOOLS/nr_phy_scope.h
+1
-7
openair1/PHY/TOOLS/phy_scope_interface.c
openair1/PHY/TOOLS/phy_scope_interface.c
+1
-0
openair1/PHY/TOOLS/phy_scope_interface.h
openair1/PHY/TOOLS/phy_scope_interface.h
+19
-0
targets/ARCH/COMMON/record_player.c
targets/ARCH/COMMON/record_player.c
+15
-9
targets/ARCH/COMMON/record_player.h
targets/ARCH/COMMON/record_player.h
+11
-8
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+466
-476
targets/ARCH/iqplayer/iqplayer_lib.c
targets/ARCH/iqplayer/iqplayer_lib.c
+78
-129
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+2
-2
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+2
-2
No files found.
executables/main-ocp.c
View file @
9ce7f945
...
...
@@ -1318,7 +1318,7 @@ int main ( int argc, char **argv ) {
// end of CI modifications
//getchar();
if
(
IS_SOFTMODEM_DO
FORMS
)
if
(
IS_SOFTMODEM_DO
SCOPE
)
load_softscope
(
"enb"
,
NULL
);
itti_wait_tasks_end
();
...
...
@@ -1327,7 +1327,7 @@ int main ( int argc, char **argv ) {
// stop threads
if
(
RC
.
nb_inst
==
0
||
!
NODE_IS_CU
(
node_type
))
{
if
(
IS_SOFTMODEM_DO
FORMS
)
if
(
IS_SOFTMODEM_DO
SCOPE
)
end_forms
();
LOG_I
(
ENB_APP
,
"stopping MODEM threads
\n
"
);
...
...
executables/nr-ru.c
View file @
9ce7f945
...
...
@@ -89,7 +89,7 @@ static int DEFBFW[] = {0x00007fff};
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include <openair1/PHY/TOOLS/phy_scope_interface.h>
#include "T.h"
...
...
@@ -1593,7 +1593,8 @@ void *ru_thread( void *param ) {
for
(
aa
=
0
;
aa
<
ru
->
nb_rx
;
aa
++
)
memcpy
((
void
*
)
RC
.
gNB
[
0
]
->
common_vars
.
rxdataF
[
aa
],
(
void
*
)
ru
->
common
.
rxdataF
[
aa
],
fp
->
symbols_per_slot
*
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
if
(
IS_SOFTMODEM_DOSCOPE
&&
RC
.
gNB
[
0
]
->
scopeData
)
((
scopeData_t
*
)
RC
.
gNB
[
0
]
->
scopeData
)
->
slotFunc
(
ru
->
common
.
rxdataF
[
0
],
proc
->
tti_rx
,
RC
.
gNB
[
0
]
->
scopeData
);
// Do PRACH RU processing
int
prach_id
=
find_nr_prach_ru
(
ru
,
proc
->
frame_rx
,
proc
->
tti_rx
,
SEARCH_EXIST
);
...
...
executables/nr-softmodem.c
View file @
9ce7f945
...
...
@@ -900,7 +900,7 @@ if(!IS_SOFTMODEM_NOS1)
printf
(
"RC.nb_RU:%d
\n
"
,
RC
.
nb_RU
);
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
printf
(
"ALL RUs ready - init gNBs
\n
"
);
if
(
IS_SOFTMODEM_DO
FORMS
)
{
if
(
IS_SOFTMODEM_DO
SCOPE
)
{
sleep
(
1
);
scopeParms_t
p
;
p
.
argc
=&
argc
;
...
...
executables/nr-uesoftmodem.c
View file @
9ce7f945
...
...
@@ -551,7 +551,7 @@ int main( int argc, char **argv ) {
configure_linux
();
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
);
if
(
IS_SOFTMODEM_DO
FORMS
)
{
if
(
IS_SOFTMODEM_DO
SCOPE
)
{
load_softscope
(
"nr"
,
PHY_vars_UE_g
[
0
][
0
]);
}
...
...
executables/ocp-gnb.c
View file @
9ce7f945
...
...
@@ -996,7 +996,7 @@ int main( int argc, char **argv ) {
(
void
*
)
NULL
,
"time_meas"
,
-
1
,
OAI_PRIORITY_RT_LOW
);
}
if
(
IS_SOFTMODEM_DO
FORMS
)
{
if
(
IS_SOFTMODEM_DO
SCOPE
)
{
scopeParms_t
tmp
=
{
&
argc
,
argv
,
&
ru
,
RC
.
gNB
[
0
]};
load_softscope
(
"nr"
,
&
tmp
);
}
...
...
executables/softmodem-common.c
View file @
9ce7f945
...
...
@@ -140,7 +140,7 @@ void get_common_options(uint32_t execmask) {
}
if
(
do_forms
)
{
set_softmodem_optmask
(
SOFTMODEM_DO
FORMS
_BIT
);
set_softmodem_optmask
(
SOFTMODEM_DO
SCOPE
_BIT
);
}
if
(
parallel_config
!=
NULL
)
set_parallel_conf
(
parallel_config
);
...
...
executables/softmodem-common.h
View file @
9ce7f945
...
...
@@ -188,7 +188,7 @@ extern "C"
#define SOFTMODEM_RFSIM_BIT (1<<10)
#define SOFTMODEM_BASICSIM_BIT (1<<11)
#define SOFTMODEM_SIML1_BIT (1<<12)
#define SOFTMODEM_DO
FORMS
_BIT (1<<15)
#define SOFTMODEM_DO
SCOPE
_BIT (1<<15)
#define SOFTMODEM_RECPLAY_BIT (1<<16)
#define SOFTMODEM_ENB_BIT (1<<20)
#define SOFTMODEM_GNB_BIT (1<<21)
...
...
@@ -204,7 +204,7 @@ extern "C"
#define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT)
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
#define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT)
#define IS_SOFTMODEM_DO
FORMS ( get_softmodem_optmask() & SOFTMODEM_DOFORMS
_BIT)
#define IS_SOFTMODEM_DO
SCOPE ( get_softmodem_optmask() & SOFTMODEM_DOSCOPE
_BIT)
#define IS_SOFTMODEM_IQPLAYER ( get_softmodem_optmask() & SOFTMODEM_RECPLAY_BIT)
#define IS_SOFTMODEM_ENB_BIT ( get_softmodem_optmask() & SOFTMODEM_ENB_BIT)
#define IS_SOFTMODEM_GNB_BIT ( get_softmodem_optmask() & SOFTMODEM_GNB_BIT)
...
...
openair1/PHY/TOOLS/nr_phy_scope.c
View file @
9ce7f945
This diff is collapsed.
Click to expand it.
openair1/PHY/TOOLS/nr_phy_scope.h
View file @
9ce7f945
...
...
@@ -33,13 +33,7 @@
//#include "PHY/impl_defs_top.h"
#include "PHY/defs_nr_UE.h"
typedef
struct
{
int
*
argc
;
char
**
argv
;
RU_t
*
ru
;
PHY_VARS_gNB
*
gNB
;
}
scopeParms_t
;
#include <openair1/PHY/TOOLS/phy_scope_interface.h>
extern
RAN_CONTEXT_t
RC
;
#endif
openair1/PHY/TOOLS/phy_scope_interface.c
View file @
9ce7f945
...
...
@@ -35,6 +35,7 @@
#include "phy_scope_interface.h"
#define SOFTSCOPE_ENDFUNC_IDX 0
static
loader_shlibfunc_t
scope_fdesc
[]
=
{{
"end_forms"
,
NULL
}};
int
load_softscope
(
char
*
exectype
,
void
*
initarg
)
{
...
...
openair1/PHY/TOOLS/phy_scope_interface.h
View file @
9ce7f945
...
...
@@ -29,7 +29,26 @@
* \note
* \warning
*/
#ifndef __PHY_SCOPE_INTERFACE_H__
#define __PHY_SCOPE_INTERFACE_H__
#include <openair1/PHY/defs_gNB.h>
typedef
struct
{
int
*
argc
;
char
**
argv
;
RU_t
*
ru
;
PHY_VARS_gNB
*
gNB
;
}
scopeParms_t
;
typedef
struct
scopeData_s
{
int
*
argc
;
char
**
argv
;
RU_t
*
ru
;
PHY_VARS_gNB
*
gNB
;
int32_t
*
rxdataF
;
void
(
*
slotFunc
)(
int32_t
*
data
,
int
slot
,
void
*
scopeData
);
}
scopeData_t
;
int
load_softscope
(
char
*
exectype
,
void
*
initarg
);
int
end_forms
(
void
)
;
#endif
targets/ARCH/COMMON/record_player.c
View file @
9ce7f945
...
...
@@ -68,8 +68,10 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_
*
recplay_conf
=
NULL
;
}
if
(
u_sf_replay
==
1
)
return
RECPLAY_REPLAYMODE
;
else
if
(
u_sf_record
==
1
)
return
RECPLAY_RECORDMODE
;
if
(
u_sf_replay
==
1
)
return
RECPLAY_REPLAYMODE
;
else
if
(
u_sf_record
==
1
)
return
RECPLAY_RECORDMODE
;
return
0
;
}
...
...
@@ -80,7 +82,7 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_
*/
void
iqrecorder_end
(
openair0_device
*
device
)
{
if
(
device
->
recplay_state
!=
NULL
)
{
// subframes store
iqfile_header_t
fh
=
{
device
->
type
,
device
->
openair0_cfg
->
tx_sample_advance
,
device
->
openair0_cfg
->
rx_bw
,
OAIIQFILE_ID
};
iqfile_header_t
fh
=
{
device
->
type
,
device
->
openair0_cfg
->
tx_sample_advance
,
device
->
openair0_cfg
->
rx_bw
,
0
,
OAIIQFILE_ID
};
recplay_state_t
*
rs
=
device
->
recplay_state
;
recplay_conf_t
*
rc
=
device
->
openair0_cfg
[
0
].
recplay_conf
;
rs
->
pFile
=
fopen
(
rc
->
u_sf_filename
,
"wb+"
);
...
...
@@ -91,16 +93,20 @@ void iqrecorder_end(openair0_device *device) {
unsigned
int
i
=
0
;
unsigned
int
modu
=
0
;
if
((
modu
=
rs
->
nb
_sample
s
%
10
)
!=
0
)
{
rs
->
nb
_sample
s
-=
modu
;
// store entire number of frames
if
((
modu
=
rs
->
nb
SamplesBlock
s
%
10
)
!=
0
)
{
rs
->
nb
SamplesBlock
s
-=
modu
;
// store entire number of frames
}
fh
.
nbSamplesBlocks
=
rs
->
nbSamplesBlocks
;
LOG_I
(
HW
,
"Writing file header to %s
\n
"
,
rc
->
u_sf_filename
);
fwrite
(
&
fh
,
sizeof
(
fh
),
1
,
rs
->
pFile
);
LOG_UI
(
HW
,
"Writing %u subframes to %s
\n
"
,
rs
->
nb_samples
,
rc
->
u_sf_filename
);
LOG_UI
(
HW
,
"Writing %u subframes to %s
\n
"
,
rs
->
nbSamplesBlocks
,
rc
->
u_sf_filename
);
uint8_t
*
ptr
=
(
uint8_t
*
)
rs
->
ms_sample
;
for
(
i
=
0
;
i
<
rs
->
nb_samples
;
i
++
)
{
fwrite
(
rs
->
ms_sample
+
i
,
sizeof
(
unsigned
char
),
sizeof
(
iqrec_t
),
rs
->
pFile
);
for
(
i
=
0
;
i
<
rs
->
nbSamplesBlocks
;
i
++
)
{
int
blockBytes
=
sizeof
(
iqrec_t
)
+
((
iqrec_t
*
)
ptr
)
->
nbBytes
;
fwrite
(
ptr
,
sizeof
(
unsigned
char
),
blockBytes
,
rs
->
pFile
);
ptr
+=
blockBytes
;
}
fclose
(
rs
->
pFile
);
...
...
@@ -112,4 +118,4 @@ void iqrecorder_end(openair0_device *device) {
rs
->
ms_sample
=
NULL
;
}
}
}
\ No newline at end of file
}
targets/ARCH/COMMON/record_player.h
View file @
9ce7f945
...
...
@@ -46,21 +46,22 @@ extern "C"
#define BELL_LABS_IQ_HEADER 0xabababababababab
#define BELL_LABS_IQ_PER_SF 7680 // Up to 5MHz bw for now
#define BELL_LABS_IQ_BYTES_PER_SF (BELL_LABS_IQ_PER_SF * 4)
#define MAX_BELL_LABS_IQ_BYTES_PER_SF BELL_LABS_IQ_BYTES_PER_SF*10
#define
OAIIQFILE_ID "OIQF"
#define
OAIIQFILE_ID {'O', 'I','Q','F'}
typedef
struct
{
uint64_t
devtype
;
uint64_t
tx_sample_advance
;
double
bw
;
unsigned
int
nbSamplesBlocks
;
char
oaiid
[
4
];
}
iqfile_header_t
;
typedef
struct
{
int64_t
header
;
int64_t
ts
;
int64_t
rfu1
;
int64_t
nbBytes
;
int64_t
rfu2
;
// pad for 256 bits alignement required by AVX2
unsigned
char
samples
[
BELL_LABS_IQ_BYTES_PER_SF
];
// iq's for one subframe
}
iqrec_t
;
#define DEF_NB_SF 120000 // default nb of sf or ms to capture (2 minutes at 5MHz)
#define DEF_SF_FILE "/tmp/iqfile" // default subframes file name
...
...
@@ -114,14 +115,16 @@ typedef struct {
int
use_mmap
;
// default is to use mmap
size_t
mapsize
;
FILE
*
pFile
;
int
mmapfd
;
int
iqfd
;
int
fd
;
iqrec_t
*
ms_sample
;
// memory for all subframes
unsigned
int
nb_samples
;
unsigned
int
nbSamplesBlocks
;
uint8_t
*
currentPtr
;
uint64_t
currentTs
;
unsigned
int
curSamplesBlock
;
int64_t
wrap_count
;
size_t
maxSizeBytes
;
}
recplay_state_t
;
#ifdef __cplusplus
}
#endif
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
9ce7f945
This diff is collapsed.
Click to expand it.
targets/ARCH/iqplayer/iqplayer_lib.c
View file @
9ce7f945
This diff is collapsed.
Click to expand it.
targets/RT/USER/lte-softmodem.c
View file @
9ce7f945
...
...
@@ -727,7 +727,7 @@ int main ( int argc, char **argv )
fflush
(
stderr
);
// end of CI modifications
//getchar();
if
(
IS_SOFTMODEM_DO
FORMS
)
if
(
IS_SOFTMODEM_DO
SCOPE
)
load_softscope
(
"enb"
,
NULL
);
itti_wait_tasks_end
();
oai_exit
=
1
;
...
...
@@ -735,7 +735,7 @@ int main ( int argc, char **argv )
// stop threads
if
(
RC
.
nb_inst
==
0
||
!
NODE_IS_CU
(
node_type
))
{
if
(
IS_SOFTMODEM_DO
FORMS
)
if
(
IS_SOFTMODEM_DO
SCOPE
)
end_forms
();
LOG_I
(
ENB_APP
,
"stopping MODEM threads
\n
"
);
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
9ce7f945
...
...
@@ -758,7 +758,7 @@ int main( int argc, char **argv ) {
PHY_vars_UE_g
[
0
][
0
]
->
no_timing_correction
=
1
;
}
if
(
IS_SOFTMODEM_DO
FORMS
)
if
(
IS_SOFTMODEM_DO
SCOPE
)
load_softscope
(
"ue"
,
NULL
);
config_check_unknown_cmdlineopt
(
CONFIG_CHECKALLSECTIONS
);
...
...
@@ -783,7 +783,7 @@ int main( int argc, char **argv ) {
printf
(
"oai_exit=%d
\n
"
,
oai_exit
);
// stop threads
if
(
IS_SOFTMODEM_DO
FORMS
)
if
(
IS_SOFTMODEM_DO
SCOPE
)
end_forms
();
printf
(
"stopping MODEM threads
\n
"
);
...
...
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