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
lizhongxiao
OpenXG-RAN
Commits
6e936198
Commit
6e936198
authored
Feb 17, 2023
by
Robert Schmidt
Committed by
francescomani
Mar 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review comments
parent
77974857
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
94 deletions
+90
-94
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+6
-10
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+10
-9
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+9
-9
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+7
-7
openair1/PHY/NR_TRANSPORT/pucch_rx.c
openair1/PHY/NR_TRANSPORT/pucch_rx.c
+3
-4
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+27
-30
openair1/SCHED_NR/fapi_nr_l1.c
openair1/SCHED_NR/fapi_nr_l1.c
+0
-1
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+28
-24
No files found.
openair1/PHY/INIT/nr_init.c
View file @
6e936198
...
...
@@ -93,9 +93,9 @@ NR_gNB_PHY_STATS_t *get_phy_stats(PHY_VARS_gNB *gNB, uint16_t rnti)
stats
=
&
gNB
->
phy_stats
[
first_free
];
stats
->
active
=
true
;
stats
->
rnti
=
rnti
;
memset
(
(
void
*
)
&
stats
->
dlsch_stats
,
0
,
sizeof
(
stats
->
dlsch_stats
));
memset
(
(
void
*
)
&
stats
->
ulsch_stats
,
0
,
sizeof
(
stats
->
ulsch_stats
));
memset
(
(
void
*
)
&
stats
->
uci_stats
,
0
,
sizeof
(
stats
->
uci_stats
));
memset
(
&
stats
->
dlsch_stats
,
0
,
sizeof
(
stats
->
dlsch_stats
));
memset
(
&
stats
->
ulsch_stats
,
0
,
sizeof
(
stats
->
ulsch_stats
));
memset
(
&
stats
->
uci_stats
,
0
,
sizeof
(
stats
->
uci_stats
));
return
(
stats
);
}
...
...
@@ -1016,10 +1016,10 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg)
uint16_t
grid_size
=
cfg
->
carrier_config
.
dl_grid_size
[
fp
->
numerology_index
].
value
;
msg
->
num_pdsch_slot
=
0
;
msg
->
dlsch
=
(
NR_gNB_DLSCH_t
***
)
malloc16
(
gNB
->
max_nb_pdsch
*
sizeof
(
NR_gNB_DLSCH_t
**
));
msg
->
dlsch
=
malloc16
(
gNB
->
max_nb_pdsch
*
sizeof
(
NR_gNB_DLSCH_t
**
));
int
num_cw
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pdsch
;
i
++
)
{
LOG_
I
(
PHY
,
"Allocating Transport Channel Buffers for DLSCH %d/%d
\n
"
,
i
,
gNB
->
max_nb_pdsch
);
LOG_
D
(
PHY
,
"Allocating Transport Channel Buffers for DLSCH %d/%d
\n
"
,
i
,
gNB
->
max_nb_pdsch
);
msg
->
dlsch
[
i
]
=
(
NR_gNB_DLSCH_t
**
)
malloc16
(
num_cw
*
sizeof
(
NR_gNB_DLSCH_t
*
));
for
(
int
j
=
0
;
j
<
num_cw
;
j
++
)
{
msg
->
dlsch
[
i
][
j
]
=
new_gNB_dlsch
(
fp
,
grid_size
);
...
...
@@ -1079,8 +1079,6 @@ void init_nr_transport(PHY_VARS_gNB *gNB)
gNB
->
max_nb_pusch
=
buffer_ul_slots
?
MAX_MOBILES_PER_GNB
*
buffer_ul_slots
:
1
;
gNB
->
max_nb_srs
=
buffer_ul_slots
<<
1
;
// assuming at most 2 SRS per slot
gNB
->
measurements
.
ulsch_measurements
=
(
ULSCH_MEASUREMENTS_gNB
*
)
malloc16
(
gNB
->
max_nb_pusch
*
sizeof
(
ULSCH_MEASUREMENTS_gNB
));
gNB
->
pucch
=
(
NR_gNB_PUCCH_t
**
)
malloc16
(
gNB
->
max_nb_pucch
*
sizeof
(
NR_gNB_PUCCH_t
*
));
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pucch
;
i
++
)
{
LOG_D
(
PHY
,
"Allocating Transport Channel Buffers for PUCCH %d/%d
\n
"
,
i
,
gNB
->
max_nb_pucch
);
...
...
@@ -1097,7 +1095,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB)
gNB
->
ulsch
=
(
NR_gNB_ULSCH_t
**
)
malloc16
(
gNB
->
max_nb_pusch
*
sizeof
(
NR_gNB_ULSCH_t
*
));
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pusch
;
i
++
)
{
LOG_
I
(
PHY
,
"Allocating Transport Channel Buffers for ULSCH
%d/%d
\n
"
,
i
,
gNB
->
max_nb_pusch
);
LOG_
D
(
PHY
,
"Allocating Transport Channel Buffers for ULSCH
%d/%d
\n
"
,
i
,
gNB
->
max_nb_pusch
);
gNB
->
ulsch
[
i
]
=
new_gNB_ulsch
(
gNB
->
max_ldpc_iterations
,
fp
->
N_RB_UL
);
if
(
!
gNB
->
ulsch
[
i
])
{
LOG_E
(
PHY
,
"Can't get gNB ulsch structures
\n
"
);
...
...
@@ -1125,6 +1123,4 @@ void reset_nr_transport(PHY_VARS_gNB *gNB)
for
(
int
i
=
0
;
i
<
gNB
->
max_nb_pusch
;
i
++
)
free_gNB_ulsch
(
&
gNB
->
ulsch
[
i
],
fp
->
N_RB_UL
);
free
(
gNB
->
ulsch
);
free
(
gNB
->
measurements
.
ulsch_measurements
);
}
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
6e936198
...
...
@@ -221,6 +221,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
int
ch_offset
=
fp
->
ofdm_symbol_size
*
symbol
;
int
N_RB_UL
=
gNB
->
ulsch
[
ulsch_id
]
->
harq_process
->
ulsch_pdu
.
rb_size
;
ulsch_measurements_gNB
*
ulsch_measurements
=
&
gNB
->
ulsch
[
ulsch_id
]
->
ulsch_measurements
;
int
rx_power
[
fp
->
nb_antennas_rx
];
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
){
...
...
@@ -229,14 +230,14 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
for
(
int
aatx
=
0
;
aatx
<
nrOfLayers
;
aatx
++
){
meas
->
ulsch_measurements
[
ulsch_id
].
rx_spatial_power
[
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
));
ulsch_measurements
->
rx_spatial_power
[
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
(
meas
->
ulsch_measurements
[
ulsch_id
].
rx_spatial_power
[
aatx
][
aarx
]
<
0
)
{
meas
->
ulsch_measurements
[
ulsch_id
].
rx_spatial_power
[
aatx
][
aarx
]
=
0
;
if
(
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
<
0
)
{
ulsch_measurements
->
rx_spatial_power
[
aatx
][
aarx
]
=
0
;
}
meas
->
ulsch_measurements
[
ulsch_id
].
rx_spatial_power_dB
[
aatx
][
aarx
]
=
(
unsigned
short
)
dB_fixed
(
meas
->
ulsch_measurements
[
ulsch_id
].
rx_spatial_power
[
aatx
][
aarx
]);
rx_power
[
aarx
]
+=
meas
->
ulsch_measurements
[
ulsch_id
].
rx_spatial_power
[
aatx
][
aarx
];
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
];
}
LOG_D
(
PHY
,
"[ULSCH ID %d] RX power in antenna %d = %d
\n
"
,
ulsch_id
,
aarx
,
rx_power
[
aarx
]);
...
...
@@ -248,15 +249,15 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
rx_power_tot_dB
=
(
unsigned
short
)
dB_fixed
(
rx_power_tot
);
rx_power_avg_dB
=
rx_power_tot_dB
;
meas
->
ulsch_measurements
[
ulsch_id
].
wideband_cqi_tot
=
dB_fixed2
(
rx_power_tot
,
meas
->
n0_power_tot
);
meas
->
ulsch_measurements
[
ulsch_id
].
rx_rssi_dBm
=
rx_power_avg_dB
+
30
-
10
*
log10
(
pow
(
2
,
30
))
-
(
rx_gain
-
rx_gain_offset
)
-
dB_fixed
(
fp
->
ofdm_symbol_size
);
ulsch_measurements
->
wideband_cqi_tot
=
dB_fixed2
(
rx_power_tot
,
meas
->
n0_power_tot
);
ulsch_measurements
->
rx_rssi_dBm
=
rx_power_avg_dB
+
30
-
10
*
log10
(
pow
(
2
,
30
))
-
(
rx_gain
-
rx_gain_offset
)
-
dB_fixed
(
fp
->
ofdm_symbol_size
);
LOG_D
(
PHY
,
"[ULSCH %d] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d
\n
"
,
ulsch_id
,
meas
->
ulsch_measurements
[
ulsch_id
].
rx_rssi_dBm
,
ulsch_measurements
->
rx_rssi_dBm
,
rx_power_avg_dB
,
N_RB_UL
,
meas
->
ulsch_measurements
[
ulsch_id
].
wideband_cqi_tot
,
ulsch_measurements
->
wideband_cqi_tot
,
meas
->
n0_power_tot
,
rx_power_tot
);
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
View file @
6e936198
...
...
@@ -85,7 +85,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
else
harq
->
round
++
;
memcpy
(
(
void
*
)
&
ulsch
->
harq_process
->
ulsch_pdu
,
(
void
*
)
ulsch_pdu
,
sizeof
(
nfapi_nr_pusch_pdu_t
));
memcpy
(
&
ulsch
->
harq_process
->
ulsch_pdu
,
ulsch_pdu
,
sizeof
(
ulsch
->
harq_process
->
ulsch_pdu
));
LOG_D
(
PHY
,
"Initializing nFAPI for ULSCH, UE %d, harq_pid %d
\n
"
,
ulsch_id
,
harq_pid
);
}
...
...
@@ -141,15 +141,15 @@ void dump_pusch_stats(FILE *fd, PHY_VARS_gNB *gNB)
aa
,
stats
->
ulsch_stats
.
power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
power
[
aa
]
%
10
,
aa
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
/
10
,
stats
->
ulsch_stats
.
noise_power
[
aa
]
%
10
);
int
*
rt
=
stats
->
ulsch_stats
.
round_trials
;
fprintf
(
fd
,
" round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d
\n
"
,
stats
->
ulsch_stats
.
round_trials
[
0
],
(
double
)
stats
->
ulsch_stats
.
round_trials
[
1
]
/
stats
->
ulsch_stats
.
round_trials
[
0
],
stats
->
ulsch_stats
.
round_trials
[
1
],
(
double
)
stats
->
ulsch_stats
.
round_trials
[
2
]
/
stats
->
ulsch_stats
.
round_trials
[
0
],
stats
->
ulsch_stats
.
round_trials
[
2
],
(
double
)
stats
->
ulsch_stats
.
round_trials
[
3
]
/
stats
->
ulsch_stats
.
round_trials
[
0
],
stats
->
ulsch_stats
.
round_trials
[
3
],
rt
[
0
],
(
double
)
rt
[
1
]
/
rt
[
0
],
rt
[
1
],
(
double
)
rt
[
2
]
/
rt
[
0
],
rt
[
2
],
(
double
)
rt
[
3
]
/
rt
[
0
],
rt
[
3
],
stats
->
ulsch_stats
.
DTX
,
stats
->
ulsch_stats
.
current_Qm
,
stats
->
ulsch_stats
.
current_RI
,
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
View file @
6e936198
...
...
@@ -95,19 +95,19 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
}
uint32_t
ulsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
NR_gNB_ULSCH_t
*
ulsch
=
(
NR_gNB_ULSCH_t
*
)
malloc16_clear
(
sizeof
(
NR_gNB_ULSCH_t
));
NR_gNB_ULSCH_t
*
ulsch
=
malloc16_clear
(
sizeof
(
*
ulsch
));
ulsch
->
max_ldpc_iterations
=
max_ldpc_iterations
;
ulsch
->
harq_pid
=
-
1
;
ulsch
->
active
=
false
;
ulsch
->
harq_process
=
(
NR_UL_gNB_HARQ_t
*
)
malloc16_clear
(
sizeof
(
NR_UL_gNB_HARQ_t
));
ulsch
->
harq_process
->
b
=
(
uint8_t
*
)
malloc16_clear
(
ulsch_bytes
);
ulsch
->
harq_process
->
c
=
(
uint8_t
**
)
malloc16_clear
(
a_segments
*
sizeof
(
uint8_t
*
));
ulsch
->
harq_process
->
d
=
(
int16_t
**
)
malloc16_clear
(
a_segments
*
sizeof
(
int16_t
*
));
ulsch
->
harq_process
=
malloc16_clear
(
sizeof
(
ulsch
->
harq_process
));
ulsch
->
harq_process
->
b
=
malloc16_clear
(
ulsch_bytes
);
ulsch
->
harq_process
->
c
=
malloc16_clear
(
a_segments
*
sizeof
(
uint8_t
*
));
ulsch
->
harq_process
->
d
=
malloc16_clear
(
a_segments
*
sizeof
(
int16_t
*
));
for
(
int
r
=
0
;
r
<
a_segments
;
r
++
)
{
ulsch
->
harq_process
->
c
[
r
]
=
(
uint8_t
*
)
malloc16_clear
(
8448
*
sizeof
(
uint8_t
));
ulsch
->
harq_process
->
d
[
r
]
=
(
int16_t
*
)
malloc16_clear
((
68
*
384
)
*
sizeof
(
int16_t
));
ulsch
->
harq_process
->
c
[
r
]
=
malloc16_clear
(
8448
*
sizeof
(
uint8_t
));
ulsch
->
harq_process
->
d
[
r
]
=
malloc16_clear
((
68
*
384
)
*
sizeof
(
int16_t
));
}
return
(
ulsch
);
}
...
...
openair1/PHY/NR_TRANSPORT/pucch_rx.c
View file @
6e936198
...
...
@@ -57,10 +57,9 @@
NR_gNB_PUCCH_t
*
new_gNB_pucch
(
void
)
{
NR_gNB_PUCCH_t
*
pucch
;
pucch
=
(
NR_gNB_PUCCH_t
*
)
malloc16
(
sizeof
(
NR_gNB_PUCCH_t
));
pucch
->
active
=
0
;
return
(
pucch
);
NR_gNB_PUCCH_t
*
pucch
=
malloc16
(
sizeof
(
*
pucch
));
memset
(
pucch
,
0
,
sizeof
(
*
pucch
));
return
pucch
;
}
void
free_gNB_pucch
(
NR_gNB_PUCCH_t
*
pucch
)
...
...
openair1/PHY/defs_gNB.h
View file @
6e936198
...
...
@@ -224,6 +224,32 @@ typedef struct {
//////////////////////////////////////////////////////////////
}
NR_UL_gNB_HARQ_t
;
typedef
struct
{
//! estimated received spatial signal power (linear)
unsigned
int
rx_spatial_power
[
NB_ANTENNAS_TX
][
NB_ANTENNAS_RX
];
//! estimated received spatial signal power (dB)
unsigned
int
rx_spatial_power_dB
[
NB_ANTENNAS_TX
][
NB_ANTENNAS_RX
];
//! estimated rssi (dBm)
int
rx_rssi_dBm
;
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int
rx_correlation
[
2
];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
int
rx_correlation_dB
[
2
];
/// Wideband CQI (= SINR)
int
wideband_cqi
[
MAX_NUM_RU_PER_gNB
];
/// Wideband CQI in dB (= SINR dB)
int
wideband_cqi_dB
[
MAX_NUM_RU_PER_gNB
];
/// Wideband CQI (sum of all RX antennas, in dB)
char
wideband_cqi_tot
;
/// Subband CQI per RX antenna and RB (= SINR)
int
subband_cqi
[
MAX_NUM_RU_PER_gNB
][
275
];
/// Total Subband CQI and RB (= SINR)
int
subband_cqi_tot
[
275
];
/// Subband CQI in dB and RB (= SINR dB)
int
subband_cqi_dB
[
MAX_NUM_RU_PER_gNB
][
275
];
/// Total Subband CQI and RB
int
subband_cqi_tot_dB
[
275
];
}
ulsch_measurements_gNB
;
typedef
struct
{
/// Time shift in number of samples estimated based on DMRS-PUSCH
...
...
@@ -250,6 +276,7 @@ typedef struct {
/// Flag to indicate that the UL configuration has been handled. Used to remove a stale ULSCH when frame wraps around
uint8_t
handled
;
NR_ULSCH_delay_t
delay
;
ulsch_measurements_gNB
ulsch_measurements
;
}
NR_gNB_ULSCH_t
;
typedef
struct
{
...
...
@@ -503,33 +530,6 @@ typedef struct gNB_L1_proc_t_s {
gNB_L1_rxtx_proc_t
L1_proc
,
L1_proc_tx
;
}
gNB_L1_proc_t
;
typedef
struct
{
//! estimated received spatial signal power (linear)
unsigned
int
rx_spatial_power
[
NB_ANTENNAS_TX
][
NB_ANTENNAS_RX
];
//! estimated received spatial signal power (dB)
unsigned
int
rx_spatial_power_dB
[
NB_ANTENNAS_TX
][
NB_ANTENNAS_RX
];
//! estimated rssi (dBm)
int
rx_rssi_dBm
;
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int
rx_correlation
[
2
];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
int
rx_correlation_dB
[
2
];
/// Wideband CQI (= SINR)
int
wideband_cqi
[
MAX_NUM_RU_PER_gNB
];
/// Wideband CQI in dB (= SINR dB)
int
wideband_cqi_dB
[
MAX_NUM_RU_PER_gNB
];
/// Wideband CQI (sum of all RX antennas, in dB)
char
wideband_cqi_tot
;
/// Subband CQI per RX antenna and RB (= SINR)
int
subband_cqi
[
MAX_NUM_RU_PER_gNB
][
275
];
/// Total Subband CQI and RB (= SINR)
int
subband_cqi_tot
[
275
];
/// Subband CQI in dB and RB (= SINR dB)
int
subband_cqi_dB
[
MAX_NUM_RU_PER_gNB
][
275
];
/// Total Subband CQI and RB
int
subband_cqi_tot_dB
[
275
];
}
ULSCH_MEASUREMENTS_gNB
;
typedef
struct
{
// common measurements
//! estimated noise power (linear)
...
...
@@ -553,9 +553,6 @@ typedef struct {
//! estimated avg noise power per RB (dBm)
int
n0_subband_power_tot_dBm
[
275
];
// gNB measurements (per user)
ULSCH_MEASUREMENTS_gNB
*
ulsch_measurements
;
/// PRACH background noise level
int
prach_I0
;
...
...
openair1/SCHED_NR/fapi_nr_l1.c
View file @
6e936198
...
...
@@ -105,7 +105,6 @@ void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
int
frame
,
int
slot
,
nfapi_nr_dl_tti_csi_rs_pdu
*
csirs_pdu
)
{
int
found
=
0
;
for
(
int
id
=
0
;
id
<
NR_SYMBOLS_PER_SLOT
;
id
++
)
{
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
6e936198
...
...
@@ -555,7 +555,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
for
(
int
ULSCH_id
=
0
;
ULSCH_id
<
gNB
->
max_nb_pusch
;
ULSCH_id
++
)
{
NR_gNB_ULSCH_t
*
ulsch
=
gNB
->
ulsch
[
ULSCH_id
];
int
harq_pid
;
NR_UL_gNB_HARQ_t
*
ulsch_harq
=
ulsch
_harq
=
ulsch
->
harq_process
;
NR_UL_gNB_HARQ_t
*
ulsch_harq
=
ulsch
->
harq_process
;
AssertFatal
(
ulsch_harq
!=
NULL
,
"harq_pid %d is not allocated
\n
"
,
harq_pid
);
if
((
ulsch
->
active
==
true
)
&&
(
ulsch_harq
->
frame
==
frame_rx
)
&&
...
...
@@ -794,14 +794,17 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
RU_t
*
ru
=
gNB
->
RU_list
[
0
];
int
slot_offset
=
frame_parms
->
get_samples_slot_timestamp
(
slot_rx
,
frame_parms
,
0
);
slot_offset
-=
ru
->
N_TA_offset
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
0
]
=
(
int16_t
)
ulsch
->
rnti
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
1
]
=
(
int16_t
)
ulsch_harq
->
ulsch_pdu
.
rb_size
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
2
]
=
(
int16_t
)
ulsch_harq
->
ulsch_pdu
.
rb_start
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
3
]
=
(
int16_t
)
ulsch_harq
->
ulsch_pdu
.
nr_of_symbols
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
4
]
=
(
int16_t
)
ulsch_harq
->
ulsch_pdu
.
start_symbol_index
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
5
]
=
(
int16_t
)
ulsch_harq
->
ulsch_pdu
.
mcs_index
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
6
]
=
(
int16_t
)
ulsch_harq
->
ulsch_pdu
.
pusch_data
.
rv_index
;
((
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
])[
7
]
=
(
int16_t
)
ulsch
->
harq_pid
;
int32_t
sample_offset
=
gNB
->
common_vars
.
debugBuff_sample_offset
;
nfapi_nr_pusch_pdu_t
*
pdu
=
&
ulsch_harq
->
ulsch_pdu
;
int16_t
*
buf
=
(
int16_t
*
)
&
gNB
->
common_vars
.
debugBuff
[
offset
];
buf
[
0
]
=
(
int16_t
)
ulsch
->
rnti
;
buf
[
1
]
=
(
int16_t
)
pdu
->
rb_size
;
buf
[
2
]
=
(
int16_t
)
pdu
->
rb_start
;
buf
[
3
]
=
(
int16_t
)
pdu
->
nr_of_symbols
;
buf
[
4
]
=
(
int16_t
)
pdu
->
start_symbol_index
;
buf
[
5
]
=
(
int16_t
)
pdu
->
mcs_index
;
buf
[
6
]
=
(
int16_t
)
pdu
->
pusch_data
.
rv_index
;
buf
[
7
]
=
(
int16_t
)
ulsch
->
harq_pid
;
memcpy
(
&
gNB
->
common_vars
.
debugBuff
[
gNB
->
common_vars
.
debugBuff_sample_offset
+
4
],
&
ru
->
common
.
rxdata
[
0
][
slot_offset
],
frame_parms
->
get_samples_per_slot
(
slot_rx
,
frame_parms
)
*
sizeof
(
int32_t
));
gNB
->
common_vars
.
debugBuff_sample_offset
+=
(
frame_parms
->
get_samples_per_slot
(
slot_rx
,
frame_parms
)
+
1000
+
4
);
if
(
gNB
->
common_vars
.
debugBuff_sample_offset
>
((
frame_parms
->
get_samples_per_slot
(
slot_rx
,
frame_parms
)
+
1000
+
2
)
*
20
))
{
...
...
@@ -818,23 +821,24 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH
,
1
);
start_meas
(
&
gNB
->
rx_pusch_stats
);
nr_rx_pusch
(
gNB
,
ULSCH_id
,
frame_rx
,
slot_rx
,
ulsch
->
harq_pid
);
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power_tot
=
0
;
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power_tot
=
0
;
NR_gNB_PUSCH
*
pusch_vars
=
gNB
->
pusch_vars
[
ULSCH_id
];
pusch_vars
->
ulsch_power_tot
=
0
;
pusch_vars
->
ulsch_noise_power_tot
=
0
;
for
(
int
aarx
=
0
;
aarx
<
gNB
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power
[
aarx
]
/=
num_dmrs
;
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power_tot
+=
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power
[
aarx
];
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power
[
aarx
]
/=
num_dmrs
;
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power_tot
+=
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power
[
aarx
];
pusch_vars
->
ulsch_power
[
aarx
]
/=
num_dmrs
;
pusch_vars
->
ulsch_power_tot
+=
pusch_vars
->
ulsch_power
[
aarx
];
pusch_vars
->
ulsch_noise_power
[
aarx
]
/=
num_dmrs
;
pusch_vars
->
ulsch_noise_power_tot
+=
pusch_vars
->
ulsch_noise_power
[
aarx
];
}
if
(
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power_tot
)
<
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power_tot
)
+
gNB
->
pusch_thres
)
{
if
(
dB_fixed_x10
(
pusch_vars
->
ulsch_power_tot
)
<
dB_fixed_x10
(
pusch_vars
->
ulsch_noise_power_tot
)
+
gNB
->
pusch_thres
)
{
NR_gNB_PHY_STATS_t
*
stats
=
get_phy_stats
(
gNB
,
ulsch
->
rnti
);
LOG_D
(
PHY
,
"PUSCH not detected in %d.%d (%d,%d,%d)
\n
"
,
frame_rx
,
slot_rx
,
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power_tot
),
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power_tot
),
gNB
->
pusch_thres
);
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power_tot
=
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power_tot
;
gNB
->
pusch_vars
[
ULSCH_id
]
->
DTX
=
1
;
dB_fixed_x10
(
pusch_vars
->
ulsch_power_tot
),
dB_fixed_x10
(
pusch_vars
->
ulsch_noise_power_tot
),
gNB
->
pusch_thres
);
pusch_vars
->
ulsch_power_tot
=
pusch_vars
->
ulsch_noise_power_tot
;
pusch_vars
->
DTX
=
1
;
if
(
stats
)
stats
->
ulsch_stats
.
DTX
++
;
if
(
!
get_softmodem_params
()
->
phy_test
)
{
/* in case of phy_test mode, we still want to decode to measure execution time.
...
...
@@ -845,10 +849,10 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
}
}
else
{
LOG_D
(
PHY
,
"PUSCH detected in %d.%d (%d,%d,%d)
\n
"
,
frame_rx
,
slot_rx
,
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_power_tot
),
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
ulsch_noise_power_tot
),
gNB
->
pusch_thres
);
dB_fixed_x10
(
pusch_vars
->
ulsch_power_tot
),
dB_fixed_x10
(
pusch_vars
->
ulsch_noise_power_tot
),
gNB
->
pusch_thres
);
gNB
->
pusch_vars
[
ULSCH_id
]
->
DTX
=
0
;
pusch_vars
->
DTX
=
0
;
}
stop_meas
(
&
gNB
->
rx_pusch_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH
,
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