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
spbro
OpenXG-RAN
Commits
1ff806d5
Commit
1ff806d5
authored
Jun 05, 2020
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shared lib dependency error
parent
d1e8c235
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
201 additions
and
70 deletions
+201
-70
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+37
-56
cmake_targets/tools/build_helper
cmake_targets/tools/build_helper
+3
-2
openair1/SIMULATION/TOOLS/sim.h
openair1/SIMULATION/TOOLS/sim.h
+0
-9
targets/ARCH/rfsimulator/apply_channelmod.c
targets/ARCH/rfsimulator/apply_channelmod.c
+6
-2
targets/ARCH/rfsimulator/new_channel_sim.c
targets/ARCH/rfsimulator/new_channel_sim.c
+108
-0
targets/ARCH/rfsimulator/rfsimulator.h
targets/ARCH/rfsimulator/rfsimulator.h
+37
-0
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+10
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
1ff806d5
This diff is collapsed.
Click to expand it.
cmake_targets/tools/build_helper
View file @
1ff806d5
...
...
@@ -150,7 +150,9 @@ clean_all_files() {
set_openair_env
dir=$OPENAIR_DIR/cmake_targets
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
rm -rf $dir/ran_build $dir/lte-simulators/build
rm -rf $dir/ran_build $dir/ran_build_noLOG
rm -rf $dir/lte-simulators/build
rm -rf $dir/phy_simulators/build $dir/nas_sim_tools/build
rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
}
...
...
@@ -177,7 +179,6 @@ compilations() {
cd $OPENAIR_DIR/cmake_targets/$1/build
set +e
{
rm -f $3
if [ "$BUILD_COVERITY_SCAN" == "1" ]; then
COV_SCAN_PREFIX="cov-build --dir cov-int"
else
...
...
openair1/SIMULATION/TOOLS/sim.h
View file @
1ff806d5
...
...
@@ -432,15 +432,6 @@ void multipath_tv_channel(channel_desc_t *desc,
/**@} */
/**@} */
void
rxAddInput
(
struct
complex16
*
input_sig
,
struct
complex16
*
after_channel_sig
,
int
rxAnt
,
channel_desc_t
*
channelDesc
,
int
nbSamples
,
uint64_t
TS
,
uint32_t
CirSize
);
int
modelid_fromname
(
char
*
modelname
);
double
channelmod_get_snr_dB
(
void
);
double
channelmod_get_sinr_dB
(
void
);
...
...
targets/ARCH/rfsimulator/apply_channelmod.c
View file @
1ff806d5
...
...
@@ -34,6 +34,9 @@
#include <common/utils/LOG/log.h>
#include <common/config/config_userapi.h>
#include <openair1/SIMULATION/TOOLS/sim.h>
#include <common/utils/telnetsrv/telnetsrv.h>
#include <common/utils/load_module_shlib.h>
#include <targets/ARCH/rfsimulator/rfsimulator.h>
/*
Legacy study:
...
...
@@ -99,8 +102,8 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
}
//l
}
out_ptr
->
r
+=
round
(
rx_tmp
.
x
*
pathLossLinear
+
noise_per_sample
*
gauss
double
(
0
.
0
,
1
.
0
));
out_ptr
->
i
+=
round
(
rx_tmp
.
y
*
pathLossLinear
+
noise_per_sample
*
gauss
double
(
0
.
0
,
1
.
0
));
out_ptr
->
r
+=
round
(
rx_tmp
.
x
*
pathLossLinear
+
noise_per_sample
*
gauss
Ziggurat
(
0
.
0
,
1
.
0
));
out_ptr
->
i
+=
round
(
rx_tmp
.
y
*
pathLossLinear
+
noise_per_sample
*
gauss
Ziggurat
(
0
.
0
,
1
.
0
));
out_ptr
++
;
}
...
...
@@ -112,3 +115,4 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
channelDesc
->
path_loss_dB
,
10
*
log10
(
noise_per_sample
));
}
targets/ARCH/rfsimulator/new_channel_sim.c
0 → 100644
View file @
1ff806d5
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Author and copyright: Laurent Thomas, open-cells.com
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
#include <errno.h>
#include <common/utils/assertions.h>
#include <common/utils/LOG/log.h>
#include <common/config/config_userapi.h>
#include <openair1/SIMULATION/TOOLS/sim.h>
#include <targets/ARCH/rfsimulator/rfsimulator.h>
// Ziggurat
static
double
wn
[
128
],
fn
[
128
];
static
uint32_t
iz
,
jz
,
jsr
=
123456789
,
kn
[
128
];
static
int32_t
hz
;
#define SHR3 (jz=jsr, jsr^=(jsr<<13),jsr^=(jsr>>17),jsr^=(jsr<<5),jz+jsr)
#define UNI (0.5+(signed) SHR3 * 0.2328306e-9)
double
nfix
(
void
)
{
const
double
r
=
3
.
442620
;
static
double
x
,
y
;
for
(;;)
{
x
=
hz
*
wn
[
iz
];
if
(
iz
==
0
)
{
do
{
x
=
-
0
.
2904764
*
log
(
UNI
);
y
=
-
log
(
UNI
);
}
while
(
y
+
y
<
x
*
x
);
return
(
hz
>
0
)
?
r
+
x
:
-
r
-
x
;
}
if
(
fn
[
iz
]
+
UNI
*
(
fn
[
iz
-
1
]
-
fn
[
iz
])
<
exp
(
-
0
.
5
*
x
*
x
))
{
return
x
;
}
hz
=
SHR3
;
iz
=
hz
&
127
;
if
(
abs
(
hz
)
<
kn
[
iz
])
{
return
((
hz
)
*
wn
[
iz
]);
}
}
}
/*!\Procedure to create tables for normal distribution kn,wn and fn. */
void
tableNor
(
unsigned
long
seed
)
{
jsr
=
seed
;
double
dn
=
3
.
442619855899
;
int
i
;
const
double
m1
=
2147483648
.
0
;
double
q
;
double
tn
=
3
.
442619855899
;
const
double
vn
=
9.91256303526217E-03
;
q
=
vn
/
exp
(
-
0
.
5
*
dn
*
dn
);
kn
[
0
]
=
((
dn
/
q
)
*
m1
);
kn
[
1
]
=
0
;
wn
[
0
]
=
(
q
/
m1
);
wn
[
127
]
=
(
dn
/
m1
);
fn
[
0
]
=
1
.
0
;
fn
[
127
]
=
(
exp
(
-
0
.
5
*
dn
*
dn
)
);
for
(
i
=
126
;
1
<=
i
;
i
--
)
{
dn
=
sqrt
(
-
2
.
0
*
log
(
vn
/
dn
+
exp
(
-
0
.
5
*
dn
*
dn
)));
kn
[
i
+
1
]
=
((
dn
/
tn
)
*
m1
);
tn
=
dn
;
fn
[
i
]
=
(
exp
(
-
0
.
5
*
dn
*
dn
));
wn
[
i
]
=
(
dn
/
m1
);
}
return
;
}
double
gaussZiggurat
(
double
mean
,
double
variance
)
{
hz
=
SHR3
;
iz
=
hz
&
127
;
return
abs
(
hz
)
<
kn
[
iz
]
?
hz
*
wn
[
iz
]
:
nfix
();
}
targets/ARCH/rfsimulator/rfsimulator.h
0 → 100644
View file @
1ff806d5
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Author and copyright: Laurent Thomas, open-cells.com
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __RFSIMULATOR_H
#define __RFSIMULATOR_H
double
gaussZiggurat
(
double
mean
,
double
variance
);
void
tableNor
(
unsigned
long
seed
);
void
rxAddInput
(
struct
complex16
*
input_sig
,
struct
complex16
*
after_channel_sig
,
int
rxAnt
,
channel_desc_t
*
channelDesc
,
int
nbSamples
,
uint64_t
TS
,
uint32_t
CirSize
);
#endif
targets/ARCH/rfsimulator/simulator.c
View file @
1ff806d5
...
...
@@ -50,6 +50,7 @@
#include "openair1/PHY/defs_UE.h"
#define CHANNELMOD_DYNAMICLOAD
#include <openair1/SIMULATION/TOOLS/sim.h>
#include <targets/ARCH/rfsimulator/rfsimulator.h>
#define PORT 4043 //default TCP port for this simulator
#define CirSize 307200 // 100ms is enough
...
...
@@ -146,6 +147,12 @@ void allocCirBuf(rfsimulator_state_t *bridge, int sock) {
// the value channel_model->path_loss_dB seems only a storage place (new_channel_desc_scm() only copy the passed value)
// Legacy changes directlty the variable channel_model->path_loss_dB place to place
// while calling new_channel_desc_scm() with path losses = 0
static
bool
init_done
=
false
;
if
(
!
init_done
)
{
randominit
(
0
);
tableNor
(
0
);
init_done
=
true
;
}
ptr
->
channel_model
=
new_channel_desc_scm
(
bridge
->
tx_num_channels
,
bridge
->
rx_num_channels
,
bridge
->
channelmod
,
bridge
->
sample_rate
,
...
...
@@ -561,6 +568,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
pthread_mutex_unlock
(
&
Sockmutex
);
usleep
(
10000
);
pthread_mutex_lock
(
&
Sockmutex
);
if
(
t
->
lastWroteTS
<
t
->
nextTimestamp
)
{
// Assuming Tx is not done fully in another thread
// We can never write is the past from the received time
...
...
@@ -574,6 +582,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
for
(
int
i
=
0
;
i
<
t
->
tx_num_channels
;
i
++
)
samplesVoid
[
i
]
=
(
void
*
)
&
v
;
LOG_I
(
HW
,
"No samples Tx occured, so we send 1 sample to notify it: Tx:%lu, Rx:%lu
\n
"
,
t
->
lastWroteTS
,
t
->
nextTimestamp
);
rfsimulator_write_internal
(
t
,
t
->
nextTimestamp
,
...
...
@@ -716,7 +725,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
rfsimulator
->
rx_num_channels
=
openair0_cfg
->
rx_num_channels
;
rfsimulator
->
sample_rate
=
openair0_cfg
->
sample_rate
;
rfsimulator
->
tx_bw
=
openair0_cfg
->
tx_bw
;
randominit
(
0
);
//
randominit(0);
set_taus_seed
(
0
);
return
0
;
}
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