Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mingxuan Li
openairinterface5G
Commits
538e08d0
Commit
538e08d0
authored
5 years ago
by
Florian Kaltenberger
Browse files
Options
Downloads
Patches
Plain Diff
Revert "adding support for beam selection in usrp_lib"
This reverts commit
615f365b
.
parent
51f5a5b3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
executables/nr-ru.c
+0
-4
0 additions, 4 deletions
executables/nr-ru.c
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+18
-38
18 additions, 38 deletions
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
with
18 additions
and
42 deletions
executables/nr-ru.c
+
0
−
4
View file @
538e08d0
...
...
@@ -754,10 +754,6 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
nextslot_type
==
NR_UPLINK_SLOT
)
{
flags
=
3
;
// end of burst
}
// the beam index is written in bits 8-10 of the flags
// the following choice cycles through the beams every slot, starting with beam 3
flags
|=
((
3
+
slot
)
&
7
)
<<
8
;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS
,
flags
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU
,
frame
);
...
...
This diff is collapsed.
Click to expand it.
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+
18
−
38
View file @
538e08d0
...
...
@@ -276,17 +276,14 @@ static int trx_usrp_start(openair0_device *device) {
// setup GPIO for TDD, GPIO(4) = ATR_RX
//set data direction register (DDR) to output
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"DDR"
,
0x
ff
f
,
0x
ff
f
);
//set
lower 7 bits to be controlled automatically by ATR (the rest 5 bits are controlled manually)
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"CTRL"
,
0x7f
,
0x
ff
f
);
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"DDR"
,
0x
7
f
,
0x
7
f
);
//set
control register to ATR
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"CTRL"
,
0x7f
,
0x
7
f
);
//set pins 4 (RX_TX_Switch) and 6 (Shutdown PA) to 1 when the radio is only receiving (ATR_RX)
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"ATR_RX"
,
(
1
<<
4
)
|
(
1
<<
6
),
0x7f
);
// set pin 5 (Shutdown LNA) to 1 when the radio is transmitting and receiveing (ATR_XX)
// (we use full duplex here, because our RX is on all the time - this might need to change later)
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"ATR_XX"
,
(
1
<<
5
),
0x7f
);
// set the output pins to 0
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"OUT"
,
3
<<
7
,
0xf80
);
// init recv and send streaming
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
LOG_I
(
HW
,
"Time in secs now: %llu
\n
"
,
s
->
usrp
->
get_time_now
().
to_ticks
(
s
->
sample_rate
));
...
...
@@ -407,19 +404,10 @@ static int trx_usrp_write_recplay(openair0_device *device, openair0_timestamp ti
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
*/
static
int
trx_usrp_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
void
**
buff
,
int
nsamps
,
int
cc
,
int
flags
)
{
static
int
trx_usrp_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
void
**
buff
,
int
nsamps
,
int
cc
,
int
flags
)
{
int
ret
=
0
;
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
int
nsamps2
;
// aligned to upper 32 or 16 byte boundary
int
flags_lsb
=
flags
&
0xff
;
int
flags_msb
=
(
flags
>>
8
)
&
0xff
;
#if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__
nsamps2
=
(
nsamps
+
7
)
>>
3
;
...
...
@@ -453,48 +441,40 @@ static int trx_usrp_write(openair0_device *device,
boolean_t
first_packet_state
=
false
,
last_packet_state
=
false
;
if
(
flags
_lsb
==
2
)
{
// start of burst
if
(
flags
==
2
)
{
// start of burst
// s->tx_md.start_of_burst = true;
// s->tx_md.end_of_burst = false;
first_packet_state
=
true
;
last_packet_state
=
false
;
}
else
if
(
flags
_lsb
==
3
)
{
// end of burst
}
else
if
(
flags
==
3
)
{
// end of burst
//s->tx_md.start_of_burst = false;
//s->tx_md.end_of_burst = true;
first_packet_state
=
false
;
last_packet_state
=
true
;
}
else
if
(
flags
_lsb
==
4
)
{
// start and end
// s->tx_md.start_of_burst = true;
// s->tx_md.end_of_burst = true;
}
else
if
(
flags
==
4
)
{
// start and end
// s->tx_md.start_of_burst = true;
// s->tx_md.end_of_burst = true;
first_packet_state
=
true
;
last_packet_state
=
true
;
}
else
if
(
flags
_lsb
==
1
)
{
// middle of burst
// s->tx_md.start_of_burst = false;
// s->tx_md.end_of_burst = false;
}
else
if
(
flags
==
1
)
{
// middle of burst
// s->tx_md.start_of_burst = false;
// s->tx_md.end_of_burst = false;
first_packet_state
=
false
;
last_packet_state
=
false
;
}
else
if
(
flags_lsb
==
10
)
{
// fail safe mode
// s->tx_md.has_time_spec = false;
// s->tx_md.start_of_burst = false;
// s->tx_md.end_of_burst = true;
first_packet_state
=
false
;
last_packet_state
=
true
;
}
else
if
(
flags
==
10
)
{
// fail safe mode
// s->tx_md.has_time_spec = false;
// s->tx_md.start_of_burst = false;
// s->tx_md.end_of_burst = true;
first_packet_state
=
false
;
last_packet_state
=
true
;
}
// push GPIO bits 7-9 from flags_msb
int
gpio789
=
(
flags_msb
&
7
)
<<
7
;
s
->
tx_md
.
has_time_spec
=
true
;
s
->
tx_md
.
start_of_burst
=
(
s
->
tx_count
==
0
)
?
true
:
first_packet_state
;
s
->
tx_md
.
end_of_burst
=
last_packet_state
;
s
->
tx_md
.
time_spec
=
uhd
::
time_spec_t
::
from_ticks
(
timestamp
,
s
->
sample_rate
);
s
->
tx_count
++
;
s
->
usrp
->
set_command_time
(
s
->
tx_md
.
time_spec
);
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"OUT"
,
gpio789
,
0xfff
);
s
->
usrp
->
clear_command_time
();
if
(
cc
>
1
)
{
std
::
vector
<
void
*>
buff_ptrs
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment