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
Michael Black
OpenXG-RAN
Commits
3e6e9f44
Commit
3e6e9f44
authored
Apr 09, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-develop-segvs' into integration_2022_wk15
parents
91516669
8623bc66
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
280 additions
and
254 deletions
+280
-254
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+20
-18
openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
+0
-2
openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
+23
-22
openair1/PHY/MODULATION/slot_fep.c
openair1/PHY/MODULATION/slot_fep.c
+1
-1
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+37
-40
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
+3
-0
openair1/PHY/TOOLS/oai_dfts.c
openair1/PHY/TOOLS/oai_dfts.c
+58
-33
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+135
-138
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+3
-0
No files found.
openair1/PHY/INIT/nr_init_ue.c
View file @
3e6e9f44
...
@@ -313,11 +313,26 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
...
@@ -313,11 +313,26 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
}
// DLSCH
// DLSCH
for
(
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
;
gNB_id
++
)
{
for
(
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
+
1
;
gNB_id
++
)
{
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
=
(
NR_UE_PDSCH
*
)
malloc16_clear
(
sizeof
(
NR_UE_PDSCH
));
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
=
(
NR_UE_PDSCH
*
)
malloc16_clear
(
sizeof
(
NR_UE_PDSCH
));
}
}
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
phy_init_nr_ue_PDSCH
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
],
fp
);
}
int
nb_codewords
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
i
=
0
;
i
<
nb_codewords
;
i
++
)
{
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
llr
[
i
]
=
(
int16_t
*
)
malloc16_clear
(
(
8
*
(
3
*
8
*
8448
))
*
sizeof
(
int16_t
)
);
//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
}
for
(
i
=
0
;
i
<
NR_MAX_NB_LAYERS
;
i
++
)
{
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
layer_llr
[
i
]
=
(
int16_t
*
)
malloc16_clear
(
(
8
*
(
3
*
8
*
8448
))
*
sizeof
(
int16_t
)
);
//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
}
}
}
for
(
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
;
gNB_id
++
)
{
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
ue
->
pdcch_vars
[
th_id
][
gNB_id
]
=
(
NR_UE_PDCCH
*
)
malloc16_clear
(
sizeof
(
NR_UE_PDCCH
));
ue
->
pdcch_vars
[
th_id
][
gNB_id
]
=
(
NR_UE_PDCCH
*
)
malloc16_clear
(
sizeof
(
NR_UE_PDCCH
));
}
}
...
@@ -344,21 +359,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
...
@@ -344,21 +359,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
ue
->
nr_srs_info
->
srs_estimated_channel_time_shifted
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
MAX_NUM_NR_SRS_SYMBOLS
*
sizeof
(
int32_t
));
ue
->
nr_srs_info
->
srs_estimated_channel_time_shifted
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
MAX_NUM_NR_SRS_SYMBOLS
*
sizeof
(
int32_t
));
}
}
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
phy_init_nr_ue_PDSCH
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
],
fp
);
}
int
nb_codewords
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
i
=
0
;
i
<
nb_codewords
;
i
++
)
{
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
llr
[
i
]
=
(
int16_t
*
)
malloc16_clear
(
(
8
*
(
3
*
8
*
8448
))
*
sizeof
(
int16_t
)
);
//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
}
for
(
i
=
0
;
i
<
NR_MAX_NB_LAYERS
;
i
++
)
{
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
layer_llr
[
i
]
=
(
int16_t
*
)
malloc16_clear
(
(
8
*
(
3
*
8
*
8448
))
*
sizeof
(
int16_t
)
);
//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
}
}
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
ue
->
pdcch_vars
[
th_id
][
gNB_id
]
->
llr
=
(
int16_t
*
)
malloc16_clear
(
2
*
4
*
100
*
12
*
sizeof
(
uint16_t
)
);
ue
->
pdcch_vars
[
th_id
][
gNB_id
]
->
llr
=
(
int16_t
*
)
malloc16_clear
(
2
*
4
*
100
*
12
*
sizeof
(
uint16_t
)
);
...
@@ -471,16 +471,18 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
...
@@ -471,16 +471,18 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
}
free_and_zero
(
ue
->
nr_gold_pdsch
[
0
]);
free_and_zero
(
ue
->
nr_gold_pdsch
[
0
]);
for
(
int
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
;
gNB_id
++
)
{
for
(
int
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
+
1
;
gNB_id
++
)
{
// PDSCH
// PDSCH
for
(
int
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
int
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
free_and_zero
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
llr_shifts
);
free_and_zero
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
llr_shifts
);
free_and_zero
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
llr128_2ndstream
);
free_and_zero
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
]
->
llr128_2ndstream
);
phy_term_nr_ue__PDSCH
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
],
fp
);
phy_term_nr_ue__PDSCH
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
],
fp
);
free_and_zero
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
]);
free_and_zero
(
ue
->
pdsch_vars
[
th_id
][
gNB_id
]);
}
}
}
for
(
int
gNB_id
=
0
;
gNB_id
<
ue
->
n_connected_gNB
;
gNB_id
++
)
{
for
(
int
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
int
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
for
(
int
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
for
(
int
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
...
...
openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
View file @
3e6e9f44
...
@@ -155,8 +155,6 @@ typedef struct {
...
@@ -155,8 +155,6 @@ typedef struct {
uint8_t
h
[
MAX_NUM_CHANNEL_BITS
];
uint8_t
h
[
MAX_NUM_CHANNEL_BITS
];
/// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
/// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
uint8_t
b_tilde
[
MAX_NUM_CHANNEL_BITS
];
uint8_t
b_tilde
[
MAX_NUM_CHANNEL_BITS
];
/// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
int32_t
d
[
MAX_NUM_RE
];
/// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15)
/// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15)
int32_t
z
[
MAX_NUM_RE
];
int32_t
z
[
MAX_NUM_RE
];
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
...
...
openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
View file @
3e6e9f44
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
//#define DEBUG_ULSCH_MODULATION
//#define DEBUG_ULSCH_MODULATION
void
dft_lte
(
int32_t
*
z
,
int32_t
*
d
,
int32_t
Msc_PUSCH
,
uint8_t
Nsymb
)
void
dft_lte
(
int32_t
*
z
,
struct
complex16
*
input
,
int32_t
Msc_PUSCH
,
uint8_t
Nsymb
)
{
{
#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(__i386__)
...
@@ -66,7 +66,7 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
...
@@ -66,7 +66,7 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
#endif
#endif
// printf("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH);
// printf("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH);
d0
=
(
uint32_t
*
)
d
;
d0
=
(
uint32_t
*
)
input
;
d1
=
d0
+
Msc_PUSCH
;
d1
=
d0
+
Msc_PUSCH
;
d2
=
d1
+
Msc_PUSCH
;
d2
=
d1
+
Msc_PUSCH
;
d3
=
d2
+
Msc_PUSCH
;
d3
=
d2
+
Msc_PUSCH
;
...
@@ -476,7 +476,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -476,7 +476,8 @@ void ulsch_modulation(int32_t **txdataF,
// Modulation
// Modulation
ulsch_Msymb
=
G
/
Q_m
;
ulsch_Msymb
=
G
/
Q_m
;
/// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
struct
complex16
d
[
MAX_NUM_RE
]
__attribute__
((
aligned
(
32
)));
if
(
ulsch
->
cooperation_flag
==
2
)
if
(
ulsch
->
cooperation_flag
==
2
)
// For Distributed Alamouti Scheme in Collabrative Communication
// For Distributed Alamouti Scheme in Collabrative Communication
{
{
...
@@ -488,14 +489,14 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -488,14 +489,14 @@ void ulsch_modulation(int32_t **txdataF,
//UE1, -x1*
//UE1, -x1*
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
0
]
=
(
ulsch
->
b_tilde
[
j
]
==
1
)
?
(
gain_lin_QPSK
)
:
-
gain_lin_QPSK
;
d
[
i
].
r
=
(
ulsch
->
b_tilde
[
j
]
==
1
)
?
(
gain_lin_QPSK
)
:
-
gain_lin_QPSK
;
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
1
]
=
(
ulsch
->
b_tilde
[
j
+
1
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
d
[
i
].
i
=
(
ulsch
->
b_tilde
[
j
+
1
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
// if (i<Msc_PUSCH)
// if (i<Msc_PUSCH)
// printf("input %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
// printf("input %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
// UE1, x0*
// UE1, x0*
((
int16_t
*
)
&
ulsch
->
d
[
i
+
1
])[
0
]
=
(
ulsch
->
b_tilde
[
j
-
2
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
d
[
i
+
1
].
r
=
(
ulsch
->
b_tilde
[
j
-
2
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
((
int16_t
*
)
&
ulsch
->
d
[
i
+
1
])[
1
]
=
(
ulsch
->
b_tilde
[
j
-
1
]
==
1
)
?
(
gain_lin_QPSK
)
:
-
gain_lin_QPSK
;
d
[
i
+
1
].
i
=
(
ulsch
->
b_tilde
[
j
-
1
]
==
1
)
?
(
gain_lin_QPSK
)
:
-
gain_lin_QPSK
;
break
;
break
;
...
@@ -521,8 +522,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -521,8 +522,8 @@ void ulsch_modulation(int32_t **txdataF,
qam16_table_offset_im
+=
1
;
qam16_table_offset_im
+=
1
;
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
0
]
=-
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_re
])
>>
15
);
d
[
i
].
r
=-
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_re
])
>>
15
);
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
1
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_im
])
>>
15
);
d
[
i
].
i
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_im
])
>>
15
);
//UE1,x0*
//UE1,x0*
qam16_table_offset_re
=
0
;
qam16_table_offset_re
=
0
;
...
@@ -544,8 +545,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -544,8 +545,8 @@ void ulsch_modulation(int32_t **txdataF,
// ((int16_t*)&ulsch->d[i+1])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
// ((int16_t*)&ulsch->d[i+1])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
// ((int16_t*)&ulsch->d[i+1])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
// ((int16_t*)&ulsch->d[i+1])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
((
int16_t
*
)
&
ulsch
->
d
[
i
+
1
])[
0
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_re
])
>>
15
);
d
[
i
+
1
].
r
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_re
])
>>
15
);
((
int16_t
*
)
&
ulsch
->
d
[
i
+
1
])[
1
]
=-
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_im
])
>>
15
);
d
[
i
+
1
].
i
=-
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_im
])
>>
15
);
break
;
break
;
...
@@ -578,8 +579,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -578,8 +579,8 @@ void ulsch_modulation(int32_t **txdataF,
qam64_table_offset_im
+=
1
;
qam64_table_offset_im
+=
1
;
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
0
]
=-
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_re
])
>>
15
);
d
[
i
].
r
=-
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_re
])
>>
15
);
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
1
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_im
])
>>
15
);
d
[
i
].
i
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_im
])
>>
15
);
//UE1,x0*
//UE1,x0*
qam64_table_offset_re
=
0
;
qam64_table_offset_re
=
0
;
...
@@ -605,8 +606,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -605,8 +606,8 @@ void ulsch_modulation(int32_t **txdataF,
qam64_table_offset_im
+=
1
;
qam64_table_offset_im
+=
1
;
((
int16_t
*
)
&
ulsch
->
d
[
i
+
1
])[
0
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_re
])
>>
15
);
d
[
i
+
1
].
r
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_re
])
>>
15
);
((
int16_t
*
)
&
ulsch
->
d
[
i
+
1
])[
1
]
=-
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_im
])
>>
15
);
d
[
i
+
1
].
i
=-
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_im
])
>>
15
);
break
;
break
;
...
@@ -621,8 +622,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -621,8 +622,8 @@ void ulsch_modulation(int32_t **txdataF,
case
2
:
case
2
:
// TODO: this has to be updated!!!
// TODO: this has to be updated!!!
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
0
]
=
(
ulsch
->
b_tilde
[
j
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
d
[
i
].
r
=
(
ulsch
->
b_tilde
[
j
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
1
]
=
(
ulsch
->
b_tilde
[
j
+
1
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
d
[
i
].
i
=
(
ulsch
->
b_tilde
[
j
+
1
]
==
1
)
?
(
-
gain_lin_QPSK
)
:
gain_lin_QPSK
;
// if (i<Msc_PUSCH)
// if (i<Msc_PUSCH)
// printf("input %d/%d Msc_PUSCH %d (%p): %d,%d\n", i,Msymb,Msc_PUSCH,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
// printf("input %d/%d Msc_PUSCH %d (%p): %d,%d\n", i,Msymb,Msc_PUSCH,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
...
@@ -646,8 +647,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -646,8 +647,8 @@ void ulsch_modulation(int32_t **txdataF,
qam16_table_offset_im
+=
1
;
qam16_table_offset_im
+=
1
;
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
0
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_re
])
>>
15
);
d
[
i
].
r
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_re
])
>>
15
);
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
1
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_im
])
>>
15
);
d
[
i
].
i
=
(
int16_t
)(((
int32_t
)
amp
*
qam16_table
[
qam16_table_offset_im
])
>>
15
);
// printf("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
// printf("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
break
;
break
;
...
@@ -676,8 +677,8 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -676,8 +677,8 @@ void ulsch_modulation(int32_t **txdataF,
qam64_table_offset_im
+=
1
;
qam64_table_offset_im
+=
1
;
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
0
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_re
])
>>
15
);
d
[
i
].
r
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_re
])
>>
15
);
((
int16_t
*
)
&
ulsch
->
d
[
i
])[
1
]
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_im
])
>>
15
);
d
[
i
].
i
=
(
int16_t
)(((
int32_t
)
amp
*
qam64_table
[
qam64_table_offset_im
])
>>
15
);
break
;
break
;
...
@@ -688,7 +689,7 @@ void ulsch_modulation(int32_t **txdataF,
...
@@ -688,7 +689,7 @@ void ulsch_modulation(int32_t **txdataF,
// Transform Precoding
// Transform Precoding
dft_lte
(
ulsch
->
z
,
ulsch
->
d
,
Msc_PUSCH
,
ulsch
->
Nsymb_pusch
);
dft_lte
(
ulsch
->
z
,
d
,
Msc_PUSCH
,
ulsch
->
Nsymb_pusch
);
DevAssert
(
txdataF
);
DevAssert
(
txdataF
);
...
...
openair1/PHY/MODULATION/slot_fep.c
View file @
3e6e9f44
...
@@ -91,7 +91,7 @@ int slot_fep(PHY_VARS_UE *ue,
...
@@ -91,7 +91,7 @@ int slot_fep(PHY_VARS_UE *ue,
}
}
// subframe_offset_F = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
// subframe_offset_F = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
if
(
l
<
0
||
l
>=
7
-
frame_parms
->
Ncp
)
{
if
(
l
<
0
||
l
>=
7
-
frame_parms
->
Ncp
)
{
printf
(
"slot_fep: l must be between 0 and %d
\n
"
,
7
-
frame_parms
->
Ncp
);
printf
(
"slot_fep: l must be between 0 and %d
\n
"
,
7
-
frame_parms
->
Ncp
);
return
(
-
1
);
return
(
-
1
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
3e6e9f44
...
@@ -103,7 +103,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
...
@@ -103,7 +103,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
uint16_t
nb_re
=
((
12
*
rel15
->
NrOfSymbols
)
-
nb_re_dmrs
*
dmrs_len
-
xOverhead
)
*
rel15
->
rbSize
*
rel15
->
nrOfLayers
;
uint16_t
nb_re
=
((
12
*
rel15
->
NrOfSymbols
)
-
nb_re_dmrs
*
dmrs_len
-
xOverhead
)
*
rel15
->
rbSize
*
rel15
->
nrOfLayers
;
uint8_t
Qm
=
rel15
->
qamModOrder
[
0
];
uint8_t
Qm
=
rel15
->
qamModOrder
[
0
];
uint32_t
encoded_length
=
nb_re
*
Qm
;
uint32_t
encoded_length
=
nb_re
*
Qm
;
uint32_t
scrambled_output
[
rel15
->
NrOfCodewords
][(
encoded_length
>>
5
)
+
1
];
int16_t
mod_dmrs
[
n_dmrs
<<
1
]
__attribute__
((
aligned
(
16
)));
int16_t
mod_dmrs
[
n_dmrs
<<
1
]
__attribute__
((
aligned
(
16
)));
/* PTRS */
/* PTRS */
...
@@ -152,63 +151,61 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
...
@@ -152,63 +151,61 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf
(
"
\n
"
);
printf
(
"
\n
"
);
#endif
#endif
/// scrambling
start_meas
(
dlsch_scrambling_stats
);
for
(
int
q
=
0
;
q
<
rel15
->
NrOfCodewords
;
q
++
)
{
for
(
int
q
=
0
;
q
<
rel15
->
NrOfCodewords
;
q
++
)
{
memset
((
void
*
)
scrambled_output
[
q
],
0
,
((
encoded_length
>>
5
)
+
1
)
*
sizeof
(
uint32_t
));
/// scrambling
start_meas
(
dlsch_scrambling_stats
);
uint32_t
scrambled_output
[(
encoded_length
>>
5
)
+
4
];
// modulator acces by 4 bytes in some cases
memset
(
scrambled_output
,
0
,
sizeof
(
scrambled_output
));
if
(
encoded_length
>
rel15
->
rbSize
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
Qm
*
rel15
->
nrOfLayers
)
abort
();
nr_pdsch_codeword_scrambling
(
output
,
nr_pdsch_codeword_scrambling
(
output
,
encoded_length
,
encoded_length
,
q
,
q
,
rel15
->
dataScramblingId
,
rel15
->
dataScramblingId
,
rel15
->
rnti
,
rel15
->
rnti
,
scrambled_output
[
q
]);
scrambled_output
);
}
stop_meas
(
dlsch_scrambling_stats
);
#ifdef DEBUG_DLSCH
#ifdef DEBUG_DLSCH
printf
(
"PDSCH scrambling:
\n
"
);
printf
(
"PDSCH scrambling:
\n
"
);
for
(
int
i
=
0
;
i
<
encoded_length
>>
8
;
i
++
)
{
for
(
int
i
=
0
;
i
<
encoded_length
>>
8
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
for
(
int
j
=
0
;
j
<
8
;
j
++
)
printf
(
"0x%08x
\t
"
,
scrambled_output
[
0
]
[(
i
<<
3
)
+
j
]);
printf
(
"0x%08x
\t
"
,
scrambled_output
[(
i
<<
3
)
+
j
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
#endif
#endif
stop_meas
(
dlsch_scrambling_stats
);
/// Modulation
/// Modulation
start_meas
(
dlsch_modulation_stats
);
start_meas
(
dlsch_modulation_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION
,
1
);
nr_modulation
(
scrambled_output
,
for
(
int
q
=
0
;
q
<
rel15
->
NrOfCodewords
;
q
++
)
encoded_length
,
nr_modulation
(
scrambled_output
[
q
],
Qm
,
encoded_length
,
mod_symbs
[
q
]);
Qm
,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION
,
0
);
mod_symbs
[
q
]);
stop_meas
(
dlsch_modulation_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION
,
0
);
stop_meas
(
dlsch_modulation_stats
);
#ifdef DEBUG_DLSCH
#ifdef DEBUG_DLSCH
printf
(
"PDSCH Modulation: Qm %d(%d)
\n
"
,
Qm
,
nb_re
);
printf
(
"PDSCH Modulation: Qm %d(%d)
\n
"
,
Qm
,
nb_re
);
for
(
int
i
=
0
;
i
<
nb_re
>>
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nb_re
>>
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"%d %d
\t
"
,
mod_symbs
[
0
][((
i
<<
3
)
+
j
)
<<
1
],
mod_symbs
[
0
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
printf
(
"%d %d
\t
"
,
mod_symbs
[
0
][((
i
<<
3
)
+
j
)
<<
1
],
mod_symbs
[
0
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
}
printf
(
"
\n
"
);
}
}
printf
(
"
\n
"
);
}
#endif
#endif
}
start_meas
(
&
gNB
->
dlsch_layer_mapping_stats
);
start_meas
(
&
gNB
->
dlsch_layer_mapping_stats
);
/// Layer mapping
/// Layer mapping
nr_layer_mapping
(
mod_symbs
,
nr_layer_mapping
(
mod_symbs
,
rel15
->
nrOfLayers
,
rel15
->
nrOfLayers
,
nb_re
,
nb_re
,
tx_layers
);
tx_layers
);
#ifdef DEBUG_DLSCH
#ifdef DEBUG_DLSCH
printf
(
"Layer mapping (%d layers):
\n
"
,
rel15
->
nrOfLayers
);
printf
(
"Layer mapping (%d layers):
\n
"
,
rel15
->
nrOfLayers
);
for
(
int
l
=
0
;
l
<
rel15
->
nrOfLayers
;
l
++
)
for
(
int
l
=
0
;
l
<
rel15
->
nrOfLayers
;
l
++
)
for
(
int
i
=
0
;
i
<
(
nb_re
/
rel15
->
nrOfLayers
)
>>
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
(
nb_re
/
rel15
->
nrOfLayers
)
>>
3
;
i
++
)
{
printf
(
"layer %d, Re %d..%d : "
,
l
,
i
<<
3
,(
i
<<
3
)
+
7
);
printf
(
"layer %d, Re %d..%d : "
,
l
,
i
<<
3
,(
i
<<
3
)
+
7
);
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"l%d %d
\t
"
,
tx_layers
[
l
][((
i
<<
3
)
+
j
)
<<
1
],
tx_layers
[
l
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
printf
(
"l%d %d
\t
"
,
tx_layers
[
l
][((
i
<<
3
)
+
j
)
<<
1
],
tx_layers
[
l
][(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
#endif
#endif
...
@@ -227,7 +224,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
...
@@ -227,7 +224,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
#ifdef DEBUG_DLSCH_MAPPING
#ifdef DEBUG_DLSCH_MAPPING
printf
(
"PDSCH resource mapping started (start SC %d
\t
start symbol %d
\t
N_PRB %d
\t
nb_re %d,nb_layers %d)
\n
"
,
printf
(
"PDSCH resource mapping started (start SC %d
\t
start symbol %d
\t
N_PRB %d
\t
nb_re %d,nb_layers %d)
\n
"
,
start_sc
,
rel15
->
StartSymbolIndex
,
rel15
->
rbSize
,
nb_re
,
rel15
->
nrOfLayers
);
start_sc
,
rel15
->
StartSymbolIndex
,
rel15
->
rbSize
,
nb_re
,
rel15
->
nrOfLayers
);
#endif
#endif
start_meas
(
&
gNB
->
dlsch_resource_mapping_stats
);
start_meas
(
&
gNB
->
dlsch_resource_mapping_stats
);
...
...
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
View file @
3e6e9f44
...
@@ -558,6 +558,9 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric,
...
@@ -558,6 +558,9 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric,
}
}
//#endif
//#endif
if
(
Nid1
==
N_ID_1_NUMBER
)
return
-
1
;
int
re
=
0
;
int
re
=
0
;
int
im
=
0
;
int
im
=
0
;
d
=
(
int16_t
*
)
&
d_sss
[
Nid2
][
Nid1
];
d
=
(
int16_t
*
)
&
d_sss
[
Nid2
][
Nid1
];
...
...
openair1/PHY/TOOLS/oai_dfts.c
View file @
3e6e9f44
...
@@ -7082,43 +7082,40 @@ static inline void dft12f(simd_q15_t *x0,
...
@@ -7082,43 +7082,40 @@ static inline void dft12f(simd_q15_t *x0,
simd_q15_t
tmp_dft12
[
12
];
simd_q15_t
tmp_dft12
[
12
];
simd_q15_t
*
tmp_dft12_ptr
=
&
tmp_dft12
[
0
];
// msg("dft12\n");
// msg("dft12\n");
bfly4_tw1
(
x0
,
bfly4_tw1
(
x0
,
x3
,
x3
,
x6
,
x6
,
x9
,
x9
,
tmp_dft12_ptr
,
tmp_dft12
,
tmp_dft12_ptr
+
3
,
tmp_dft12
+
3
,
tmp_dft12_ptr
+
6
,
tmp_dft12
+
6
,
tmp_dft12_ptr
+
9
);
tmp_dft12
+
9
);
bfly4_tw1
(
x1
,
bfly4_tw1
(
x1
,
x4
,
x4
,
x7
,
x7
,
x10
,
x10
,
tmp_dft12
_ptr
+
1
,
tmp_dft12
+
1
,
tmp_dft12
_ptr
+
4
,
tmp_dft12
+
4
,
tmp_dft12
_ptr
+
7
,
tmp_dft12
+
7
,
tmp_dft12
_ptr
+
10
);
tmp_dft12
+
10
);
bfly4_tw1
(
x2
,
bfly4_tw1
(
x2
,
x5
,
x5
,
x8
,
x8
,
x11
,
x11
,
tmp_dft12
_ptr
+
2
,
tmp_dft12
+
2
,
tmp_dft12
_ptr
+
5
,
tmp_dft12
+
5
,
tmp_dft12
_ptr
+
8
,
tmp_dft12
+
8
,
tmp_dft12
_ptr
+
11
);
tmp_dft12
+
11
);
// k2=0;
// k2=0;
bfly3_tw1
(
tmp_dft12
_ptr
,
bfly3_tw1
(
tmp_dft12
,
tmp_dft12
_ptr
+
1
,
tmp_dft12
+
1
,
tmp_dft12
_ptr
+
2
,
tmp_dft12
+
2
,
y0
,
y0
,
y4
,
y4
,
y8
);
y8
);
...
@@ -7126,9 +7123,9 @@ static inline void dft12f(simd_q15_t *x0,
...
@@ -7126,9 +7123,9 @@ static inline void dft12f(simd_q15_t *x0,
// k2=1;
// k2=1;
bfly3
(
tmp_dft12
_ptr
+
3
,
bfly3
(
tmp_dft12
+
3
,
tmp_dft12
_ptr
+
4
,
tmp_dft12
+
4
,
tmp_dft12
_ptr
+
5
,
tmp_dft12
+
5
,
y1
,
y1
,
y5
,
y5
,
y9
,
y9
,
...
@@ -7138,9 +7135,9 @@ static inline void dft12f(simd_q15_t *x0,
...
@@ -7138,9 +7135,9 @@ static inline void dft12f(simd_q15_t *x0,
// k2=2;
// k2=2;
bfly3
(
tmp_dft12
_ptr
+
6
,
bfly3
(
tmp_dft12
+
6
,
tmp_dft12
_ptr
+
7
,
tmp_dft12
+
7
,
tmp_dft12
_ptr
+
8
,
tmp_dft12
+
8
,
y2
,
y2
,
y6
,
y6
,
y10
,
y10
,
...
@@ -7148,9 +7145,9 @@ static inline void dft12f(simd_q15_t *x0,
...
@@ -7148,9 +7145,9 @@ static inline void dft12f(simd_q15_t *x0,
W4_12
);
W4_12
);
// k2=3;
// k2=3;
bfly3
(
tmp_dft12
_ptr
+
9
,
bfly3
(
tmp_dft12
+
9
,
tmp_dft12
_ptr
+
10
,
tmp_dft12
+
10
,
tmp_dft12
_ptr
+
11
,
tmp_dft12
+
11
,
y3
,
y3
,
y7
,
y7
,
y11
,
y11
,
...
@@ -10606,15 +10603,43 @@ int dfts_autoinit(void)
...
@@ -10606,15 +10603,43 @@ int dfts_autoinit(void)
#ifndef MR_MAIN
#ifndef MR_MAIN
void
dft
(
uint8_t
sizeidx
,
int16_t
*
sigF
,
int16_t
*
sig
,
unsigned
char
scale_flag
){
void
dft
(
uint8_t
sizeidx
,
int16_t
*
input
,
int16_t
*
output
,
unsigned
char
scale_flag
){
AssertFatal
((
sizeidx
>=
0
&&
sizeidx
<
(
int
)
DFT_SIZE_IDXTABLESIZE
),
"Invalid dft size index %i
\n
"
,
sizeidx
);
AssertFatal
((
sizeidx
>=
0
&&
sizeidx
<
DFT_SIZE_IDXTABLESIZE
),
"Invalid dft size index %i
\n
"
,
sizeidx
);
dft_ftab
[
sizeidx
](
sigF
,
sig
,
scale_flag
);
int
algn
=
0xF
;
#ifdef __AVX2__
if
(
(
dft_ftab
[
sizeidx
].
size
%
3
)
!=
0
)
// there is no AVX2 implementation for multiples of 3 DFTs
algn
=
0x1F
;
#endif
AssertFatal
(((
intptr_t
)
output
&
algn
)
==
0
,
"Buffers should be aligned %p"
,
output
);
if
(((
intptr_t
)
input
)
&
algn
)
{
LOG_D
(
PHY
,
"DFT called with input not aligned, add a memcpy, size %d
\n
"
,
sizeidx
);
int
sz
=
dft_ftab
[
sizeidx
].
size
;
if
(
sizeidx
==
DFT_12
)
// This case does 8 DFTs in //
sz
*=
8
;
int16_t
tmp
[
sz
*
2
]
__attribute__
((
aligned
(
32
)));
// input and output are not in right type (int16_t instead of c16_t)
memcpy
(
tmp
,
input
,
sizeof
tmp
);
dft_ftab
[
sizeidx
].
func
(
tmp
,
output
,
scale_flag
);
}
else
dft_ftab
[
sizeidx
].
func
(
input
,
output
,
scale_flag
);
};
};
void
idft
(
uint8_t
sizeidx
,
int16_t
*
sigF
,
int16_t
*
sig
,
unsigned
char
scale_flag
){
void
idft
(
uint8_t
sizeidx
,
int16_t
*
input
,
int16_t
*
output
,
unsigned
char
scale_flag
){
AssertFatal
((
sizeidx
>=
0
&&
sizeidx
<
(
int
)
IDFT_SIZE_IDXTABLESIZE
),
"Invalid idft size index %i
\n
"
,
sizeidx
);
AssertFatal
((
sizeidx
>=
0
&&
sizeidx
<
DFT_SIZE_IDXTABLESIZE
),
"Invalid idft size index %i
\n
"
,
sizeidx
);
idft_ftab
[
sizeidx
](
sigF
,
sig
,
scale_flag
);
int
algn
=
0xF
;
#ifdef __AVX2__
algn
=
0x1F
;
#endif
AssertFatal
(
((
intptr_t
)
output
&
algn
)
==
0
,
"Buffers should be 16 bytes aligned %p"
,
output
);
if
(((
intptr_t
)
input
)
&
algn
)
{
LOG_D
(
PHY
,
"DFT called with input not aligned, add a memcpy
\n
"
);
int
sz
=
idft_ftab
[
sizeidx
].
size
;
int16_t
tmp
[
sz
*
2
]
__attribute__
((
aligned
(
32
)));
// input and output are not in right type (int16_t instead of c16_t)
memcpy
(
tmp
,
input
,
sizeof
tmp
);
dft_ftab
[
sizeidx
].
func
(
tmp
,
output
,
scale_flag
);
}
else
idft_ftab
[
sizeidx
].
func
(
input
,
output
,
scale_flag
);
};
};
#endif
#endif
/*---------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------*/
...
...
openair1/PHY/TOOLS/tools_defs.h
View file @
3e6e9f44
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
3e6e9f44
...
@@ -519,4 +519,7 @@ bool nr_find_nb_rb(uint16_t Qm,
...
@@ -519,4 +519,7 @@ bool nr_find_nb_rb(uint16_t Qm,
void
nr_sr_reporting
(
int
Mod_idP
,
frame_t
frameP
,
sub_frame_t
slotP
);
void
nr_sr_reporting
(
int
Mod_idP
,
frame_t
frameP
,
sub_frame_t
slotP
);
void
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
int
strlen
,
bool
reset_rsrp
);
void
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
int
strlen
,
bool
reset_rsrp
);
void
process_CellGroup
(
NR_CellGroupConfig_t
*
CellGroup
,
NR_UE_sched_ctrl_t
*
sched_ctrl
);
#endif
/*__LAYER2_NR_MAC_PROTO_H__*/
#endif
/*__LAYER2_NR_MAC_PROTO_H__*/
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