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
alex037yang
OpenXG-RAN
Commits
6eeafaaf
Commit
6eeafaaf
authored
Mar 13, 2019
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final additions to list decoding before testing
parent
5344e567
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
16 deletions
+74
-16
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
+73
-16
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+1
-0
No files found.
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
View file @
6eeafaaf
...
...
@@ -226,7 +226,15 @@ decoder_node_t *add_nodes(int level,int first_leaf_index,t_nrPolar_params *pp) {
printf
(
"leaf %d (%s)
\n
"
,
first_leaf_index
,
pp
->
information_bit_pattern
[
first_leaf_index
]
==
1
?
"information or crc"
:
"frozen"
);
#endif
new_node
->
leaf
=
1
;
new_node
->
all_frozen
=
pp
->
information_bit_pattern
[
first_leaf_index
]
==
0
?
1
:
0
;
if
(
pp
->
information_bit_pattern
[
first_leaf_index
]
==
0
)
new_node
->
all_frozen
=
1
;
else
{
new_node
->
all_frozen
=
0
;
int
i
=
0
;
for
(;
i
<
pp
->
K
;
i
++
)
if
(
pp
->
Q_I_N
[
i
]
==
first_leaf_index
)
break
;
AssertFatal
(
i
<
pp
->
K
,
"Couldn't find a valid bit position for leaf index %d
\n
"
,
first_leaf_index
);
new_node
->
bit_index
=
i
;
}
return
new_node
;
// this is a leaf node
}
...
...
@@ -259,6 +267,27 @@ void build_decoder_tree(t_nrPolar_params *pp) {
#endif
}
inline
void
update_min
(
t_nrPolar_params
*
pp
,
int
bi
,
int
i
,
int
u
,
int16_t
abs_alpha
)
__attribute__
((
always_inline
));
inline
void
update_min
(
t_nrPolar_params
*
pp
,
int
bi
,
int
i
,
int
u
,
int16_t
abs_alpha
)
{
int
newPM
=
pp
->
tree
.
PM
[
i
]
-
abs_alpha
;
int
minPM
=
0
;
int
minentry
=
pp
->
tree
.
minentry
;
if
(
newPM
>
pp
->
tree
.
minPM
)
{
pp
->
tree
.
PM
[
minentry
]
=
newPM
;
pp
->
tree
.
decoderout
[
minentry
][
bi
>>
6
]
&=
~
(((
uint64_t
)
1
)
<<
(
bi
&
63
));
pp
->
tree
.
decoderout
[
minentry
][
bi
>>
6
]
|=
(((
uint64_t
)
u
)
<<
(
bi
&
63
));
}
for
(
int
j
=
0
;
j
<
pp
->
tree
.
numentries
;
j
++
)
if
(
pp
->
tree
.
PM
[
i
]
<
minPM
)
{
pp
->
tree
.
PM
[
i
]
=
minPM
;
pp
->
tree
.
minentry
=
i
;
}
}
#if defined(__arm__) || defined(__aarch64__)
// translate 1-1 SIMD functions from SSE to NEON
#define __m128i int16x8_t
...
...
@@ -271,6 +300,7 @@ void build_decoder_tree(t_nrPolar_params *pp) {
#define _mm_subs_pi16(a,b) vsub_s16(a,b)
#endif
void
applyFtoleft
(
t_nrPolar_params
*
pp
,
decoder_node_t
*
node
)
{
int16_t
*
alpha_v
=
node
->
alpha
;
int16_t
*
alpha_l
=
node
->
left
->
alpha
;
...
...
@@ -387,24 +417,28 @@ void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
printf
(
"betal[0] %d (%p)
\n
"
,
betal
[
0
],
&
betal
[
0
]);
#endif
// pp->nr_polar_U[node->first_leaf_index] = (1+betal[0])>>1;
int
bi
=
node
->
left
->
bit_bitindex
;
int
ne1
=
pp
->
tree
.
num_entries
;
int
bi
=
node
->
left
->
bit_index
;
int16_t
abs_alpha
=
((
alpha_l
[
0
]
>
0
)
?
alpha_l
[
0
]
:
-
alpha_l
[
0
]);
if
(
pp
->
tree
.
num_entries
<
pp
->
tree
.
list_size
)
{
int
ne2
=
pp
->
tree
.
numentries
<<
1
;
if
(
ne2
>
pp
->
tree
.
list_size
)
ne2
=
pp
->
tree
.
list_size
;
if
(
pp
->
tree
.
numentries
<
pp
->
tree
.
list_size
)
{
// update list for SC hard-decision
for
(
int
i
=
0
;
i
<
pp
->
tree
.
num
_
entries
;
i
++
)
pp
->
tree
.
decoderout
[
i
][
bi
>>
6
]
|=
(((
1
+
betal
[
0
])
>>
1
)
<<
(
bi
&
63
));
for
(
int
i
=
0
;
i
<
pp
->
tree
.
numentries
;
i
++
)
pp
->
tree
.
decoderout
[
i
][
bi
>>
6
]
|=
(((
1
+
betal
[
0
])
>>
1
)
<<
(
bi
&
63
));
// update list for flipped SC hard-decision
int
ne2
=
pp
->
tree
.
num_entries
<<
1
;
if
(
ne2
>
pp
->
tree
.
list_size
)
ne2
=
pp
->
tree
.
list_size
;
for
(
int
i
=
pp
->
tree
.
num_entries
;
i
<
ne2
;
i
++
)
{
pp
->
tree
.
decoderout
[
i
][
bi
>>
6
]
=
pp
->
tree
.
decoderout
[
i
-
pp
->
tree
.
num_entries
][
bi
>>
6
]
^
(((
uint64_t
)
1
)
<<
(
bi
&
63
));
pp
->
tree
.
PM
[
i
]
=
pp
->
tree
.
PM
[
i
-
pp
->
tree
.
num_entries
]
-
abs_alpha
;
for
(
int
i
=
pp
->
tree
.
numentries
;
i
<
ne2
;
i
++
)
{
pp
->
tree
.
decoderout
[
i
][
bi
>>
6
]
=
pp
->
tree
.
decoderout
[
i
-
pp
->
tree
.
numentries
][
bi
>>
6
]
^
(((
uint64_t
)
1
)
<<
(
bi
&
63
));
pp
->
tree
.
PM
[
i
]
=
pp
->
tree
.
PM
[
i
-
pp
->
tree
.
numentries
]
-
abs_alpha
;
if
(
pp
->
tree
.
PM
[
i
]
<
pp
->
tree
.
minPM
)
{
pp
->
tree
.
minPM
=
pp
->
tree
.
PM
[
i
];
pp
->
tree
.
minentry
=
i
;
}
}
}
for
(
int
i
=
0
;
i
<
pp
->
tree
.
num_entries
-
(
ne2
-
pp
->
tree
.
num_entries
);
i
++
)
update_min
(
pp
->
tree
,
abs_alpha
);
for
(
int
i
=
0
;
i
<
(
pp
->
tree
.
numentries
<<
1
)
-
ne2
;
i
++
)
update_min
(
pp
,
bi
,
i
,(
1
-
betal
[
0
])
>>
1
,
abs_alpha
);
#ifdef DEBUG_NEW_IMPL
...
...
@@ -476,12 +510,35 @@ void applyGtoright(t_nrPolar_params *pp,decoder_node_t *node) {
}
if
(
node
->
Nv
==
2
)
{
// apply hard decision on right node
betar
[
0
]
=
(
alpha_r
[
0
]
>
0
)
?
-
1
:
1
;
pp
->
nr_polar_U
[
node
->
first_leaf_index
+
1
]
=
(
1
+
betar
[
0
])
>>
1
;
//#ifdef DEBUG_NEW_IMPL
int
j
;
for
(
j
=
0
;
j
<
pp
->
K
;
j
++
)
if
(
pp
->
Q_I_N
[
j
]
==
(
node
->
first_leaf_index
+
1
))
break
;
// pp->nr_polar_U[node->first_leaf_index+1] = (1+betar[0])>>1;
int
bi
=
node
->
right
->
bit_index
;
int16_t
abs_alpha
=
((
alpha_r
[
0
]
>
0
)
?
alpha_r
[
0
]
:
-
alpha_r
[
0
]);
int
ne2
=
pp
->
tree
.
numentries
<<
1
;
if
(
ne2
>
pp
->
tree
.
list_size
)
ne2
=
pp
->
tree
.
list_size
;
if
(
pp
->
tree
.
numentries
<
pp
->
tree
.
list_size
)
{
// update list for SC hard-decision
for
(
int
i
=
0
;
i
<
pp
->
tree
.
numentries
;
i
++
)
pp
->
tree
.
decoderout
[
i
][
bi
>>
6
]
|=
(((
1
+
betar
[
0
])
>>
1
)
<<
(
bi
&
63
));
// update list for flipped SC hard-decision
for
(
int
i
=
pp
->
tree
.
numentries
;
i
<
ne2
;
i
++
)
{
pp
->
tree
.
decoderout
[
i
][
bi
>>
6
]
=
pp
->
tree
.
decoderout
[
i
-
pp
->
tree
.
numentries
][
bi
>>
6
]
^
(((
uint64_t
)
1
)
<<
(
bi
&
63
));
pp
->
tree
.
PM
[
i
]
=
pp
->
tree
.
PM
[
i
-
pp
->
tree
.
numentries
]
-
abs_alpha
;
if
(
pp
->
tree
.
PM
[
i
]
<
pp
->
tree
.
minPM
)
{
pp
->
tree
.
minPM
=
pp
->
tree
.
PM
[
i
];
pp
->
tree
.
minentry
=
i
;
}
}
}
for
(
int
i
=
0
;
i
<
(
pp
->
tree
.
numentries
<<
1
)
-
ne2
;
i
++
)
update_min
(
pp
,
bi
,
i
,(
1
-
betar
[
0
])
>>
1
,
abs_alpha
);
#ifdef DEBUG_NEW_IMPL
// int j;
// for (j=0;j<pp->K;j++) if (pp->Q_I_N[j] == (node->first_leaf_index+1)) break;
printf
(
"Setting bit %d (%d) to %d (LLR %d)
\n
"
,
node
->
first_leaf_index
+
1
,
j
,(
betar
[
0
]
+
1
)
>>
1
,
alpha_r
[
0
]);
//
#endif
#endif
}
}
}
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
6eeafaaf
...
...
@@ -82,6 +82,7 @@ typedef struct decoder_tree_t_s {
uint64_t
decoderout
[
LISTSIZE_MAX
][
4
];
int
numentries
;
int
minentry
;
int
minPM
;
}
decoder_tree_t
;
struct
nrPolar_params
{
...
...
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