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
8a10d1b2
Commit
8a10d1b2
authored
Mar 17, 2023
by
laurent
Committed by
Robert Schmidt
Apr 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add phy layer variable and persited arrays
parent
9509bdfd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
131 additions
and
34 deletions
+131
-34
common/platform_constants.h
common/platform_constants.h
+1
-1
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+32
-16
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+6
-2
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+18
-7
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+67
-0
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+4
-5
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+2
-2
openair1/SIMULATION/LTE_PHY/ulsim.c
openair1/SIMULATION/LTE_PHY/ulsim.c
+1
-1
No files found.
common/platform_constants.h
View file @
8a10d1b2
...
...
@@ -81,7 +81,7 @@
#define RLC_TX_MAXSIZE 10000000
#define RLC_RX_MAXSIZE 10000000
#define SEND_MRW_ON 240
#define MAX_ANT 8
// CBA constant
#define NUM_MAX_CBA_GROUP 4
...
...
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
8a10d1b2
...
...
@@ -146,7 +146,17 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
PHY_MEASUREMENTS_gNB
*
measurements
=
&
gNB
->
measurements
;
int
rb
,
nb_symb
[
275
]
=
{
0
};
memset
(
measurements
->
n0_subband_power
,
0
,
sizeof
(
measurements
->
n0_subband_power
));
allocCast2D
(
n0_subband_power
,
unsigned
int
,
gNB
->
measurements
.
n0_subband_power
,
frame_parms
->
nb_antennas_rx
,
frame_parms
->
N_RB_UL
);
clearArray
(
gNB
->
measurements
.
n0_subband_power
,
unsigned
int
);
allocCast2D
(
n0_subband_power_dB
,
unsigned
int
,
gNB
->
measurements
.
n0_subband_power_dB
,
frame_parms
->
nb_antennas_rx
,
frame_parms
->
N_RB_UL
);
for
(
int
s
=
first_symb
;
s
<
(
first_symb
+
num_symb
);
s
++
)
{
int
offset0
=
((
slot
&
3
)
*
frame_parms
->
symbols_per_slot
+
s
)
*
frame_parms
->
ofdm_symbol_size
;
...
...
@@ -166,7 +176,7 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
}
else
{
signal_energy
=
signal_energy_nodc
(
ul_ch
,
12
);
}
measurements
->
n0_subband_power
[
aarx
][
rb
]
+=
signal_energy
;
n0_subband_power
[
aarx
][
rb
]
+=
signal_energy
;
LOG_D
(
PHY
,
"slot %d symbol %d RB %d aarx %d n0_subband_power %d
\n
"
,
slot
,
s
,
rb
,
aarx
,
signal_energy
);
}
//antenna
}
...
...
@@ -182,10 +192,10 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
int32_t
n0_subband_tot_perPRB
=
0
;
if
(
nb_symb
[
rb
]
>
0
)
{
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
measurements
->
n0_subband_power
[
aarx
][
rb
]
/=
nb_symb
[
rb
];
measurements
->
n0_subband_power_dB
[
aarx
][
rb
]
=
dB_fixed
(
measurements
->
n0_subband_power
[
aarx
][
rb
]);
n0_subband_tot_perPRB
+=
measurements
->
n0_subband_power
[
aarx
][
rb
];
n0_subband_tot_perANT
[
aarx
]
+=
measurements
->
n0_subband_power
[
aarx
][
rb
];
n0_subband_power
[
aarx
][
rb
]
/=
nb_symb
[
rb
];
n0_subband_power_dB
[
aarx
][
rb
]
=
dB_fixed
(
n0_subband_power
[
aarx
][
rb
]);
n0_subband_tot_perPRB
+=
n0_subband_power
[
aarx
][
rb
];
n0_subband_tot_perANT
[
aarx
]
+=
n0_subband_power
[
aarx
][
rb
];
}
n0_subband_tot_perPRB
/=
frame_parms
->
nb_antennas_rx
;
measurements
->
n0_subband_power_tot_dB
[
rb
]
=
dB_fixed
(
n0_subband_tot_perPRB
);
...
...
@@ -223,25 +233,31 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB,
PHY_MEASUREMENTS_gNB
*
meas
=
&
gNB
->
measurements
;
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
int
ch_offset
=
fp
->
ofdm_symbol_size
*
symbol
;
int
N_RB_UL
=
ulsch
->
harq_process
->
ulsch_pdu
.
rb_size
;
ulsch_measurements_gNB
*
ulsch_measurements
=
&
ulsch
->
ulsch_measurements
;
int
rx_power
[
fp
->
nb_antennas_rx
];
int
N_RB_UL
=
gNB
->
ulsch
->
harq_processes
->
ulsch_pdu
.
rb_size
;
int
rx_power
[
NUMBER_OF_NR_ULSCH_MAX
][
fp
->
nb_antennas_rx
];
rx_power_tot
[
ulsch_id
]
=
0
;
allocCast3D
(
rx_spatial_power
,
int
,
meas
->
rx_spatial_power
,
NUMBER_OF_NR_ULSCH_MAX
,
nrOfLayers
,
fp
->
nb_antennas_rx
);
allocCast3D
(
rx_spatial_power_dB
,
unsigned
short
,
meas
->
rx_spatial_power_dB
,
NUMBER_OF_NR_ULSCH_MAX
,
nrOfLayers
,
fp
->
nb_antennas_rx
);
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
){
rx_power
[
aarx
]
=
0
;
for
(
int
aatx
=
0
;
aatx
<
nrOfLayers
;
aatx
++
){
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
(
signal_energy_nodc
(
&
pusch_vars
->
ul_ch_estimates
[
aatx
*
fp
->
nb_antennas_rx
+
aarx
][
ch_offset
],
rx_spatial_power
[
ulsch_id
]
[
aatx
][
aarx
]
=
(
signal_energy_nodc
(
&
gNB
->
pusch_vars
[
ulsch_id
]
->
ul_ch_estimates
[
aatx
*
fp
->
nb_antennas_rx
+
aarx
][
ch_offset
],
N_RB_UL
*
NR_NB_SC_PER_RB
));
if
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
<
0
)
{
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
0
;
if
(
rx_spatial_power
[
ulsch_id
]
[
aatx
][
aarx
]
<
0
)
{
rx_spatial_power
[
ulsch_id
]
[
aatx
][
aarx
]
=
0
;
}
ulsch_measurements
->
rx_spatial_power_dB
[
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]);
rx_power
[
aarx
]
+=
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
];
rx_spatial_power_dB
[
ulsch_id
][
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
rx_spatial_power
[
ulsch_id
][
aatx
][
aarx
]);
rx_power
[
ulsch_id
][
aarx
]
+=
rx_spatial_power
[
ulsch_id
][
aatx
][
aarx
];
}
LOG_D
(
PHY
,
"[RNTI %04x] RX power in antenna %d = %d
\n
"
,
ulsch
->
rnti
,
aarx
,
rx_power
[
aarx
]);
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
View file @
8a10d1b2
...
...
@@ -1905,7 +1905,11 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
}
nr_gnb_measurements
(
gNB
,
ulsch
,
pusch_vars
,
symbol
,
rel15_ul
->
nrOfLayers
);
allocCast2D
(
n0_subband_power
,
unsigned
int
,
gNB
->
measurements
.
n0_subband_power
,
frame_parms
->
nb_antennas_rx
,
frame_parms
->
N_RB_UL
);
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
if
(
symbol
==
rel15_ul
->
start_symbol_index
)
{
pusch_vars
->
ulsch_power
[
aarx
]
=
0
;
...
...
@@ -1918,7 +1922,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
}
for
(
int
rb
=
0
;
rb
<
rel15_ul
->
rb_size
;
rb
++
)
{
pusch_vars
->
ulsch_noise_power
[
aarx
]
+=
gNB
->
measurements
.
n0_subband_power
[
aarx
][
rel15_ul
->
bwp_start
+
rel15_ul
->
rb_start
+
rb
]
/
rel15_ul
->
rb_size
;
n0_subband_power
[
aarx
][
rel15_ul
->
bwp_start
+
rel15_ul
->
rb_start
+
rb
]
/
rel15_ul
->
rb_size
;
}
LOG_D
(
PHY
,
"aa %d, bwp_start%d, rb_start %d, rb_size %d: ulsch_power %d, ulsch_noise_power %d
\n
"
,
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
View file @
8a10d1b2
...
...
@@ -88,6 +88,19 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ue
->
measurements
.
nb_antennas_rx
=
frame_parms
->
nb_antennas_rx
;
allocCast3D
(
rx_spatial_power
,
int
,
ue
->
measurements
.
rx_spatial_power
,
NUMBER_OF_CONNECTED_gNB_MAX
,
frame_parms
->
nb_antennas_rx
,
frame_parms
->
nb_antenna_ports_gNB
);
allocCast3D
(
rx_spatial_power_dB
,
unsigned
short
,
ue
->
measurements
.
rx_spatial_power_dB
,
NUMBER_OF_CONNECTED_gNB_MAX
,
frame_parms
->
nb_antennas_rx
,
frame_parms
->
nb_antenna_ports_gNB
);
// signal measurements
for
(
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
;
gNB_id
++
){
...
...
@@ -98,15 +111,13 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ue
->
measurements
.
rx_power
[
gNB_id
][
aarx
]
=
0
;
for
(
aatx
=
0
;
aatx
<
frame_parms
->
nb_antenna_ports_gNB
;
aatx
++
){
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]
=
(
signal_energy_nodc
(
&
dl_ch_estimates
[
gNB_id
][
ch_offset
],
N_RB_DL
*
NR_NB_SC_PER_RB
));
ue
->
measurements
.
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]
=
(
signal_energy_nodc
(
&
dl_ch_estimates
[
gNB_id
][
ch_offset
],
N_RB_DL
*
NR_NB_SC_PER_RB
));
if
(
ue
->
measurements
.
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]
<
0
)
ue
->
measurements
.
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]
=
0
;
ue
->
measurements
.
rx_spatial_power_dB
[
gNB_id
][
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
ue
->
measurements
.
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]);
ue
->
measurements
.
rx_power
[
gNB_id
][
aarx
]
+=
ue
->
measurements
.
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
];
if
(
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]
<
0
)
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]
=
0
;
rx_spatial_power_dB
[
gNB_id
][
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
]);
ue
->
measurements
.
rx_power
[
gNB_id
][
aarx
]
+=
rx_spatial_power
[
gNB_id
][
aatx
][
aarx
];
}
ue
->
measurements
.
rx_power_dB
[
gNB_id
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
ue
->
measurements
.
rx_power
[
gNB_id
][
aarx
]);
...
...
openair1/PHY/TOOLS/tools_defs.h
View file @
8a10d1b2
...
...
@@ -34,6 +34,7 @@
#include <assert.h>
#include "PHY/sse_intrin.h"
#include "common/utils/assertions.h"
#include "common/utils/utils.h"
#if defined(__x86_64__) || defined(__i386__)
#define simd_q15_t __m128i
...
...
@@ -94,6 +95,72 @@ extern "C" {
int64_t
i
;
}
c64_t
;
typedef
struct
{
int
dim1
;
int
dim2
;
int
dim3
;
int
dim4
;
}
fourDimArray_t
;
static
inline
fourDimArray_t
*
allocateFourDimArray
(
int
elmtSz
,
int
dim1
,
int
dim2
,
int
dim3
,
int
dim4
)
{
int
sz
=
elmtSz
;
DevAssert
(
dim1
>
0
);
sz
*=
dim1
;
if
(
dim2
)
{
sz
*=
dim2
;
if
(
dim3
)
{
sz
*=
dim3
;
if
(
dim4
)
sz
*=
dim4
;
}
}
fourDimArray_t
*
tmp
=
(
fourDimArray_t
*
)
malloc16
(
sizeof
(
*
tmp
)
+
sz
);
AssertFatal
(
tmp
,
"no more memory
\n
"
);
*
tmp
=
(
fourDimArray_t
){
dim1
,
dim2
,
dim3
,
dim4
};
return
tmp
;
}
#define CheckArrAllocated(workingVar, elementType, ArraY, diM1, diM2, diM3, diM4) \
if (!(ArraY)) \
ArraY = allocateFourDimArray(sizeof(elementType), diM1, diM2, diM3, diM4); \
else { \
DevAssert((diM1) == (ArraY)->dim1 && (diM2) == (ArraY)->dim2 && (diM3) == (ArraY)->dim3 && (diM4) == (ArraY)->dim4); \
}
#define cast1Darray(workingVar, elementType, ArraY) elementType *workingVar = (elementType *)((ArraY) + 1);
#define allocCast1D(workingVar, elementType, ArraY, dim1) \
CheckArrAllocated(workingVar, elementType, ArraY, dim1, 0, 0, 0); \
cast1Darray(workingVar, elementType, ArraY);
#define cast2Darray(workingVar, elementType, ArraY) \
elementType(*workingVar)[(ArraY)->dim2] = (elementType(*)[(ArraY)->dim2])((ArraY) + 1);
#define allocCast2D(workingVar, elementType, ArraY, dim1, dim2) \
CheckArrAllocated(workingVar, elementType, ArraY, dim1, dim2, 0, 0); \
cast2Darray(workingVar, elementType, ArraY);
#define cast3Darray(workingVar, elementType, ArraY) \
elementType(*workingVar)[(ArraY)->dim2][(ArraY)->dim3] = (elementType(*)[(ArraY)->dim2][(ArraY)->dim3])((ArraY) + 1);
#define allocCast3D(workingVar, elementType, ArraY, dim1, dim2, dim3) \
CheckArrAllocated(workingVar, elementType, ArraY, dim1, dim2, dim3, 0); \
cast3Darray(workingVar, elementType, ArraY);
#define cast4Darray(workingVar, elementType, ArraY) \
elementType(*workingVar)[(ArraY)->dim2][(ArraY)->dim3][(ArraY)->dim4] = \
(elementType(*)[(ArraY)->dim2][(ArraY)->dim3][(ArraY)->dim4])((ArraY) + 1);
#define allocCast4D(workingVar, elementType, ArraY, dim1, dim2, dim3, dim4) \
CheckArrAllocated(workingVar, elementType, ArraY, dim1, dim2, dim3, dim4); \
cast4Darray(workingVar, elementType, ArraY);
#define clearArray(ArraY, elementType) \
memset((ArraY) + 1, \
0, \
sizeof(elementType) * (ArraY)->dim1 * max((ArraY)->dim2, 1) * max((ArraY)->dim3, 1) * max((ArraY)->dim4, 1))
#define squaredMod(a) ((a).r*(a).r + (a).i*(a).i)
#define csum(res, i1, i2) (res).r = (i1).r + (i2).r ; (res).i = (i1).i + (i2).i
...
...
openair1/PHY/defs_gNB.h
View file @
8a10d1b2
...
...
@@ -103,8 +103,8 @@ typedef struct {
int
total_bytes_rx
;
int
current_Qm
;
int
current_RI
;
int
power
[
NB_ANTENNAS_RX
];
int
noise_power
[
NB_ANTENNAS_RX
];
int
power
[
MAX_ANT
];
int
noise_power
[
MAX_ANT
];
int
DTX
;
int
sync_pos
;
}
NR_gNB_SCH_STATS_t
;
...
...
@@ -546,9 +546,9 @@ typedef struct {
//! estimated avg noise power (dB)
unsigned
int
n0_power_tot_dB
;
//! estimated avg noise power per RB per RX ant (lin)
unsigned
int
n0_subband_power
[
NB_ANTENNAS_RX
][
275
]
;
fourDimArray_t
*
n0_subband_power
;
//! estimated avg noise power per RB per RX ant (dB)
unsigned
int
n0_subband_power_dB
[
NB_ANTENNAS_RX
][
275
]
;
fourDimArray_t
*
n0_subband_power_dB
;
//! estimated avg subband noise power (dB)
unsigned
int
n0_subband_power_avg_dB
;
//! estimated avg subband noise power per antenna (dB)
...
...
@@ -557,7 +557,6 @@ typedef struct {
int
n0_subband_power_tot_dB
[
275
];
//! estimated avg noise power per RB (dBm)
int
n0_subband_power_tot_dBm
[
275
];
/// PRACH background noise level
int
prach_I0
;
...
...
openair1/PHY/defs_nr_UE.h
View file @
8a10d1b2
...
...
@@ -151,9 +151,9 @@ typedef struct {
// UE measurements
//! estimated received spatial signal power (linear)
int
rx_spatial_power
[
NUMBER_OF_CONNECTED_gNB_MAX
][
2
][
2
]
;
fourDimArray_t
*
rx_spatial_power
;
//! estimated received spatial signal power (dB)
unsigned
short
rx_spatial_power_dB
[
NUMBER_OF_CONNECTED_gNB_MAX
][
2
][
2
]
;
fourDimArray_t
*
rx_spatial_power_dB
;
/// estimated received signal power (sum over all TX antennas)
int
rx_power
[
NUMBER_OF_CONNECTED_gNB_MAX
][
NB_ANTENNAS_RX
];
...
...
openair1/SIMULATION/LTE_PHY/ulsim.c
View file @
8a10d1b2
...
...
@@ -806,7 +806,7 @@ int main(int argc, char **argv) {
if
(
cqi_flag
==
1
)
coded_bits_per_codeword
-=
UE
->
ulsch
[
0
]
->
O
;
rate
=
(
double
)
TBStable
[
get_I_TBS
(
mcs
)][
nb_rb
-
1
]
/
(
coded_bits_per_codeword
);
rate
=
(
double
)
dlsch_tbs25
[
get_I_TBS
(
mcs
)][
nb_rb
-
1
]
/
(
coded_bits_per_codeword
);
printf
(
"Rate = %f (mod %d), coded bits %u
\n
"
,
rate
,
get_Qm_ul
(
mcs
),
coded_bits_per_codeword
);
for
(
ch_realization
=
0
;
ch_realization
<
n_ch_rlz
;
ch_realization
++
)
{
...
...
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