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
2ff12533
Commit
2ff12533
authored
Jul 07, 2024
by
Bartosz Podrygajlo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move init_nr_bler_table out of nr-uesoftmodem.c
parent
dc91550e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
65 deletions
+59
-65
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+2
-58
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+0
-2
openair1/SIMULATION/NR_PHY/prachsim.c
openair1/SIMULATION/NR_PHY/prachsim.c
+0
-2
openair1/SIMULATION/NR_PHY/psbchsim.c
openair1/SIMULATION/NR_PHY/psbchsim.c
+0
-1
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+0
-2
openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.c
openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.c
+56
-0
openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.h
openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.h
+1
-0
No files found.
executables/nr-uesoftmodem.c
View file @
2ff12533
...
...
@@ -165,10 +165,6 @@ unsigned int NTN_UE_Koffset = 0;
*/
uint8_t
abstraction_flag
=
0
;
nr_bler_struct
nr_bler_data
[
NR_NUM_MCS
];
static
void
init_bler_table
(
char
*
);
/*---------------------BMC: timespec helpers -----------------------------*/
struct
timespec
min_diff_time
=
{
.
tv_sec
=
0
,
.
tv_nsec
=
0
};
...
...
@@ -421,9 +417,9 @@ static void get_channel_model_mode(configmodule_interface_t *cfg)
int
num_xp_antennas
=
*
GNBParams
[
GNB_PDSCH_ANTENNAPORTS_XP_IDX
].
iptr
;
if
(
num_xp_antennas
==
2
)
init_bler_table
(
"NR_MIMO2x2_AWGN_RESULTS_DIR"
);
init_
nr_
bler_table
(
"NR_MIMO2x2_AWGN_RESULTS_DIR"
);
else
init_bler_table
(
"NR_AWGN_RESULTS_DIR"
);
init_
nr_
bler_table
(
"NR_AWGN_RESULTS_DIR"
);
}
void
start_oai_nrue_threads
()
...
...
@@ -639,55 +635,3 @@ int main(int argc, char **argv)
return
0
;
}
// Read in each MCS file and build BLER-SINR-TB table
static
void
init_bler_table
(
char
*
env_string
)
{
memset
(
nr_bler_data
,
0
,
sizeof
(
nr_bler_data
));
const
char
*
awgn_results_dir
=
getenv
(
env_string
);
if
(
!
awgn_results_dir
)
{
LOG_W
(
NR_MAC
,
"No %s
\n
"
,
env_string
);
return
;
}
for
(
unsigned
int
i
=
0
;
i
<
NR_NUM_MCS
;
i
++
)
{
char
fName
[
1024
];
snprintf
(
fName
,
sizeof
(
fName
),
"%s/mcs%u_awgn_5G.csv"
,
awgn_results_dir
,
i
);
FILE
*
pFile
=
fopen
(
fName
,
"r"
);
if
(
!
pFile
)
{
LOG_E
(
NR_MAC
,
"%s: open %s: %s
\n
"
,
__func__
,
fName
,
strerror
(
errno
));
continue
;
}
size_t
bufSize
=
1024
;
char
*
line
=
NULL
;
char
*
token
;
char
*
temp
=
NULL
;
int
nlines
=
0
;
while
(
getline
(
&
line
,
&
bufSize
,
pFile
)
>
0
)
{
if
(
!
strncmp
(
line
,
"SNR"
,
3
))
{
continue
;
}
if
(
nlines
>
NR_NUM_SINR
)
{
LOG_E
(
NR_MAC
,
"BLER FILE ERROR - num lines greater than expected - file: %s
\n
"
,
fName
);
abort
();
}
token
=
strtok_r
(
line
,
";"
,
&
temp
);
int
ncols
=
0
;
while
(
token
!=
NULL
)
{
if
(
ncols
>
NUM_BLER_COL
)
{
LOG_E
(
NR_MAC
,
"BLER FILE ERROR - num of cols greater than expected
\n
"
);
abort
();
}
nr_bler_data
[
i
].
bler_table
[
nlines
][
ncols
]
=
strtof
(
token
,
NULL
);
ncols
++
;
token
=
strtok_r
(
NULL
,
";"
,
&
temp
);
}
nlines
++
;
}
nr_bler_data
[
i
].
length
=
nlines
;
fclose
(
pFile
);
}
}
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
2ff12533
...
...
@@ -119,8 +119,6 @@ void nr_derive_key(int alg_type, uint8_t alg_id, const uint8_t key[32], uint8_t
void
processSlotTX
(
void
*
arg
)
{}
nr_bler_struct
nr_bler_data
[
NR_NUM_MCS
];
// needed for some functions
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
void
update_ptrs_config
(
NR_CellGroupConfig_t
*
secondaryCellGroup
,
uint16_t
*
rbSize
,
uint8_t
*
mcsIndex
,
int8_t
*
ptrs_arg
);
...
...
openair1/SIMULATION/NR_PHY/prachsim.c
View file @
2ff12533
...
...
@@ -114,8 +114,6 @@ nrUE_params_t *get_nrUE_params(void) {
return
&
nrUE_params
;
}
nr_bler_struct
nr_bler_data
[
NR_NUM_MCS
];
void
processSlotTX
(
void
*
arg
)
{}
int
NB_UE_INST
=
1
;
configmodule_interface_t
*
uniqCfg
=
NULL
;
...
...
openair1/SIMULATION/NR_PHY/psbchsim.c
View file @
2ff12533
...
...
@@ -80,7 +80,6 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
return
0
;
}
nr_bler_struct
nr_bler_data
[
NR_NUM_MCS
];
void
get_nrUE_params
(
void
)
{
return
;
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
2ff12533
...
...
@@ -121,8 +121,6 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
return
0
;
}
nr_bler_struct
nr_bler_data
[
NR_NUM_MCS
];
void
nr_derive_key
(
int
alg_type
,
uint8_t
alg_id
,
const
uint8_t
key
[
32
],
uint8_t
out
[
16
])
{
(
void
)
alg_type
;
...
...
openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.c
View file @
2ff12533
...
...
@@ -23,6 +23,8 @@
#include "executables/softmodem-common.h"
#include "NR_MAC_UE/mac_proto.h"
nr_bler_struct
nr_bler_data
[
NR_NUM_MCS
];
slot_rnti_mcs_s
slot_rnti_mcs
[
NUM_NFAPI_SLOT
];
void
read_channel_param
(
const
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
pdu
,
int
slot
,
int
index
)
{
...
...
@@ -204,3 +206,57 @@ int get_mcs_from_sinr(nr_bler_struct *nr_bler_data, float sinr)
LOG_E
(
NR_MAC
,
"Unable to get an MCS value.
\n
"
);
abort
();
}
// Read in each MCS file and build BLER-SINR-TB table
void
init_nr_bler_table
(
const
char
*
env_string
)
{
memset
(
nr_bler_data
,
0
,
sizeof
(
nr_bler_data
));
const
char
*
awgn_results_dir
=
getenv
(
env_string
);
if
(
!
awgn_results_dir
)
{
LOG_W
(
NR_MAC
,
"No %s
\n
"
,
env_string
);
return
;
}
for
(
unsigned
int
i
=
0
;
i
<
NR_NUM_MCS
;
i
++
)
{
char
fName
[
1024
];
snprintf
(
fName
,
sizeof
(
fName
),
"%s/mcs%u_awgn_5G.csv"
,
awgn_results_dir
,
i
);
FILE
*
pFile
=
fopen
(
fName
,
"r"
);
if
(
!
pFile
)
{
LOG_E
(
NR_MAC
,
"%s: open %s: %s
\n
"
,
__func__
,
fName
,
strerror
(
errno
));
continue
;
}
size_t
bufSize
=
1024
;
char
*
line
=
NULL
;
char
*
token
;
char
*
temp
=
NULL
;
int
nlines
=
0
;
while
(
getline
(
&
line
,
&
bufSize
,
pFile
)
>
0
)
{
if
(
!
strncmp
(
line
,
"SNR"
,
3
))
{
continue
;
}
if
(
nlines
>
NR_NUM_SINR
)
{
LOG_E
(
NR_MAC
,
"BLER FILE ERROR - num lines greater than expected - file: %s
\n
"
,
fName
);
abort
();
}
token
=
strtok_r
(
line
,
";"
,
&
temp
);
int
ncols
=
0
;
while
(
token
!=
NULL
)
{
if
(
ncols
>
NUM_BLER_COL
)
{
LOG_E
(
NR_MAC
,
"BLER FILE ERROR - num of cols greater than expected
\n
"
);
abort
();
}
nr_bler_data
[
i
].
bler_table
[
nlines
][
ncols
]
=
strtof
(
token
,
NULL
);
ncols
++
;
token
=
strtok_r
(
NULL
,
";"
,
&
temp
);
}
nlines
++
;
}
nr_bler_data
[
i
].
length
=
nlines
;
fclose
(
pFile
);
}
}
openair2/NR_UE_PHY_INTERFACE/NR_Packet_Drop.h
View file @
2ff12533
...
...
@@ -77,5 +77,6 @@ float get_bler_val(uint8_t mcs, int sinr);
bool
should_drop_transport_block
(
int
slot
,
uint16_t
rnti
);
bool
is_channel_modeling
(
void
);
int
get_mcs_from_sinr
(
nr_bler_struct
*
nr_bler_data
,
float
sinr
);
void
init_nr_bler_table
(
const
char
*
env_string
);
#endif
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