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
920c1452
Commit
920c1452
authored
Jul 31, 2019
by
yilmazt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes to the organization of nr_phy simulators
parent
4967e1b1
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
176 additions
and
359 deletions
+176
-359
cmake_targets/autotests/test_case_list.xml
cmake_targets/autotests/test_case_list.xml
+11
-11
common/utils/LOG/log.c
common/utils/LOG/log.c
+1
-1
openair1/SCHED/fapi_l1.c
openair1/SCHED/fapi_l1.c
+20
-20
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+12
-72
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+27
-81
openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
+9
-0
openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
+58
-0
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+4
-30
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+5
-26
openair1/SIMULATION/NR_PHY/ulschsim.c
openair1/SIMULATION/NR_PHY/ulschsim.c
+6
-46
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+23
-72
No files found.
cmake_targets/autotests/test_case_list.xml
View file @
920c1452
...
...
@@ -1203,7 +1203,7 @@
<pre_exec>
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
</pre_exec>
<pre_exec_args></pre_exec_args>
<main_exec>
$OPENAIR_DIR/cmake_targets/lte-simulators/build/dlsim_tm4
</main_exec>
<main_exec_args>
-m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
<main_exec_args>
-m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
-m14 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70
...
...
common/utils/LOG/log.c
View file @
920c1452
...
...
@@ -718,7 +718,7 @@ void logClean (void)
}
}
extern
int
oai_exit
;
extern
volatile
int
oai_exit
;
//extern
int oai_exit;
void
flush_mem_to_file
(
void
)
{
int
fp
;
...
...
openair1/SCHED/fapi_l1.c
View file @
920c1452
...
...
@@ -935,7 +935,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
eNB
->
pdcch_vars
[
NFAPI_SFNSF2SF
(
HI_DCI0_req
->
sfn_sf
)
&
1
].
num_pdcch_symbols
=
0
;
}
if
(
NFAPI_MODE
!=
NFAPI_MODE_VNF
)
if
(
NFAPI_MODE
!=
NFAPI_MODE_VNF
)
for
(
i
=
0
;
i
<
number_hi_dci0_pdu
;
i
++
)
{
hi_dci0_req_pdu
=
&
HI_DCI0_req
->
hi_dci0_request_body
.
hi_dci0_pdu_list
[
i
];
LOG_D
(
PHY
,
"NFAPI: hi_dci0_pdu %d : type %d
\n
"
,
i
,
hi_dci0_req_pdu
->
pdu_type
);
...
...
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
920c1452
...
...
@@ -25,102 +25,42 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "common/ran_context.h"
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/
defs_gNB
.h"
#include "PHY/
types
.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_REFSIG/nr_mod_table.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/MODULATION/modulation_UE.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_REFSIG/nr_mod_table.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "SCHED_NR/sched_nr.h"
//#include "PHY/MODULATION/modulation_common.h"
//#include "common/config/config_load_configmodule.h"
//#include "UTIL/LISTS/list.h"
//#include "common/ran_context.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/RF/rf.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
//#define DEBUG_NR_DLSCHSIM
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
RAN_CONTEXT_t
RC
;
double
cpuf
;
// dummy functions
int
nfapi_mode
=
0
;
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);
}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
//uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
int32_t
get_uldl_offset
(
int
eutra_bandP
)
{
return
(
0
);
}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
)
{
return
(
NULL
);
}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
// needed for some functions
PHY_VARS_NR_UE
*
PHY_vars_UE_g
[
1
][
1
]
=
{
{
NULL
}
};
uint16_t
n_rnti
=
0x1234
;
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
char
quantize
(
double
D
,
double
x
,
unsigned
char
B
)
{
double
qxd
;
short
maxlev
;
qxd
=
floor
(
x
/
D
);
maxlev
=
1
<<
(
B
-
1
);
//(char)(pow(2,B-1));
//printf("x=%f,qxd=%f,maxlev=%d\n",x,qxd, maxlev);
if
(
qxd
<=
-
maxlev
)
qxd
=
-
maxlev
;
else
if
(
qxd
>=
maxlev
)
qxd
=
maxlev
-
1
;
return
((
char
)
qxd
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
char
c
;
int
i
;
//,j,l,aa;
double
SNR
,
SNR_lin
,
snr0
=
-
2
.
0
,
snr1
=
2
.
0
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
920c1452
...
...
@@ -19,119 +19,65 @@
* contact@openairinterface.org
*/
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include "common/ran_context.h"
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_defs.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_extern.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/
defs_gNB
.h"
#include "PHY/
NR_REFSIG/refsig_defs_ue
.h"
#include "PHY/
NR_REFSIG/nr_mod_table
.h"
#include "PHY/
phy_vars
.h"
#include "PHY/
types
.h"
#include "PHY/
INIT/phy_init
.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/MODULATION/modulation_UE.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/NR_REFSIG/nr_mod_table.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/phy_vars.h"
#include "SCHED_NR/sched_nr.h"
#include "SCHED_NR/fapi_nr_l1.h"
#include "SCHED_NR/sched_nr.h"
#include "SCHED_NR_UE/defs.h"
#include "SCHED_NR_UE/fapi_nr_ue_l1.h"
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/NR_MAC_UE/mac_defs.h"
#include "LAYER2/NR_MAC_UE/mac_extern.h"
#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "NR_PHY_INTERFACE/NR_IF_Module.h"
#include "NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "LAYER2/NR_MAC_UE/mac_proto.h"
//#include "LAYER2/NR_MAC_gNB/mac_proto.h"
//#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "RRC/NR/MESSAGES/asn1_msg.h"
#include "openair1/SIMULATION/RF/rf.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
RAN_CONTEXT_t
RC
;
double
cpuf
;
// dummy functions
int
nfapi_mode
=
0
;
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);}
int32_t
get_uldl_offset
(
int
nr_bandP
)
{
return
(
0
);}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
){
return
(
NULL
);}
int
dummy_nr_ue_dl_indication
(
nr_downlink_indication_t
*
dl_info
){
return
(
0
);}
int
dummy_nr_ue_ul_indication
(
nr_uplink_indication_t
*
ul_info
){
return
(
0
);}
lte_subframe_t
subframe_select
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
subframe
)
{
return
(
SF_DL
);}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
//Dummy Functions
lte_subframe_t
subframe_select
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
subframe
)
{
return
(
SF_DL
);}
int
rlc_module_init
(
void
)
{
return
(
0
);}
void
pdcp_layer_init
(
void
)
{}
int
rrc_init_nr_global_param
(
void
){
return
(
0
);}
void
config_common
(
int
Mod_idP
,
int
CC_idP
,
int
Nid_cell
,
int
nr_bandP
,
uint64_t
SSB_positions
,
uint16_t
ssb_periodicity
,
uint64_t
dl_CarrierFreqP
,
uint32_t
dl_BandwidthP
);
void
pdcp_layer_init
(
void
)
{}
int
rrc_init_nr_global_param
(
void
)
{
return
(
0
);}
void
config_common
(
int
Mod_idP
,
int
CC_idP
,
int
Nid_cell
,
int
nr_bandP
,
uint64_t
SSB_positions
,
uint16_t
ssb_periodicity
,
uint64_t
dl_CarrierFreqP
,
uint32_t
dl_BandwidthP
);
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
(
0
);}
// needed for some functions
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
int
main
(
int
argc
,
char
**
argv
)
{
char
c
;
int
i
,
aa
;
//,l;
double
sigma2
,
sigma2_dB
=
10
,
SNR
,
snr0
=-
2
.
0
,
snr1
=
2
.
0
;
uint8_t
snr1set
=
0
;
...
...
openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
0 → 100644
View file @
920c1452
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);
}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int32_t
get_uldl_offset
(
int
nr_bandP
)
{
return
(
0
);
}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
)
{
return
(
NULL
);}
int
dummy_nr_ue_dl_indication
(
nr_downlink_indication_t
*
dl_info
)
{
return
(
0
);
}
int
dummy_nr_ue_ul_indication
(
nr_uplink_indication_t
*
ul_info
)
{
return
(
0
);
}
openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
0 → 100644
View file @
920c1452
/*
* 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
*
* 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
*/
/*!\file openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
* \brief
* \author Turker Yilmaz
* \date 2019
* \version 0.1
* \company EURECOM
* \email turker.yilmaz@eurecom.fr
* \note
* \warning
*/
#ifndef __NR_UNITARY_DEFS__H__
#define __NR_UNITARY_DEFS__H__
volatile
int
oai_exit
=
0
;
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
char
quantize
(
double
D
,
double
x
,
unsigned
char
B
)
{
double
qxd
;
short
maxlev
;
qxd
=
floor
(
x
/
D
);
maxlev
=
1
<<
(
B
-
1
);
//(char)(pow(2,B-1));
if
(
qxd
<=
-
maxlev
)
qxd
=
-
maxlev
;
else
if
(
qxd
>=
maxlev
)
qxd
=
maxlev
-
1
;
return
((
char
)
qxd
);
}
#endif
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
920c1452
...
...
@@ -25,13 +25,9 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
...
...
@@ -45,48 +41,26 @@
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
#include "PHY/phy_vars.h"
#include "SCHED_NR/sched_nr.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/RF/rf.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
//#define DEBUG_NR_PBCHSIM
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
RAN_CONTEXT_t
RC
;
double
cpuf
;
// dummy functions
int
nfapi_mode
=
0
;
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);}
//uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
int32_t
get_uldl_offset
(
int
nr_bandP
)
{
return
(
0
);}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
){
return
(
NULL
);}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
// needed for some functions
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
int
main
(
int
argc
,
char
**
argv
)
{
char
c
;
int
i
,
aa
;
//,l;
double
sigma2
,
sigma2_dB
=
10
,
SNR
,
snr0
=-
2
.
0
,
snr1
=
2
.
0
;
double
cfo
=
0
;
...
...
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
920c1452
...
...
@@ -25,13 +25,9 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
...
...
@@ -43,36 +39,19 @@
#include "PHY/INIT/phy_init.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "SCHED_NR/sched_nr.h"
#include "PHY/NR_UE_TRANSPORT/pucch_nr.h"
#include "SCHED_NR/sched_nr.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/RF/rf.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
RAN_CONTEXT_t
RC
;
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
double
cpuf
;
// dummy functions
int
nfapi_mode
=
0
;
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);}
//uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn) {return(0);}
int32_t
get_uldl_offset
(
int
nr_bandP
)
{
return
(
0
);}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
){
return
(
NULL
);}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
// needed for some functions
PHY_VARS_NR_UE
*
PHY_vars_UE_g
[
1
][
1
]
=
{{
NULL
}};
...
...
openair1/SIMULATION/NR_PHY/ulschsim.c
View file @
920c1452
...
...
@@ -25,14 +25,9 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
...
...
@@ -46,62 +41,27 @@
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "SCHED_NR/sched_nr.h"
//#include "PHY/MODULATION/modulation_common.h"
//#include "common/config/config_load_configmodule.h"
//#include "UTIL/LISTS/list.h"
//#include "common/ran_context.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/RF/rf.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
//#define DEBUG_NR_ULSCHSIM
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
RAN_CONTEXT_t
RC
;
double
cpuf
;
// dummy functions
int
nfapi_mode
=
0
;
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);
}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
//uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
int32_t
get_uldl_offset
(
int
eutra_bandP
)
{
return
(
0
);
}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
)
{
return
(
NULL
);
}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
// needed for some functions
PHY_VARS_NR_UE
*
PHY_vars_UE_g
[
1
][
1
]
=
{
{
NULL
}
};
uint16_t
n_rnti
=
0x1234
;
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
char
quantize
(
double
D
,
double
x
,
unsigned
char
B
)
{
double
qxd
;
short
maxlev
;
qxd
=
floor
(
x
/
D
);
maxlev
=
1
<<
(
B
-
1
);
//(char)(pow(2,B-1));
//printf("x=%f,qxd=%f,maxlev=%d\n",x,qxd, maxlev);
if
(
qxd
<=
-
maxlev
)
qxd
=
-
maxlev
;
else
if
(
qxd
>=
maxlev
)
qxd
=
maxlev
-
1
;
return
((
char
)
qxd
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
char
c
;
int
i
,
sf
;
double
SNR
,
snr0
=
-
2
.
0
,
snr1
=
2
.
0
;
//, SNR_lin;
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
920c1452
...
...
@@ -25,103 +25,54 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "common/ran_context.h"
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/defs_gNB.h"
#include "PHY/phy_vars.h"
#include "PHY/types.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_REFSIG/nr_mod_table.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/MODULATION/modulation_UE.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_REFSIG/nr_mod_table.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/
NR_TRANSPORT/nr_transport_proto
.h"
#include "PHY/
TOOLS/tools_defs
.h"
#include "SCHED_NR/sched_nr.h"
#include "SCHED_NR_UE/defs.h"
#include "PHY/TOOLS/tools_defs.h"
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
#include "PHY/phy_vars.h"
#include "SCHED_NR_UE/fapi_nr_ue_l1.h"
//#include "PHY/MODULATION/modulation_common
.h"
//#include "common/config/config_load_configmodule
.h"
//#include "UTIL/LISTS/list.h
"
//#include "common/ran_context
.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/RF/rf
.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs
.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
"
#include "openair2/LAYER2/NR_MAC_UE/mac_proto
.h"
//#define DEBUG_ULSIM
PHY_VARS_gNB
*
gNB
;
PHY_VARS_NR_UE
*
UE
;
RAN_CONTEXT_t
RC
;
double
cpuf
;
// dummy functions
int
nfapi_mode
=
0
;
int
oai_nfapi_hi_dci0_req
(
nfapi_hi_dci0_request_t
*
hi_dci0_req
)
{
return
(
0
);
}
int
oai_nfapi_tx_req
(
nfapi_tx_request_t
*
tx_req
)
{
return
(
0
);
}
int
oai_nfapi_dl_config_req
(
nfapi_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
int
oai_nfapi_ul_config_req
(
nfapi_ul_config_request_t
*
ul_config_req
)
{
return
(
0
);
}
int
oai_nfapi_nr_dl_config_req
(
nfapi_nr_dl_config_request_t
*
dl_config_req
)
{
return
(
0
);
}
//uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); }
int32_t
get_uldl_offset
(
int
eutra_bandP
)
{
return
(
0
);
}
NR_IF_Module_t
*
NR_IF_Module_init
(
int
Mod_id
)
{
return
(
NULL
);
}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
exit
(
-
1
);
}
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
// dummy functions
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
// needed for some functions
uint16_t
n_rnti
=
0x1234
;
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
char
quantize
(
double
D
,
double
x
,
unsigned
char
B
)
{
double
qxd
;
short
maxlev
;
qxd
=
floor
(
x
/
D
);
maxlev
=
1
<<
(
B
-
1
);
//(char)(pow(2,B-1));
//printf("x=%f,qxd=%f,maxlev=%d\n",x,qxd, maxlev);
if
(
qxd
<=
-
maxlev
)
qxd
=
-
maxlev
;
else
if
(
qxd
>=
maxlev
)
qxd
=
maxlev
-
1
;
return
((
char
)
qxd
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
char
c
;
int
i
,
sf
;
double
SNR
,
snr0
=
-
2
.
0
,
snr1
=
2
.
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