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
Michael Black
OpenXG-RAN
Commits
73c7bee0
Commit
73c7bee0
authored
Sep 02, 2020
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added basic analytics for PDSCH measurements
parent
d443d9e9
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
288 additions
and
253 deletions
+288
-253
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+227
-189
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+9
-21
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+7
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+19
-18
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
+2
-0
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+0
-3
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
+0
-1
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+13
-4
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+2
-14
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+4
-1
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+4
-2
openair2/COMMON/platform_constants.h
openair2/COMMON/platform_constants.h
+1
-0
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
73c7bee0
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
View file @
73c7bee0
...
...
@@ -69,27 +69,9 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB,
nfapi_nr_dl_tti_pdsch_pdu
*
pdsch_pdu
,
unsigned
char
*
sdu
);
uint8_t
nr_generate_pdsch
(
NR_gNB_DLSCH_t
*
dlsch
,
uint32_t
***
pdsch_dmrs
,
int32_t
**
txdataF
,
int16_t
amp
,
int
frame
,
uint8_t
slot
,
NR_DL_FRAME_PARMS
*
frame_parms
,
int
xOverhead
,
time_stats_t
*
dlsch_encoding_stats
,
time_stats_t
*
dlsch_scrambling_stats
,
time_stats_t
*
dlsch_modulation_stats
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
,
time_stats_t
*
dlsch_rate_matching_stats
,
time_stats_t
*
dlsch_interleaving_stats
,
time_stats_t
*
dlsch_segmentation_stats
);
uint8_t
nr_generate_pdsch
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
);
void
free_gNB_dlsch
(
NR_gNB_DLSCH_t
**
dlschptr
,
uint16_t
N_RB
);
void
clean_gNB_dlsch
(
NR_gNB_DLSCH_t
*
dlsch
);
...
...
@@ -98,6 +80,8 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
int16_t
find_nr_dlsch
(
uint16_t
rnti
,
PHY_VARS_gNB
*
gNB
,
find_type_t
type
);
NR_gNB_SCH_STATS_t
*
find_nr_dlsch_stats
(
uint16_t
rnti
,
PHY_VARS_gNB
*
gNB
,
find_type_t
type
);
int
nr_dlsch_encoding
(
unsigned
char
*
a
,
int
frame
,
uint8_t
slot
,
NR_gNB_DLSCH_t
*
dlsch
,
...
...
@@ -113,4 +97,8 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
void
nr_emulate_dlsch_payload
(
uint8_t
*
payload
,
uint16_t
size
);
void
dump_pdsch_stats
(
PHY_VARS_gNB
*
gNB
);
void
clear_pdsch_stats
(
PHY_VARS_gNB
*
gNB
);
#endif
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
73c7bee0
...
...
@@ -354,6 +354,13 @@ int nr_dlsch_encoding(unsigned char *a,
A
=
rel15
->
TBSize
[
0
]
<<
3
;
if
(
dlsch
->
harq_processes
[
harq_pid
]
->
round
==
0
){
dlsch
->
stats
.
total_bytes
+=
rel15
->
TBSize
[
0
];
dlsch
->
stats
.
current_RI
=
rel15
->
nrOfLayers
;
dlsch
->
stats
.
current_Qm
=
rel15
->
qamModOrder
[
0
];
}
dlsch
->
stats
.
round_trials
[
dlsch
->
harq_processes
[
harq_pid
]
->
round
]
++
;
G
=
nr_get_G
(
nb_rb
,
nb_symb_sch
,
nb_re_dmrs
,
length_dmrs
,
mod_order
,
rel15
->
nrOfLayers
);
LOG_D
(
PHY
,
"dlsch coding A %d G %d mod_order %d
\n
"
,
A
,
G
,
mod_order
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
View file @
73c7bee0
...
...
@@ -255,27 +255,28 @@ void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) {
}
int16_t
find_nr_dlsch
(
uint16_t
rnti
,
PHY_VARS_gNB
*
gNB
,
find_type_t
type
)
{
uint16_t
i
;
int16_t
first_free_index
=-
1
;
AssertFatal
(
gNB
!=
NULL
,
"gNB is null
\n
"
);
for
(
i
=
0
;
i
<
NUMBER_OF_NR_DLSCH_MAX
;
i
++
)
{
AssertFatal
(
gNB
->
dlsch
[
i
]
!=
NULL
,
"gNB->dlsch[%d] is null
\n
"
,
i
);
AssertFatal
(
gNB
->
dlsch
[
i
][
0
]
!=
NULL
,
"gNB->dlsch[%d][0] is null
\n
"
,
i
);
LOG_D
(
PHY
,
"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d
\n
"
,
rnti
,
i
,
gNB
->
dlsch
[
i
][
0
]
->
harq_mask
,
gNB
->
dlsch
[
i
][
0
]
->
rnti
,
first_free_index
);
if
((
gNB
->
dlsch
[
i
][
0
]
->
harq_mask
>
0
)
&&
(
gNB
->
dlsch
[
i
][
0
]
->
rnti
==
rnti
))
return
i
;
else
if
((
gNB
->
dlsch
[
i
][
0
]
->
harq_mask
==
0
)
&&
(
first_free_index
==-
1
))
first_free_index
=
i
;
}
if
(
type
==
SEARCH_EXIST
)
return
-
1
;
if
(
first_free_index
!=
-
1
)
gNB
->
dlsch
[
first_free_index
][
0
]
->
rnti
=
0
;
return
first_free_index
;
uint16_t
i
;
int16_t
first_free_index
=-
1
;
AssertFatal
(
gNB
!=
NULL
,
"gNB is null
\n
"
);
for
(
i
=
0
;
i
<
NUMBER_OF_NR_DLSCH_MAX
;
i
++
)
{
AssertFatal
(
gNB
->
dlsch
[
i
]
!=
NULL
,
"gNB->dlsch[%d] is null
\n
"
,
i
);
AssertFatal
(
gNB
->
dlsch
[
i
][
0
]
!=
NULL
,
"gNB->dlsch[%d][0] is null
\n
"
,
i
);
LOG_D
(
PHY
,
"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d
\n
"
,
rnti
,
i
,
gNB
->
dlsch
[
i
][
0
]
->
harq_mask
,
gNB
->
dlsch
[
i
][
0
]
->
rnti
,
first_free_index
);
if
((
gNB
->
dlsch
[
i
][
0
]
->
harq_mask
>
0
)
&&
(
gNB
->
dlsch
[
i
][
0
]
->
rnti
==
rnti
))
return
i
;
else
if
((
gNB
->
dlsch
[
i
][
0
]
->
harq_mask
==
0
)
&&
(
first_free_index
==-
1
))
first_free_index
=
i
;
}
if
(
type
==
SEARCH_EXIST
)
return
-
1
;
if
(
first_free_index
!=
-
1
)
gNB
->
dlsch
[
first_free_index
][
0
]
->
rnti
=
0
;
return
first_free_index
;
}
void
nr_fill_dlsch
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch.h
View file @
73c7bee0
...
...
@@ -87,3 +87,5 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
int
UE_id
,
uint8_t
harq_pid
);
int16_t
find_nr_ulsch
(
uint16_t
rnti
,
PHY_VARS_gNB
*
gNB
,
find_type_t
type
);
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
73c7bee0
...
...
@@ -208,8 +208,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
ulsch
->
Mlimit
=
0
;
ulsch
->
max_ldpc_iterations
=
0
;
ulsch
->
last_iteration_cnt
=
0
;
ulsch
->
num_active_cba_groups
=
0
;
for
(
i
=
0
;
i
<
NUM_MAX_CBA_GROUP
;
i
++
)
ulsch
->
cba_rnti
[
i
]
=
0
;
for
(
i
=
0
;
i
<
NR_MAX_SLOTS_PER_FRAME
;
i
++
)
ulsch
->
harq_process_id
[
i
]
=
0
;
for
(
i
=
0
;
i
<
NR_MAX_ULSCH_HARQ_PROCESSES
;
i
++
)
{
...
...
@@ -225,7 +223,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
ulsch
->
harq_processes
[
i
]
->
rar_alloc
=
0
;
ulsch
->
harq_processes
[
i
]
->
status
=
NR_SCH_IDLE
;
ulsch
->
harq_processes
[
i
]
->
subframe_scheduling_flag
=
0
;
ulsch
->
harq_processes
[
i
]
->
subframe_cba_scheduling_flag
=
0
;
ulsch
->
harq_processes
[
i
]
->
phich_active
=
0
;
ulsch
->
harq_processes
[
i
]
->
phich_ACK
=
0
;
ulsch
->
harq_processes
[
i
]
->
previous_first_rb
=
0
;
...
...
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
View file @
73c7bee0
...
...
@@ -270,7 +270,6 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
if
(
k
>=
fp
->
ofdm_symbol_size
)
k
-=
fp
->
ofdm_symbol_size
;
for
(
int
i
=
0
;
i
<
LENGTH_PSS_NR
;
i
++
)
{
synchroF_tmp
[
2
*
k
]
=
primary_synchro
[
2
*
i
];
synchroF_tmp
[
2
*
k
+
1
]
=
primary_synchro
[
2
*
i
+
1
];
...
...
openair1/PHY/defs_gNB.h
View file @
73c7bee0
...
...
@@ -124,6 +124,13 @@ typedef struct {
nfapi_nr_ul_dci_request_pdus_t
pdcch_pdu
;
}
NR_gNB_UL_PDCCH_t
;
typedef
struct
{
int
round_trials
[
8
];
int
total_bytes
;
int
current_Qm
;
int
current_RI
;
}
NR_gNB_SCH_STATS_t
;
typedef
struct
{
/// Pointers to 16 HARQ processes for the DLSCH
NR_DL_gNB_HARQ_t
*
harq_processes
[
NR_MAX_NB_HARQ_PROCESSES
];
...
...
@@ -167,8 +174,12 @@ typedef struct {
int16_t
sqrt_rho_a
;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t
sqrt_rho_b
;
/// statistics for measurement collection
NR_gNB_SCH_STATS_t
stats
;
}
NR_gNB_DLSCH_t
;
typedef
struct
{
int
frame
;
int
slot
;
...
...
@@ -345,10 +356,8 @@ typedef struct {
uint8_t
max_ldpc_iterations
;
/// number of iterations used in last LDPC decoding
uint8_t
last_iteration_cnt
;
/// num active cba group
uint8_t
num_active_cba_groups
;
/// num active cba group
uint16_t
cba_rnti
[
NUM_MAX_CBA_GROUP
];
/// statistics for measurement collection
NR_gNB_SCH_STATS_t
stats
;
}
NR_gNB_ULSCH_t
;
typedef
struct
{
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
73c7bee0
...
...
@@ -194,20 +194,8 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
for
(
int
i
=
0
;
i
<
gNB
->
num_pdsch_rnti
[
slot
];
i
++
)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH
,
1
);
LOG_D
(
PHY
,
"PDSCH generation started (%d) in frame %d.%d
\n
"
,
gNB
->
num_pdsch_rnti
[
slot
],
frame
,
slot
);
nr_generate_pdsch
(
gNB
->
dlsch
[
i
][
0
],
gNB
->
nr_gold_pdsch_dmrs
[
slot
],
gNB
->
common_vars
.
txdataF
,
AMP
,
frame
,
slot
,
fp
,
0
,
&
gNB
->
dlsch_encoding_stats
,
&
gNB
->
dlsch_scrambling_stats
,
&
gNB
->
dlsch_modulation_stats
,
&
gNB
->
tinput
,
&
gNB
->
tprep
,
&
gNB
->
tparity
,
&
gNB
->
toutput
,
&
gNB
->
dlsch_rate_matching_stats
,
&
gNB
->
dlsch_interleaving_stats
,
&
gNB
->
dlsch_segmentation_stats
);
nr_generate_pdsch
(
gNB
,
frame
,
slot
);
if
((
frame
&
127
)
==
0
)
dump_pdsch_stats
(
gNB
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH
,
0
);
}
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
73c7bee0
...
...
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
//unsigned char frame_type = 0;
int
frame
=
0
,
slot
=
1
;
int
frame
=
1
,
slot
=
1
;
int
frame_length_complex_samples
;
int
frame_length_complex_samples_no_prefix
;
NR_DL_FRAME_PARMS
*
frame_parms
;
...
...
@@ -716,6 +716,8 @@ int main(int argc, char **argv)
reset_meas
(
&
gNB
->
tparity
);
reset_meas
(
&
gNB
->
toutput
);
clear_pdsch_stats
(
gNB
);
n_errors
=
0
;
effRate
=
0
;
//n_errors2 = 0;
...
...
@@ -956,6 +958,7 @@ int main(int argc, char **argv)
(
float
)
n_errors
/
(
float
)
n_trials
);
printf
(
"*****************************************
\n
"
);
printf
(
"
\n
"
);
dump_pdsch_stats
(
gNB
);
printf
(
"SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %d bits/slot
\n
"
,
SNR
,
n_errors
,
n_trials
,
roundStats
[
snrRun
],(
double
)
errors_scrambling
/
available_bits
/
n_trials
,
effRate
,
effRate
/
TBS
*
100
,
TBS
);
printf
(
"
\n
"
);
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
73c7bee0
...
...
@@ -55,7 +55,7 @@
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair1/NR_REFSIG/pss_nr.h"
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
#include "SIMULATION/LTE_PHY/common_sim.h"
...
...
@@ -707,6 +707,7 @@ int main(int argc, char **argv)
crc_status
=
1
;
errors_decoding
=
0
;
memset
((
void
*
)
roundStats
,
0
,
50
*
sizeof
(
roundStats
[
0
]));
while
(
round
<
max_rounds
&&
crc_status
)
{
round_trials
[
round
]
++
;
ulsch_ue
[
0
]
->
harq_processes
[
harq_pid
]
->
round
=
round
;
...
...
@@ -1028,7 +1029,8 @@ int main(int argc, char **argv)
printf
(
"*****************************************
\n
"
);
printf
(
"SNR %f: n_errors (%d/%d,%d/%d,%d/%d,%d/%d) (negative CRC), false_positive %d/%d, errors_scrambling (%u/%u,%u/%u,%u/%u,%u/%u
\n
"
,
SNR
,
n_errors
[
0
],
round_trials
[
0
],
n_errors
[
1
],
round_trials
[
1
],
n_errors
[
2
],
round_trials
[
2
],
n_errors
[
3
],
round_trials
[
3
],
n_false_positive
,
n_trials
,
errors_scrambling
[
0
],
available_bits
*
n_trials
,
errors_scrambling
[
1
],
available_bits
*
n_trials
,
errors_scrambling
[
2
],
available_bits
*
n_trials
,
errors_scrambling
[
3
],
available_bits
*
n_trials
);
printf
(
"
\n
"
);
printf
(
"SNR %f: Channel BLER (%e,%e,%e,%e), Channel BER (%e,%e,%e,%e) Avg round %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %d bits/slot
\n
"
,
SNR
,
printf
(
"SNR %f: Channel BLER (%e,%e,%e,%e), Channel BER (%e,%e,%e,%e) Avg round %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %d bits/slot
\n
"
,
SNR
,
(
double
)
n_errors
[
0
]
/
round_trials
[
0
],
(
double
)
n_errors
[
1
]
/
round_trials
[
0
],
(
double
)
n_errors
[
2
]
/
round_trials
[
0
],
...
...
openair2/COMMON/platform_constants.h
View file @
73c7bee0
...
...
@@ -101,6 +101,7 @@
#define NUMBER_OF_NR_DLSCH_MAX 2//16
#define NUMBER_OF_NR_ULSCH_MAX 2//16
#define NUMBER_OF_NR_SCH_STATS_MAX 16
#define NUMBER_OF_NR_PUCCH_MAX 16
#define NUMBER_OF_NR_SR_MAX 16
#define NUMBER_OF_NR_PDCCH_MAX 16
...
...
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