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
promise
OpenXG-RAN
Commits
6d1aae61
Commit
6d1aae61
authored
Oct 27, 2018
by
Wolfgang A. Mozart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding support for USRP to nr-uesoftmodem
parent
863e3abf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
46 deletions
+73
-46
targets/RT/USER/nr-uesoftmodem.c
targets/RT/USER/nr-uesoftmodem.c
+68
-46
targets/RT/USER/nr-uesoftmodem.h
targets/RT/USER/nr-uesoftmodem.h
+5
-0
No files found.
targets/RT/USER/nr-uesoftmodem.c
View file @
6d1aae61
...
...
@@ -247,6 +247,9 @@ int emulate_rf = 0;
threads_t
threads
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
char
*
usrp_args
=
NULL
;
char
*
usrp_clksrc
=
NULL
;
/* forward declarations */
void
set_default_frame_parms
(
NR_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
]);
...
...
@@ -742,51 +745,70 @@ void init_openair0() {
openair0_cfg
[
card
].
rx_bw
=
1.5e6
;
}
if
(
frame_parms
[
0
]
->
frame_type
==
TDD
)
openair0_cfg
[
card
].
duplex_mode
=
duplex_mode_TDD
;
else
//FDD
openair0_cfg
[
card
].
duplex_mode
=
duplex_mode_FDD
;
printf
(
"HW: Configuring card %d, nb_antennas_tx/rx %d/%d
\n
"
,
card
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_tx
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_rx
);
openair0_cfg
[
card
].
Mod_id
=
0
;
openair0_cfg
[
card
].
num_rb_dl
=
frame_parms
[
0
]
->
N_RB_DL
;
openair0_cfg
[
card
].
clock_source
=
clock_source
;
openair0_cfg
[
card
].
tx_num_channels
=
min
(
2
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_tx
);
openair0_cfg
[
card
].
rx_num_channels
=
min
(
2
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_rx
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
i
<
openair0_cfg
[
card
].
tx_num_channels
)
openair0_cfg
[
card
].
tx_freq
[
i
]
=
downlink_frequency
[
0
][
i
]
+
uplink_frequency_offset
[
0
][
i
];
else
openair0_cfg
[
card
].
tx_freq
[
i
]
=
0
.
0
;
if
(
i
<
openair0_cfg
[
card
].
rx_num_channels
)
openair0_cfg
[
card
].
rx_freq
[
i
]
=
downlink_frequency
[
0
][
i
];
else
openair0_cfg
[
card
].
rx_freq
[
i
]
=
0
.
0
;
openair0_cfg
[
card
].
autocal
[
i
]
=
1
;
openair0_cfg
[
card
].
tx_gain
[
i
]
=
tx_gain
[
0
][
i
];
openair0_cfg
[
card
].
rx_gain
[
i
]
=
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
-
rx_gain_off
;
openair0_cfg
[
card
].
configFilename
=
rf_config_file
;
printf
(
"Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f
\n
"
,
card
,
i
,
openair0_cfg
[
card
].
tx_gain
[
i
],
openair0_cfg
[
card
].
rx_gain
[
i
],
openair0_cfg
[
card
].
tx_freq
[
i
],
openair0_cfg
[
card
].
rx_freq
[
i
]);
}
}
if
(
frame_parms
[
0
]
->
frame_type
==
TDD
)
openair0_cfg
[
card
].
duplex_mode
=
duplex_mode_TDD
;
else
//FDD
openair0_cfg
[
card
].
duplex_mode
=
duplex_mode_FDD
;
printf
(
"HW: Configuring card %d, nb_antennas_tx/rx %d/%d
\n
"
,
card
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_tx
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_rx
);
openair0_cfg
[
card
].
Mod_id
=
0
;
openair0_cfg
[
card
].
num_rb_dl
=
frame_parms
[
0
]
->
N_RB_DL
;
openair0_cfg
[
card
].
clock_source
=
clock_source
;
openair0_cfg
[
card
].
tx_num_channels
=
min
(
2
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_tx
);
openair0_cfg
[
card
].
rx_num_channels
=
min
(
2
,
PHY_vars_UE_g
[
0
][
0
]
->
frame_parms
.
nb_antennas_rx
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
i
<
openair0_cfg
[
card
].
tx_num_channels
)
openair0_cfg
[
card
].
tx_freq
[
i
]
=
downlink_frequency
[
0
][
i
]
+
uplink_frequency_offset
[
0
][
i
];
else
openair0_cfg
[
card
].
tx_freq
[
i
]
=
0
.
0
;
if
(
i
<
openair0_cfg
[
card
].
rx_num_channels
)
openair0_cfg
[
card
].
rx_freq
[
i
]
=
downlink_frequency
[
0
][
i
];
else
openair0_cfg
[
card
].
rx_freq
[
i
]
=
0
.
0
;
openair0_cfg
[
card
].
autocal
[
i
]
=
1
;
openair0_cfg
[
card
].
tx_gain
[
i
]
=
tx_gain
[
0
][
i
];
openair0_cfg
[
card
].
rx_gain
[
i
]
=
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
-
rx_gain_off
;
openair0_cfg
[
card
].
configFilename
=
rf_config_file
;
printf
(
"Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f
\n
"
,
card
,
i
,
openair0_cfg
[
card
].
tx_gain
[
i
],
openair0_cfg
[
card
].
rx_gain
[
i
],
openair0_cfg
[
card
].
tx_freq
[
i
],
openair0_cfg
[
card
].
rx_freq
[
i
]);
}
if
(
usrp_args
)
openair0_cfg
[
card
].
sdr_addrs
=
usrp_args
;
if
(
usrp_clksrc
)
{
if
(
strcmp
(
usrp_clksrc
,
"internal"
)
==
0
)
{
openair0_cfg
[
card
].
clock_source
=
internal
;
LOG_D
(
PHY
,
"USRP clock source set as internal
\n
"
);
}
else
if
(
strcmp
(
usrp_clksrc
,
"external"
)
==
0
)
{
openair0_cfg
[
card
].
clock_source
=
external
;
LOG_D
(
PHY
,
"USRP clock source set as external
\n
"
);
}
else
if
(
strcmp
(
usrp_clksrc
,
"gpsdo"
)
==
0
)
{
openair0_cfg
[
card
].
clock_source
=
gpsdo
;
LOG_D
(
PHY
,
"USRP clock source set as gpsdo
\n
"
);
}
else
{
openair0_cfg
[
card
].
clock_source
=
internal
;
LOG_I
(
PHY
,
"USRP clock source unknown ('%s'). defaulting to internal
\n
"
,
usrp_clksrc
);
}
}
else
{
openair0_cfg
[
card
].
clock_source
=
internal
;
LOG_I
(
PHY
,
"USRP clock source not specified. defaulting to internal
\n
"
);
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -837,7 +859,7 @@ int main( int argc, char **argv ) {
#endif
// initialize the log (see log.h for details)
set_glog
(
LOG_DEBUG
);
set_glog
(
OAI
LOG_DEBUG
);
set_log
(
HW
,
OAILOG_DEBUG
);
set_log
(
PHY
,
OAILOG_DEBUG
);
...
...
targets/RT/USER/nr-uesoftmodem.h
View file @
6d1aae61
...
...
@@ -91,6 +91,9 @@
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
#define CONFIG_HLP_USRP_CLK_SRC "USRP clock source: 'internal' or 'external'\n"
/***************************************************************************************************************************************/
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
when calling config_get or config_getlist functions */
...
...
@@ -135,6 +138,8 @@
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \
{"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0} \
}
#define DEFAULT_DLF 2680000000
...
...
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