Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openairinterface-6g
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
OpenXG
openairinterface-6g
Commits
3f27ae26
Commit
3f27ae26
authored
Oct 23, 2025
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C code cleaning, no change
parent
db09f50a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
51 deletions
+49
-51
openair1/PHY/NR_TRANSPORT/nr_prs.c
openair1/PHY/NR_TRANSPORT/nr_prs.c
+1
-1
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+1
-1
openair1/SCHED_NR/fapi_nr_l1.h
openair1/SCHED_NR/fapi_nr_l1.h
+0
-9
openair1/SCHED_NR/phy_frame_config_nr.c
openair1/SCHED_NR/phy_frame_config_nr.c
+1
-1
openair1/SCHED_NR/phy_frame_config_nr.h
openair1/SCHED_NR/phy_frame_config_nr.h
+1
-1
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+45
-38
No files found.
openair1/PHY/NR_TRANSPORT/nr_prs.c
View file @
3f27ae26
...
...
@@ -13,7 +13,7 @@ int nr_generate_prs(int slot,
int16_t
amp
,
prs_config_t
*
prs_cfg
,
nfapi_nr_config_request_scf_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
const
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
k_prime
=
0
,
k
=
0
,
idx
;
...
...
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
View file @
3f27ae26
...
...
@@ -45,7 +45,7 @@ int nr_generate_prs(int slot,
int16_t
amp
,
prs_config_t
*
prs_cfg
,
nfapi_nr_config_request_scf_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
const
NR_DL_FRAME_PARMS
*
frame_parms
);
/*!
\fn int nr_generate_pss
...
...
openair1/SCHED_NR/fapi_nr_l1.h
View file @
3f27ae26
...
...
@@ -53,15 +53,6 @@ void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
nfapi_nr_dl_tti_pdsch_pdu
*
pdsch_pdu
,
uint8_t
*
sdu
);
void
nr_fill_indication
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot_rx
,
int
UE_id
,
uint8_t
harq_pid
,
uint8_t
crc_flag
,
int
dtx_flag
,
nfapi_nr_crc_t
*
crc
,
nfapi_nr_rx_data_pdu_t
*
pdu
);
//added
void
handle_nfapi_nr_ul_dci_pdu
(
PHY_VARS_gNB
*
gNB
,
...
...
openair1/SCHED_NR/phy_frame_config_nr.c
View file @
3f27ae26
...
...
@@ -152,7 +152,7 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
}
}
int
nr_slot_select
(
nfapi_nr_config_request_scf_t
*
cfg
,
int
nr_frame
,
int
nr_slot
)
int
nr_slot_select
(
const
nfapi_nr_config_request_scf_t
*
cfg
,
int
nr_frame
,
int
nr_slot
)
{
(
void
)
nr_frame
;
...
...
openair1/SCHED_NR/phy_frame_config_nr.h
View file @
3f27ae26
...
...
@@ -53,7 +53,7 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
* @param nr_slot : slot number
@returns int : downlink, uplink or mixed slot type*/
int
nr_slot_select
(
nfapi_nr_config_request_scf_t
*
cfg
,
int
nr_frame
,
int
nr_slot
);
int
nr_slot_select
(
const
nfapi_nr_config_request_scf_t
*
cfg
,
int
nr_frame
,
int
nr_slot
);
void
do_tdd_config_sim
(
PHY_VARS_gNB
*
gNB
,
int
mu
);
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
3f27ae26
...
...
@@ -45,6 +45,15 @@
//#define DEBUG_RXDATA
//#define SRS_IND_DEBUG
static
void
nr_fill_indication
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot_rx
,
int
UE_id
,
uint8_t
harq_pid
,
uint8_t
crc_flag
,
int
dtx_flag
,
nfapi_nr_crc_t
*
crc
,
nfapi_nr_rx_data_pdu_t
*
pdu
);
int
beam_index_allocation
(
bool
das
,
int
fapi_beam_index
,
...
...
@@ -186,10 +195,10 @@ void nr_common_signal_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_n
void
clear_slot_beamid
(
PHY_VARS_gNB
*
gNB
,
int
slot
)
{
LOG_D
(
PHY
,
"Clearing beam_id structure for slot %d
\n
"
,
slot
);
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
int
slot_sz
=
gNB
->
frame_parms
.
symbols_per_slot
;
for
(
int
i
=
0
;
i
<
gNB
->
common_vars
.
num_beams_period
;
i
++
)
{
if
(
gNB
->
common_vars
.
beam_id
)
memset
(
&
gNB
->
common_vars
.
beam_id
[
i
][
slot
*
fp
->
symbols_per_slot
],
-
1
,
fp
->
symbols_per_slot
*
sizeof
(
int
));
memset
(
&
gNB
->
common_vars
.
beam_id
[
i
][
slot
*
slot_sz
],
-
1
,
slot_sz
*
sizeof
(
**
gNB
->
common_vars
.
beam_id
));
}
}
...
...
@@ -199,11 +208,9 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
int
do_meas
)
{
PHY_VARS_gNB
*
gNB
=
msgTx
->
gNB
;
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
const
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
nfapi_nr_config_request_scf_t
*
cfg
=
&
gNB
->
gNB_config
;
int
slot_prs
=
0
;
int
txdataF_offset
=
slot
*
fp
->
samples_per_slot_wCP
;
prs_config_t
*
prs_config
=
NULL
;
const
int
txdataF_offset
=
slot
*
fp
->
samples_per_slot_wCP
;
if
((
cfg
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
&&
(
nr_slot_select
(
cfg
,
frame
,
slot
)
==
NR_UPLINK_SLOT
))
return
;
...
...
@@ -213,19 +220,19 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
// clear the transmit data array and beam index for the current slot
for
(
int
i
=
0
;
i
<
gNB
->
common_vars
.
num_beams_period
;
i
++
)
{
for
(
int
aa
=
0
;
aa
<
cfg
->
carrier_config
.
num_tx_ant
.
value
;
aa
++
)
{
memset
(
&
gNB
->
common_vars
.
txdataF
[
i
][
aa
][
txdataF_offset
],
0
,
fp
->
samples_per_slot_wCP
*
sizeof
(
int32_t
));
memset
(
&
gNB
->
common_vars
.
txdataF
[
i
][
aa
][
txdataF_offset
],
0
,
fp
->
samples_per_slot_wCP
*
sizeof
(
***
gNB
->
common_vars
.
txdataF
));
}
}
// Check for PRS slot - section 7.4.1.7.4 in 3GPP rel16 38.211
for
(
int
rsc_id
=
0
;
rsc_id
<
gNB
->
prs_vars
.
NumPRSResources
;
rsc_id
++
)
{
prs_config
=
&
gNB
->
prs_vars
.
prs_cfg
[
rsc_id
];
prs_config
_t
*
prs_config
=
&
gNB
->
prs_vars
.
prs_cfg
[
rsc_id
];
for
(
int
i
=
0
;
i
<
prs_config
->
PRSResourceRepetition
;
i
++
)
{
if
(
(((
frame
*
fp
->
slots_per_frame
+
slot
)
-
(
prs_config
->
PRSResourceSetPeriod
[
1
]
+
prs_config
->
PRSResourceOffset
)
+
prs_config
->
PRSResourceSetPeriod
[
0
])
%
prs_config
->
PRSResourceSetPeriod
[
0
])
==
i
*
prs_config
->
PRSResourceTimeGap
)
{
slot_prs
=
(
slot
-
i
*
prs_config
->
PRSResourceTimeGap
+
fp
->
slots_per_frame
)
%
fp
->
slots_per_frame
;
int
slot_prs
=
(
slot
-
i
*
prs_config
->
PRSResourceTimeGap
+
fp
->
slots_per_frame
)
%
fp
->
slots_per_frame
;
LOG_D
(
PHY
,
"gNB_TX: frame %d, slot %d, slot_prs %d, PRS Resource ID %d
\n
"
,
frame
,
slot
,
slot_prs
,
rsc_id
);
nr_generate_prs
(
slot_prs
,
&
gNB
->
common_vars
.
txdataF
[
0
][
0
][
txdataF_offset
],
AMP
,
prs_config
,
cfg
,
fp
);
}
...
...
@@ -537,24 +544,24 @@ static int nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, boo
return
ret_nr_ulsch_decoding
;
}
void
nr_fill_indication
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot_rx
,
int
ULSCH_id
,
uint8_t
harq_pid
,
uint8_t
crc_flag
,
int
dtx_flag
,
nfapi_nr_crc_t
*
crc
,
nfapi_nr_rx_data_pdu_t
*
pdu
)
static
void
nr_fill_indication
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot_rx
,
int
ULSCH_id
,
uint8_t
harq_pid
,
uint8_t
crc_flag
,
int
dtx_flag
,
nfapi_nr_crc_t
*
crc
,
nfapi_nr_rx_data_pdu_t
*
pdu
)
{
NR_
gNB_ULSCH_t
*
ulsch
=
&
gNB
->
ulsch
[
ULSCH_id
]
;
NR_
UL_gNB_HARQ_t
*
harq_process
=
ulsch
->
harq_process
;
NR_gNB_P
HY_STATS_t
*
stats
=
get_phy_stats
(
gNB
,
ulsch
->
rnti
)
;
NR_
UL_gNB_HARQ_t
*
harq_process
=
gNB
->
ulsch
[
ULSCH_id
].
harq_process
;
NR_
gNB_PHY_STATS_t
*
stats
=
get_phy_stats
(
gNB
,
gNB
->
ulsch
[
ULSCH_id
].
rnti
)
;
NR_gNB_P
USCH
*
pusch
=
&
gNB
->
pusch_vars
[
ULSCH_id
]
;
nfapi_nr_pusch_pdu_t
*
pusch_pdu
=
&
harq_process
->
ulsch_pdu
;
// Get estimated timing advance for MAC
int
sync_pos
=
ulsch
->
delay
.
est_delay
;
const
int
sync_pos
=
gNB
->
ulsch
[
ULSCH_id
].
delay
.
est_delay
;
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
uint16_t
bw_scaling
=
16
*
gNB
->
frame_parms
.
ofdm_symbol_size
/
2048
;
...
...
@@ -584,16 +591,15 @@ void nr_fill_indication(PHY_VARS_gNB *gNB,
timing_advance_update
);
// estimate UL_CQI for MAC
int
SNRtimes10
=
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
].
ulsch_power_tot
)
-
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
].
ulsch_noise_power_tot
);
int
SNRtimes10
=
dB_fixed_x10
(
pusch
->
ulsch_power_tot
)
-
dB_fixed_x10
(
pusch
->
ulsch_noise_power_tot
);
LOG_D
(
PHY
,
"%d.%d: Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f) delay %d
\n
"
,
frame
,
slot_rx
,
SNRtimes10
/
10
.
0
,
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
].
ulsch_power_tot
)
/
10
.
0
,
dB_fixed_x10
(
gNB
->
pusch_vars
[
ULSCH_id
].
ulsch_noise_power_tot
)
/
10
.
0
,
dB_fixed_x10
(
pusch
->
ulsch_power_tot
)
/
10
.
0
,
dB_fixed_x10
(
pusch
->
ulsch_noise_power_tot
)
/
10
.
0
,
sync_pos
);
int
cqi
;
...
...
@@ -609,8 +615,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB,
crc
->
ul_cqi
=
cqi
;
crc
->
timing_advance
=
timing_advance_update
;
// in terms of dBFS range -128 to 0 with 0.1 step
crc
->
rssi
=
(
dtx_flag
==
0
)
?
1280
-
(
10
*
dB_fixed
(
32767
*
32767
)
-
dB_fixed_times10
(
gNB
->
pusch_vars
[
ULSCH_id
].
ulsch_power
[
0
]))
:
0
;
crc
->
rssi
=
(
dtx_flag
==
0
)
?
1280
-
(
10
*
dB_fixed
(
32767
*
32767
)
-
dB_fixed_times10
(
pusch
->
ulsch_power
[
0
]))
:
0
;
pdu
->
handle
=
pusch_pdu
->
handle
;
pdu
->
rnti
=
pusch_pdu
->
rnti
;
...
...
@@ -704,21 +709,23 @@ static void fill_ul_rb_mask(PHY_VARS_gNB *gNB,
}
}
int
fill_srs_reported_symbol
(
nfapi_nr_srs_reported_symbol_t
*
reported_symbol
,
const
nfapi_nr_srs_pdu_t
*
srs_pdu
,
const
int
N_RB_UL
,
const
int16_t
*
snr_per_rb
,
const
int
srs_est
)
{
static
int
fill_srs_reported_symbol
(
nfapi_nr_srs_reported_symbol_t
*
reported_symbol
,
const
nfapi_nr_srs_pdu_t
*
srs_pdu
,
const
int
N_RB_UL
,
const
int16_t
*
snr_per_rb
,
const
int
srs_est
)
{
reported_symbol
->
num_prgs
=
srs_pdu
->
beamforming
.
num_prgs
;
for
(
int
prg_idx
=
0
;
prg_idx
<
reported_symbol
->
num_prgs
;
prg_idx
++
)
{
if
(
srs_est
<
0
)
{
reported_symbol
->
prg_list
[
prg_idx
].
rb_snr
=
0xFF
;
uint8_t
*
snr
=
&
reported_symbol
->
prg_list
[
prg_idx
].
rb_snr
;
if
(
srs_est
<
0
)
{
*
snr
=
0xFF
;
}
else
if
(
snr_per_rb
[
prg_idx
]
<
-
64
)
{
reported_symbol
->
prg_list
[
prg_idx
].
rb_
snr
=
0
;
*
snr
=
0
;
}
else
if
(
snr_per_rb
[
prg_idx
]
>
63
)
{
reported_symbol
->
prg_list
[
prg_idx
].
rb_
snr
=
0xFE
;
*
snr
=
0xFE
;
}
else
{
reported_symbol
->
prg_list
[
prg_idx
].
rb_
snr
=
(
snr_per_rb
[
prg_idx
]
+
64
)
<<
1
;
*
snr
=
(
snr_per_rb
[
prg_idx
]
+
64
)
<<
1
;
}
}
...
...
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