Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
OpenXG UE
Commits
b9bef2dc
Commit
b9bef2dc
authored
Aug 15, 2020
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimization of NR ULSCH unscrambling
parent
f7fbc53c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
17 deletions
+84
-17
openair1/PHY/NR_REFSIG/nr_refsig.h
openair1/PHY/NR_REFSIG/nr_refsig.h
+1
-0
openair1/PHY/NR_REFSIG/scrambling_luts.c
openair1/PHY/NR_REFSIG/scrambling_luts.c
+17
-1
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+35
-1
openair1/PHY/NR_TRANSPORT/pucch_rx.c
openair1/PHY/NR_TRANSPORT/pucch_rx.c
+7
-7
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+5
-5
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+19
-3
No files found.
openair1/PHY/NR_REFSIG/nr_refsig.h
View file @
b9bef2dc
...
...
@@ -55,5 +55,6 @@ void init_scrambling_luts(void);
extern
__m64
byte2m64_re
[
256
];
extern
__m64
byte2m64_im
[
256
];
extern
__m128i
byte2m128i
[
256
];
#endif
openair1/PHY/NR_REFSIG/scrambling_luts.c
View file @
b9bef2dc
...
...
@@ -32,6 +32,8 @@
__m64
byte2m64_re
[
256
];
__m64
byte2m64_im
[
256
];
__m128i
byte2m128i
[
256
];
void
init_byte2m64
(
void
)
{
for
(
int
s
=
0
;
s
<
256
;
s
++
)
{
...
...
@@ -54,10 +56,24 @@ void init_byte2m64(void) {
}
}
void
init_byte2m128i
(
void
)
{
for
(
int
s
=
0
;
s
<
256
;
s
++
)
{
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
(
s
&
1
)),
0
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
1
)
&
1
)),
1
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
2
)
&
1
)),
2
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
3
)
&
1
)),
3
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
4
)
&
1
)),
4
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
5
)
&
1
)),
5
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
6
)
&
1
)),
6
);
byte2m128i
[
s
]
=
_mm_insert_epi16
(
byte2m128i
[
s
],(
1
-
2
*
((
s
>>
7
)
&
1
)),
7
);
}
}
void
init_scrambling_luts
(
void
)
{
init_byte2m64
();
init_byte2m128i
();
}
#endif
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
View file @
b9bef2dc
...
...
@@ -33,7 +33,7 @@
#include <stdint.h>
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
#include "PHY/
LTE_REFSIG/lte
_refsig.h"
#include "PHY/
NR_REFSIG/nr
_refsig.h"
int16_t
find_nr_ulsch
(
uint16_t
rnti
,
PHY_VARS_gNB
*
gNB
,
find_type_t
type
)
{
...
...
@@ -103,3 +103,37 @@ void nr_ulsch_unscrambling(int16_t* llr,
llr
[
i
]
=
-
llr
[
i
];
}
}
void
nr_ulsch_unscrambling_optim
(
int16_t
*
llr
,
uint32_t
size
,
uint8_t
q
,
uint32_t
Nid
,
uint32_t
n_RNTI
)
{
#if defined(__x86_64__) || defined(__i386__)
uint8_t
reset
;
uint32_t
x1
,
x2
,
s
=
0
;
x2
=
(
n_RNTI
<<
15
)
+
Nid
;
uint8_t
*
s8
=
(
uint8_t
*
)
&
s
;
__m128i
*
llr128
=
(
__m128i
*
)
llr
;
int
j
=
0
;
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
1
);
for
(
int
i
=
0
;
i
<
((
size
>>
5
)
+
((
size
&
0x1f
)
>
0
?
1
:
0
));
i
++
,
j
+=
4
)
{
llr128
[
j
]
=
_mm_mullo_epi16
(
llr128
[
j
],
byte2m128i
[
s8
[
0
]]);
llr128
[
j
+
1
]
=
_mm_mullo_epi16
(
llr128
[
j
+
1
],
byte2m128i
[
s8
[
1
]]);
llr128
[
j
+
2
]
=
_mm_mullo_epi16
(
llr128
[
j
+
2
],
byte2m128i
[
s8
[
2
]]);
llr128
[
j
+
3
]
=
_mm_mullo_epi16
(
llr128
[
j
+
3
],
byte2m128i
[
s8
[
3
]]);
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
0
);
}
#else
nr_ulsch_unscrambling
(
llr
,
size
,
q
,
Nid
,
n_RNTI
);
#endif
}
openair1/PHY/NR_TRANSPORT/pucch_rx.c
View file @
b9bef2dc
...
...
@@ -50,7 +50,7 @@
#include "T.h"
//
#define DEBUG_NR_PUCCH_RX 1
#define DEBUG_NR_PUCCH_RX 1
NR_gNB_PUCCH_t
*
new_gNB_pucch
(
void
){
NR_gNB_PUCCH_t
*
pucch
;
...
...
@@ -385,28 +385,28 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
if
(
xrtmag_dB
>
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
))
{
uci_pdu
->
sr
->
sr_indication
=
1
;
uci_pdu
->
sr
->
sr_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
);
uci_pdu
->
sr
->
sr_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
11
+
gNB
->
pucch0_thres
);
}
else
{
uci_pdu
->
sr
->
sr_indication
=
0
;
uci_pdu
->
sr
->
sr_confidence_level
=
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
)
-
xrtmag_dB
;
uci_pdu
->
sr
->
sr_confidence_level
=
(
gNB
->
measurements
.
n0_power_tot_dB
+
11
+
gNB
->
pucch0_thres
)
-
xrtmag_dB
;
}
}
else
if
(
pucch_pdu
->
bit_len_harq
==
1
)
{
uci_pdu
->
harq
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
harq
));
uci_pdu
->
harq
->
num_harq
=
1
;
uci_pdu
->
harq
->
harq_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
);
uci_pdu
->
harq
->
harq_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
11
+
gNB
->
pucch0_thres
);
uci_pdu
->
harq
->
harq_list
=
(
nfapi_nr_harq_t
*
)
malloc
(
1
);
uci_pdu
->
harq
->
harq_list
[
0
].
harq_value
=
index
&
0x01
;
if
(
pucch_pdu
->
sr_flag
==
1
)
{
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
uci_pdu
->
sr
->
sr_indication
=
(
index
>
1
)
?
1
:
0
;
uci_pdu
->
sr
->
sr_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
);
uci_pdu
->
sr
->
sr_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
11
+
gNB
->
pucch0_thres
);
}
}
else
{
uci_pdu
->
harq
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
harq
));
uci_pdu
->
harq
->
num_harq
=
2
;
uci_pdu
->
harq
->
harq_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
);
uci_pdu
->
harq
->
harq_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
11
+
gNB
->
pucch0_thres
);
uci_pdu
->
harq
->
harq_list
=
(
nfapi_nr_harq_t
*
)
malloc
(
2
);
uci_pdu
->
harq
->
harq_list
[
1
].
harq_value
=
index
&
0x01
;
...
...
@@ -415,7 +415,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
if
(
pucch_pdu
->
sr_flag
==
1
)
{
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
uci_pdu
->
sr
->
sr_indication
=
(
index
>
3
)
?
1
:
0
;
uci_pdu
->
sr
->
sr_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
gNB
->
pucch0_thres
);
uci_pdu
->
sr
->
sr_confidence_level
=
xrtmag_dB
-
(
gNB
->
measurements
.
n0_power_tot_dB
+
11
+
gNB
->
pucch0_thres
);
}
}
}
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
b9bef2dc
...
...
@@ -244,11 +244,11 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
//------------------- ULSCH unscrambling -------------------
//----------------------------------------------------------
start_meas
(
&
gNB
->
ulsch_unscrambling_stats
);
nr_ulsch_unscrambling
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
llr
,
G
,
0
,
pusch_pdu
->
data_scrambling_id
,
pusch_pdu
->
rnti
);
nr_ulsch_unscrambling
_optim
(
gNB
->
pusch_vars
[
ULSCH_id
]
->
llr
,
G
,
0
,
pusch_pdu
->
data_scrambling_id
,
pusch_pdu
->
rnti
);
stop_meas
(
&
gNB
->
ulsch_unscrambling_stats
);
//----------------------------------------------------------
//--------------------- ULSCH decoding ---------------------
...
...
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
b9bef2dc
...
...
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
uint8_t
transmission_mode
=
1
,
n_tx
=
1
,
n_rx
=
1
;
uint16_t
Nid_cell
=
0
;
uint64_t
SSB_positions
=
0x01
;
channel_desc_t
*
gNB2UE
;
channel_desc_t
*
UE2gNB
;
int
format
=
0
;
//uint8_t extended_prefix_flag=0;
FILE
*
input_fd
=
NULL
;
...
...
@@ -100,6 +100,8 @@ int main(int argc, char **argv)
uint16_t
nrofPRB
=
2
;
uint8_t
timeDomainOCC
=
0
;
SCM_t
channel_model
=
AWGN
;
//Rayleigh1_anticorr;
double
DS_TDL
=
.
03
;
int
N_RB_DL
=
273
,
mu
=
1
;
float
target_error_rate
=
0
.
001
;
...
...
@@ -162,6 +164,20 @@ int main(int argc, char **argv)
case
'G'
:
channel_model
=
ETU
;
break
;
case
'H'
:
channel_model
=
TDL_C
;
DS_TDL
=
.
030
;
// 30 ns
break
;
case
'I'
:
channel_model
=
TDL_C
;
DS_TDL
=
.
3
;
// 300ns
break
;
case
'J'
:
channel_model
=
TDL_D
;
DS_TDL
=
.
03
;
break
;
default:
printf
(
"Unsupported channel model!
\n
"
);
...
...
@@ -402,9 +418,9 @@ int main(int argc, char **argv)
printf
(
"FFO = %lf; IFO = %d
\n
"
,
eps
-
IFO
,
IFO
);
}
gNB2UE
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
fs
,
bw
,
0
,
0
,
0
);
UE2gNB
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
fs
,
bw
,
DS_TDL
,
0
,
0
,
0
);
if
(
gNB2UE
==
NULL
)
{
if
(
UE2gNB
==
NULL
)
{
printf
(
"Problem generating channel model. Exiting.
\n
"
);
exit
(
-
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