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
littleBu
OpenXG-RAN
Commits
1a351296
Commit
1a351296
authored
Feb 04, 2025
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if the slot selected is valid for DL/UL in dlsim/ulsim
parent
92fc1639
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
18 deletions
+36
-18
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+7
-2
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+5
-0
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+19
-16
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+5
-0
No files found.
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
1a351296
...
...
@@ -537,8 +537,7 @@ int main(int argc, char **argv)
break
;
case
'Y'
:
run_initial_sync
=
1
;
//target_error_rate=0.1;
run_initial_sync
=
1
;
slot
=
0
;
break
;
...
...
@@ -552,6 +551,7 @@ int main(int argc, char **argv)
break
;
case
'H'
:
AssertFatal
(
run_initial_sync
==
0
,
"Cannot use Y and H options at the same time
\n
"
);
slot
=
atoi
(
optarg
);
break
;
...
...
@@ -653,6 +653,11 @@ int main(int argc, char **argv)
fill_scc_sim
(
scc
,
&
ssb_bitmap
,
N_RB_DL
,
N_RB_DL
,
mu
,
mu
);
fix_scc
(
scc
,
ssb_bitmap
);
frame_structure_t
frame_structure
=
{
0
};
frame_type_t
frame_type
=
TDD
;
config_frame_structure
(
mu
,
scc
,
get_tdd_period_idx
(
scc
->
tdd_UL_DL_ConfigurationCommon
),
frame_type
,
&
frame_structure
);
AssertFatal
(
is_dl_slot
(
slot
,
&
frame_structure
),
"The slot selected is not DL. Can't run DLSIM
\n
"
);
// TODO do a UECAP for phy-sim
nr_pdsch_AntennaPorts_t
pdsch_AntennaPorts
=
{
0
};
pdsch_AntennaPorts
.
N1
=
n_tx
>
1
?
n_tx
>>
1
:
1
;
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
1a351296
...
...
@@ -626,6 +626,11 @@ int main(int argc, char *argv[])
fill_scc_sim
(
scc
,
&
ssb_bitmap
,
N_RB_DL
,
N_RB_DL
,
mu
,
mu
);
fix_scc
(
scc
,
ssb_bitmap
);
frame_structure_t
frame_structure
=
{
0
};
frame_type_t
frame_type
=
TDD
;
config_frame_structure
(
mu
,
scc
,
get_tdd_period_idx
(
scc
->
tdd_UL_DL_ConfigurationCommon
),
frame_type
,
&
frame_structure
);
AssertFatal
(
is_ul_slot
(
slot
,
&
frame_structure
),
"The slot selected is not UL. Can't run ULSIM
\n
"
);
// TODO do a UECAP for phy-sim
const
nr_mac_config_t
conf
=
{.
pdsch_AntennaPorts
=
{.
N1
=
1
,
.
N2
=
1
,
.
XP
=
1
},
.
pusch_AntennaPorts
=
n_rx
,
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
1a351296
...
...
@@ -500,34 +500,28 @@ int get_ul_slot_offset(const frame_structure_t *fs, int idx, bool count_mixed)
*
* @param mu numerology
* @param scc pointer to scc
* @param cfg pointer to NFAPI config request
* @param tdd_period TDD period
* @param frame_type type of frame structure (FDD or TDD)
* @param fs pointer to the frame structure to update
*
* @return Number of periods in frame
*/
static
int
config_frame_structure
(
int
mu
,
NR_ServingCellConfigCommon_t
*
scc
,
nfapi_nr_config_request_scf_t
*
cfg
,
frame_structure_t
*
fs
)
void
config_frame_structure
(
int
mu
,
NR_ServingCellConfigCommon_t
*
scc
,
uint8_t
tdd_period
,
uint8_t
frame_type
,
frame_structure_t
*
fs
)
{
fs
->
numb_slots_frame
=
nr_slots_per_frame
[
mu
];
if
(
cfg
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
{
cfg
->
tdd_table
.
tdd_period
.
tl
.
tag
=
NFAPI_NR_CONFIG_TDD_PERIOD_TAG
;
cfg
->
num_tlv
++
;
cfg
->
tdd_table
.
tdd_period
.
value
=
get_tdd_period_idx
(
scc
->
tdd_UL_DL_ConfigurationCommon
);
LOG_D
(
NR_MAC
,
"Setting TDD configuration period to %d
\n
"
,
cfg
->
tdd_table
.
tdd_period
.
value
);
fs
->
numb_period_frame
=
get_nb_periods_per_frame
(
cfg
->
tdd_table
.
tdd_period
.
value
);
if
(
frame_type
==
TDD
)
{
fs
->
numb_period_frame
=
get_nb_periods_per_frame
(
tdd_period
);
fs
->
numb_slots_period
=
fs
->
numb_slots_frame
/
fs
->
numb_period_frame
;
fs
->
is_tdd
=
true
;
config_tdd_patterns
(
scc
->
tdd_UL_DL_ConfigurationCommon
,
fs
);
set_tdd_config_nr
(
cfg
,
fs
);
}
else
{
// FDD
fs
->
is_tdd
=
false
;
fs
->
numb_period_frame
=
1
;
fs
->
numb_slots_period
=
nr_slots_per_frame
[
mu
];
}
AssertFatal
(
fs
->
numb_period_frame
>
0
,
"Frame configuration cannot be configured!
\n
"
);
return
fs
->
numb_period_frame
;
}
static
void
config_common
(
gNB_MAC_INST
*
nrmac
,
...
...
@@ -819,7 +813,16 @@ static void config_common(gNB_MAC_INST *nrmac,
// Frame structure configuration
uint8_t
mu
=
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
config_frame_structure
(
mu
,
scc
,
cfg
,
&
nrmac
->
frame_structure
);
if
(
cfg
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
{
cfg
->
tdd_table
.
tdd_period
.
tl
.
tag
=
NFAPI_NR_CONFIG_TDD_PERIOD_TAG
;
cfg
->
num_tlv
++
;
cfg
->
tdd_table
.
tdd_period
.
value
=
get_tdd_period_idx
(
scc
->
tdd_UL_DL_ConfigurationCommon
);
LOG_D
(
NR_MAC
,
"Setting TDD configuration period to %d
\n
"
,
cfg
->
tdd_table
.
tdd_period
.
value
);
}
frame_structure_t
*
fs
=
&
nrmac
->
frame_structure
;
config_frame_structure
(
mu
,
scc
,
cfg
->
tdd_table
.
tdd_period
.
value
,
cfg
->
cell_config
.
frame_duplex_type
.
value
,
fs
);
if
(
cfg
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
set_tdd_config_nr
(
cfg
,
fs
);
int
nb_tx
=
config
->
nb_bfw
[
0
];
// number of tx antennas
int
nb_beams
=
config
->
nb_bfw
[
1
];
// number of beams
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
1a351296
...
...
@@ -39,6 +39,11 @@ void set_cset_offset(uint16_t);
void
get_K1_K2
(
int
N1
,
int
N2
,
int
*
K1
,
int
*
K2
,
int
layers
);
int
get_NTN_Koffset
(
const
NR_ServingCellConfigCommon_t
*
scc
);
void
config_frame_structure
(
int
mu
,
NR_ServingCellConfigCommon_t
*
scc
,
uint8_t
tdd_period
,
uint8_t
frame_type
,
frame_structure_t
*
fs
);
int
get_first_ul_slot
(
const
frame_structure_t
*
fs
,
bool
mixed
);
int
get_ul_slots_per_period
(
const
frame_structure_t
*
fs
);
int
get_ul_slots_per_frame
(
const
frame_structure_t
*
fs
);
...
...
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