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
常顺宇
OpenXG-RAN
Commits
67116757
Commit
67116757
authored
Nov 11, 2020
by
Francesco Mani
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/nr_prach_fr2' into NR_FR2_RRC_SSB
parents
ed97e216
d17e075f
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
374 additions
and
188 deletions
+374
-188
cmake_targets/autotests/test_case_list.xml
cmake_targets/autotests/test_case_list.xml
+9
-5
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+12
-5
openair1/PHY/NR_TRANSPORT/nr_prach.c
openair1/PHY/NR_TRANSPORT/nr_prach.c
+146
-122
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
+181
-45
openair1/SIMULATION/NR_PHY/prachsim.c
openair1/SIMULATION/NR_PHY/prachsim.c
+26
-11
No files found.
cmake_targets/autotests/test_case_list.xml
View file @
67116757
...
...
@@ -1302,10 +1302,12 @@
<testCase
id=
"015112"
>
<class>
execution
</class>
<desc>
nr_prachsim Test cases. (Test1: 106 PRBs - Prach format A2),
(Test2: 217 PRBs - Prach format A2),
(Test3: 273 PRBs - Prach format A2),
(Test4: 106 PRBs - Prach format 0)
</desc>
<desc>
nr_prachsim Test cases. (Test1: 30kHz SCS, 106 PRBs, Prach format A2),
(Test2: 30kHz SCS, 217 PRBs, Prach format A2),
(Test3: 30kHz SCS, 273 PRBs, Prach format A2),
(Test4: 30kHz SCS, 106 PRBs, Prach format 0)
(Test5: 120kHz SCS, 32 PRBs, Prach format A2)
(Test5: 120kHz SCS, 66 PRBs, Prach format A2)
</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>
$OPENAIR_DIR/cmake_targets/build_oai
</compile_prog>
<compile_prog_args>
--phy_simulators -c
</compile_prog_args>
...
...
@@ -1315,7 +1317,9 @@
<main_exec_args>
-a -s -30 -n 100 -p 63 -R 106
-a -s -30 -n 100 -p 63 -R 217
-a -s -30 -n 100 -p 63 -R 273
-a -s -30 -n 100 -p 63 -R 106 -c 4
</main_exec_args>
-a -s -30 -n 100 -p 63 -R 106 -c 4
-a -s -30 -n 100 -p 32 -R 32 -m 3 -c52
-a -s -30 -n 100 -p 32 -R 66 -m 3 -c52
</main_exec_args>
<tags>
nr_prachsim.test1 nr_prachsim.test2 nr_prachsim.test3 nr_prachsim.test4
</tags>
<search_expr_true>
PRACH test OK
</search_expr_true>
<search_expr_false>
segmentation fault|assertion|exiting|fatal
</search_expr_false>
...
...
openair1/PHY/INIT/nr_init.c
View file @
67116757
...
...
@@ -433,10 +433,17 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
//gNB_config->subframe_config.dl_cyclic_prefix_type.value = (fp->Ncp == NORMAL) ? NFAPI_CP_NORMAL : NFAPI_CP_EXTENDED;
gNB
->
mac_enabled
=
1
;
if
(
mu
==
1
)
{
fp
->
dl_CarrierFreq
=
3500000000
;
//from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
fp
->
ul_CarrierFreq
=
3500000000
;
//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
fp
->
nr_band
=
78
;
// fp->threequarter_fs= 0;
// fp->threequarter_fs= 0;
}
else
if
(
mu
==
3
)
{
fp
->
dl_CarrierFreq
=
27524520000
;
//from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
fp
->
ul_CarrierFreq
=
27524520000
;
//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
fp
->
nr_band
=
261
;
// fp->threequarter_fs= 0;
}
gNB_config
->
carrier_config
.
dl_bandwidth
.
value
=
config_bandwidth
(
mu
,
N_RB_DL
,
fp
->
nr_band
);
...
...
openair1/PHY/NR_TRANSPORT/nr_prach.c
View file @
67116757
...
...
@@ -185,10 +185,10 @@ void rx_nr_prach_ru(RU_t *ru,
for
(
int
aa
=
0
;
aa
<
ru
->
nb_rx
;
aa
++
){
if
(
prach_sequence_length
==
0
)
slot2
=
(
slot
/
fp
->
slots_per_subframe
)
*
fp
->
slots_per_subframe
;
prach
[
aa
]
=
(
int16_t
*
)
&
ru
->
common
.
rxdata
[
aa
][
(
slot2
*
fp
->
get_samples_per_slot
(
slot
,
fp
)
)
+
sample_offset_slot
-
ru
->
N_TA_offset
];
prach
[
aa
]
=
(
int16_t
*
)
&
ru
->
common
.
rxdata
[
aa
][
fp
->
get_samples_slot_timestamp
(
slot2
,
fp
,
0
)
+
sample_offset_slot
-
ru
->
N_TA_offset
];
}
idft_size_idx_t
dftsize
;
int
dftlen
=
0
;
int
mu
=
fp
->
numerology_index
;
int
Ncp
=
0
;
...
...
@@ -269,7 +269,8 @@ void rx_nr_prach_ru(RU_t *ru,
if
(
LOG_DEBUGFLAG
(
PRACH
))
{
LOG_D
(
PHY
,
"rx_prach: Doing PRACH FFT for nb_rx:%d Ncp:%d
\n
"
,
ru
->
nb_rx
,
Ncp
);
}
AssertFatal
(
mu
==
1
,
"only 30 kHz SCS handled for now
\n
"
);
// Note: Assumes PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below
int
kbar
=
1
;
...
...
@@ -299,6 +300,7 @@ void rx_nr_prach_ru(RU_t *ru,
AssertFatal
(
prach
[
aa
]
!=
NULL
,
"prach[%d] is null
\n
"
,
aa
);
// do DFT
if
(
mu
==
1
)
{
if
(
fp
->
N_RB_UL
<=
100
)
AssertFatal
(
1
==
0
,
"N_RB_UL %d not support for NR PRACH yet
\n
"
,
fp
->
N_RB_UL
);
else
if
(
fp
->
N_RB_UL
<
137
)
{
...
...
@@ -327,12 +329,9 @@ void rx_nr_prach_ru(RU_t *ru,
}
}
// 839 sequence
else
{
if
((
mu
==
0
&&
(
prachStartSymbol
==
0
||
prachStartSymbol
==
7
))
||
(
mu
==
1
&&
prachStartSymbol
==
0
))
prach2
+=
64
;
// 32 samples @ 61.44 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
prachStartSymbol
==
0
)
prach2
+=
64
;
// 32 samples @ 61.44 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
mu
==
0
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
1
)
{
dftlen
=
2048
;
dft
(
DFT_2048
,
prach2
,
rxsigF
[
aa
],
1
);
if
(
prachFormat
!=
9
/*C0*/
)
{
...
...
@@ -354,10 +353,6 @@ void rx_nr_prach_ru(RU_t *ru,
reps
+=
6
;
}
}
else
if
(
mu
==
2
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
3
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
4
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
}
}
else
{
// threequarter sampling
// 40 MHz @ 46.08 Ms/s
prach2
=
prach
[
aa
]
+
(
3
*
Ncp
);
// 46.08 is 1.5 * 30.72, times 2 for I/Q
...
...
@@ -383,11 +378,7 @@ void rx_nr_prach_ru(RU_t *ru,
reps
=
4
;
}
}
else
{
if
((
mu
==
0
&&
(
prachStartSymbol
==
0
||
prachStartSymbol
==
7
))
||
(
mu
==
1
&&
prachStartSymbol
==
0
))
prach2
+=
48
;
// 24 samples @ 46.08 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
mu
==
0
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
1
)
{
if
(
prachStartSymbol
==
0
)
prach2
+=
48
;
// 24 samples @ 46.08 Ms/s in first symbol of each half subframe (15/30 kHz only)
dftlen
=
1536
;
dft
(
DFT_1536
,
prach2
,
rxsigF
[
aa
],
1
);
if
(
prachFormat
!=
9
/*C0*/
)
{
...
...
@@ -409,10 +400,6 @@ void rx_nr_prach_ru(RU_t *ru,
for
(
int
i
=
6
;
i
<
12
;
i
++
)
dft
(
DFT_1536
,
prach2
+
(
3072
*
i
),
rxsigF
[
aa
]
+
(
3072
*
i
),
1
);
reps
+=
6
;
}
}
// mu==1
else
if
(
mu
==
2
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
3
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
4
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
}
// short format
}
// 3/4 sampling
}
// <=50 MHz BW
...
...
@@ -442,12 +429,8 @@ void rx_nr_prach_ru(RU_t *ru,
}
}
else
{
if
((
mu
==
0
&&
(
prachStartSymbol
==
0
||
prachStartSymbol
==
7
))
||
(
mu
==
1
&&
prachStartSymbol
==
0
))
prach2
+=
128
;
// 64 samples @ 122.88 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
prachStartSymbol
==
0
)
prach2
+=
128
;
// 64 samples @ 122.88 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
mu
==
0
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
1
)
{
dftlen
=
4096
;
dft
(
DFT_4096
,
prach2
,
rxsigF
[
aa
],
1
);
if
(
prachFormat
!=
9
/*C0*/
)
{
...
...
@@ -470,10 +453,6 @@ void rx_nr_prach_ru(RU_t *ru,
reps
+=
6
;
}
}
else
if
(
mu
==
2
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
3
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
4
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
}
}
else
{
AssertFatal
(
fp
->
N_RB_UL
<=
217
,
"cannot do more than 217 PRBs with 3/4 sampling
\n
"
);
prach2
=
prach
[
aa
]
+
(
6
*
Ncp
);
...
...
@@ -494,12 +473,8 @@ void rx_nr_prach_ru(RU_t *ru,
reps
=
4
;
}
}
else
{
if
((
mu
==
0
&&
(
prachStartSymbol
==
0
||
prachStartSymbol
==
7
))
||
(
mu
==
1
&&
prachStartSymbol
==
0
))
prach2
+=
96
;
// 64 samples @ 122.88 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
prachStartSymbol
==
0
)
prach2
+=
96
;
// 64 samples @ 122.88 Ms/s in first symbol of each half subframe (15/30 kHz only)
if
(
mu
==
0
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
1
)
{
dftlen
=
3072
;
dft
(
DFT_3072
,
prach2
,
rxsigF
[
aa
],
1
);
if
(
prachFormat
!=
9
/*C0*/
)
{
...
...
@@ -522,12 +497,61 @@ void rx_nr_prach_ru(RU_t *ru,
reps
+=
6
;
}
}
else
if
(
mu
==
2
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
3
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
else
if
(
mu
==
4
)
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
}
}
}
else
if
(
mu
==
3
)
{
if
(
fp
->
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"3/4 sampling not supported for numerology %d
\n
"
,
mu
);
}
if
(
prach_sequence_length
==
0
)
{
AssertFatal
(
1
==
0
,
"long prach not supported for numerology %d
\n
"
,
mu
);
}
if
(
fp
->
N_RB_UL
==
32
)
{
prach2
=
prach
[
aa
]
+
(
Ncp
<<
2
);
// Ncp is for 30.72 Ms/s, so multiply by 2 for I/Q, and 2 for 61.44Msps
if
(
slot
%
(
fp
->
slots_per_subframe
/
2
)
==
0
&&
prachStartSymbol
==
0
)
prach2
+=
64
;
// 32 samples @ 61.44 Ms/s in first symbol of each half subframe
dftlen
=
512
;
dftsize
=
DFT_512
;
}
else
if
(
fp
->
N_RB_UL
==
66
)
{
prach2
=
prach
[
aa
]
+
(
Ncp
<<
3
);
// Ncp is for 30.72 Ms/s, so multiply by 4 for I/Q, and 2 for 122.88Msps
if
(
slot
%
(
fp
->
slots_per_subframe
/
2
)
==
0
&&
prachStartSymbol
==
0
)
prach2
+=
128
;
// 64 samples @ 122.88 Ms/s in first symbol of each half subframe
dftlen
=
1024
;
dftsize
=
DFT_1024
;
}
else
{
AssertFatal
(
1
==
0
,
"N_RB_UL %d not support for numerology %d
\n
"
,
fp
->
N_RB_UL
,
mu
);
}
dft
(
dftsize
,
prach2
,
rxsigF
[
aa
],
1
);
if
(
prachFormat
!=
9
/*C0*/
)
{
dft
(
dftsize
,
prach2
+
dftlen
*
2
,
rxsigF
[
aa
]
+
dftlen
*
2
,
1
);
reps
++
;
}
if
(
prachFormat
==
5
/*A2*/
||
prachFormat
==
6
/*A3*/
||
prachFormat
==
8
/*B4*/
||
prachFormat
==
10
/*C2*/
)
{
dft
(
dftsize
,
prach2
+
dftlen
*
4
,
rxsigF
[
aa
]
+
dftlen
*
4
,
1
);
dft
(
dftsize
,
prach2
+
dftlen
*
6
,
rxsigF
[
aa
]
+
dftlen
*
6
,
1
);
reps
+=
2
;
}
if
(
prachFormat
==
6
/*A3*/
||
prachFormat
==
8
/*B4*/
)
{
dft
(
dftsize
,
prach2
+
dftlen
*
8
,
rxsigF
[
aa
]
+
dftlen
*
8
,
1
);
dft
(
dftsize
,
prach2
+
dftlen
*
10
,
rxsigF
[
aa
]
+
dftlen
*
10
,
1
);
reps
+=
2
;
}
if
(
prachFormat
==
8
/*B4*/
)
{
for
(
int
i
=
6
;
i
<
12
;
i
++
)
dft
(
dftsize
,
prach2
+
(
dftlen
*
2
*
i
),
rxsigF
[
aa
]
+
(
dftlen
*
2
*
i
),
1
);
reps
+=
6
;
}
}
else
{
AssertFatal
(
1
==
0
,
"Numerology not supported
\n
"
);
}
//LOG_M("ru_rxsigF_tmp.m","rxsFtmp", rxsigF[aa], dftlen*2*reps, 1, 1);
//Coherent combining of PRACH repetitions (assumes channel does not change, to be revisted for "long" PRACH)
LOG_D
(
PHY
,
"Doing PRACH combining of %d reptitions N_ZC %d
\n
"
,
reps
,
N_ZC
);
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
View file @
67116757
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/prachsim.c
View file @
67116757
...
...
@@ -153,7 +153,7 @@ int main(int argc, char **argv){
randominit
(
0
);
while
((
c
=
getopt
(
argc
,
argv
,
"hHaA:Cc:r:p:g:n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:E"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"hHaA:Cc:r:p:g:
m:
n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:E"
))
!=
-
1
)
{
switch
(
c
)
{
case
'a'
:
printf
(
"Running AWGN simulation
\n
"
);
...
...
@@ -243,6 +243,10 @@ int main(int argc, char **argv){
threequarter_fs
=
1
;
break
;
case
'm'
:
mu
=
atoi
(
optarg
);
break
;
case
'n'
:
n_frames
=
atoi
(
optarg
);
break
;
...
...
@@ -370,13 +374,6 @@ int main(int argc, char **argv){
}
}
if
(
config_index
<
67
)
{
prach_sequence_length
=
0
;
slot
=
subframe
*
2
;
slot_gNB
=
1
+
(
subframe
*
2
);
}
uint16_t
N_ZC
;
N_ZC
=
prach_sequence_length
==
0
?
839
:
139
;
printf
(
"Config_index %d, prach_sequence_length %d
\n
"
,
config_index
,
prach_sequence_length
);
// Configure log
logInit
();
set_glog
(
loglvl
);
...
...
@@ -416,7 +413,18 @@ int main(int argc, char **argv){
nr_phy_config_request_sim
(
gNB
,
N_RB_UL
,
N_RB_UL
,
mu
,
Nid_cell
,
SSB_positions
);
//nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
absoluteFrequencyPointA
=
to_nrarfcn
(
frame_parms
->
nr_band
,
frame_parms
->
dl_CarrierFreq
,
frame_parms
->
numerology_index
,
frame_parms
->
N_RB_UL
*
(
180e3
)
*
(
1
<<
frame_parms
->
numerology_index
));
subframe
=
slot
/
frame_parms
->
slots_per_subframe
;
if
(
config_index
<
67
&&
mu
==
1
)
{
prach_sequence_length
=
0
;
slot
=
subframe
*
2
;
slot_gNB
=
1
+
(
subframe
*
2
);
}
uint16_t
N_ZC
=
prach_sequence_length
==
0
?
839
:
139
;
printf
(
"Config_index %d, prach_sequence_length %d
\n
"
,
config_index
,
prach_sequence_length
);
printf
(
"FFT Size %d, Extended Prefix %d, Samples per subframe %d, Frame type %s, Frequency Range %s
\n
"
,
NUMBER_OF_OFDM_CARRIERS
,
...
...
@@ -432,7 +440,14 @@ int main(int argc, char **argv){
gNB
->
gNB_config
.
carrier_config
.
num_tx_ant
.
value
=
1
;
gNB
->
gNB_config
.
carrier_config
.
num_rx_ant
.
value
=
1
;
if
(
mu
==
1
)
gNB
->
gNB_config
.
tdd_table
.
tdd_period
.
value
=
6
;
else
if
(
mu
==
3
)
gNB
->
gNB_config
.
tdd_table
.
tdd_period
.
value
=
3
;
else
{
printf
(
"unsupported numerology %d
\n
"
,
mu
);
exit
(
-
1
);
}
gNB
->
gNB_config
.
prach_config
.
num_prach_fd_occasions
.
value
=
num_prach_fd_occasions
;
gNB
->
gNB_config
.
prach_config
.
num_prach_fd_occasions_list
=
(
nfapi_nr_num_prach_fd_occasions_t
*
)
malloc
(
num_prach_fd_occasions
*
sizeof
(
nfapi_nr_num_prach_fd_occasions_t
));
...
...
@@ -752,7 +767,7 @@ int main(int argc, char **argv){
LOG_M
(
"prachF0.m"
,
"prachF0"
,
&
gNB
->
prach_vars
.
prachF
[
0
],
N_ZC
,
1
,
1
);
LOG_M
(
"rxsig0.m"
,
"rxs0"
,
&
gNB
->
common_vars
.
rxdata
[
0
][
subframe
*
frame_parms
->
samples_per_subframe
],
frame_parms
->
samples_per_subframe
,
1
,
1
);
LOG_M
(
"ru_rxsig0.m"
,
"rxs0"
,
&
ru
->
common
.
rxdata
[
0
][
subframe
*
frame_parms
->
samples_per_subframe
],
frame_parms
->
samples_per_subframe
,
1
,
1
);
LOG_M
(
"r
xsigF0.m"
,
"rxsF0"
,
gNB
->
prach_vars
.
rxsigF
[
0
],
N_ZC
,
1
,
1
);
LOG_M
(
"r
u_rxsigF0.m"
,
"rxsF0"
,
ru
->
prach_rxsigF
[
0
]
[
0
],
N_ZC
,
1
,
1
);
LOG_M
(
"prach_preamble.m"
,
"prachp"
,
&
gNB
->
X_u
[
0
],
N_ZC
,
1
,
1
);
LOG_M
(
"ue_prach_preamble.m"
,
"prachp"
,
&
UE
->
X_u
[
0
],
N_ZC
,
1
,
1
);
#endif
...
...
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