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
75684d75
Commit
75684d75
authored
Feb 05, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrating SIMD optimized LDPC encoder
parent
fbfe950c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
46 deletions
+63
-46
openair1/PHY/CODING/defs.h
openair1/PHY/CODING/defs.h
+1
-0
openair1/PHY/CODING/ldpc_encoder2.c
openair1/PHY/CODING/ldpc_encoder2.c
+53
-41
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+2
-1
openair1/PHY/TOOLS/time_meas.c
openair1/PHY/TOOLS/time_meas.c
+2
-2
openair1/PHY/TOOLS/time_meas.h
openair1/PHY/TOOLS/time_meas.h
+5
-2
No files found.
openair1/PHY/CODING/defs.h
View file @
75684d75
...
...
@@ -573,6 +573,7 @@ void phy_viterbi_dot11(int8_t *,uint8_t *,uint16_t);
short
*
ldpc_decoder
(
short
*
msgChannel
,
short
block_length
,
short
No_iteration
,
double
rate
);
int
encode_parity_check_part
(
uint16_t
*
c
,
uint16_t
*
d
,
short
BG
,
short
Zc
,
short
Kb
);
int
encode_parity_check_part_orig
(
unsigned
char
*
c
,
unsigned
char
*
d
,
short
BG
,
short
Zc
,
short
Kb
,
short
block_length
);
int
ldpc_encoder
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
int
nom_rate
,
int
denom_rate
);
int
ldpc_encoder_orig
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
int
nom_rate
,
int
denom_rate
,
unsigned
char
gen_code
);
int
ldpc_encoder_multi_segment
(
unsigned
char
**
test_input
,
unsigned
char
**
channel_input
,
short
block_length
,
double
rate
,
uint8_t
n_segments
);
...
...
openair1/PHY/CODING/ldpc_encoder2.c
View file @
75684d75
...
...
@@ -94,30 +94,28 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh
int
simd_size
;
//determine number of bits in codeword
//if (block_length>3840)
//{
AssertFatal
(
block_length
>
3840
,
"Block length < 3840 not supported yet
\n
"
);
BG
=
1
;
Kb
=
22
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
//}
/* else if (block_length<=3840)
{
BG=2;
nrows=42; //parity check bits
ncols=10; // info bits
if (block_length>640)
Kb = 10;
else if (block_length>560)
Kb = 9;
else if (block_length>192)
if
(
block_length
>
3840
)
{
BG
=
1
;
Kb
=
22
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
}
else
if
(
block_length
<=
3840
)
{
BG
=
2
;
nrows
=
42
;
//parity check bits
ncols
=
10
;
// info bits
if
(
block_length
>
640
)
Kb
=
10
;
else
if
(
block_length
>
560
)
Kb
=
9
;
else
if
(
block_length
>
192
)
Kb
=
8
;
else
Kb
=
6
;
} */
}
//find minimum value in all sets of lifting size
Zc
=
0
;
...
...
@@ -155,28 +153,42 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh
//c[i]=c[i]>>7&1;
c
[
i
]
=
(
test_input
[
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
}
stop_meas
(
tinput
);
// extend matrix
start_meas
(
tprep
);
for
(
i1
=
0
;
i1
<
ncols
;
i1
++
)
{
memcpy
(
&
c_extension
[
2
*
i1
*
Zc
],
&
c
[
i1
*
Zc
],
Zc
*
sizeof
(
unsigned
char
));
memcpy
(
&
c_extension
[(
2
*
i1
+
1
)
*
Zc
],
&
c
[
i1
*
Zc
],
Zc
*
sizeof
(
unsigned
char
));
stop_meas
(
tinput
);
if
(
BG
==
1
)
{
// extend matrix
start_meas
(
tprep
);
for
(
i1
=
0
;
i1
<
ncols
;
i1
++
)
{
memcpy
(
&
c_extension
[
2
*
i1
*
Zc
],
&
c
[
i1
*
Zc
],
Zc
*
sizeof
(
unsigned
char
));
memcpy
(
&
c_extension
[(
2
*
i1
+
1
)
*
Zc
],
&
c
[
i1
*
Zc
],
Zc
*
sizeof
(
unsigned
char
));
}
for
(
i1
=
1
;
i1
<
simd_size
;
i1
++
)
{
memcpy
(
&
c_extension
[(
2
*
ncols
*
Zc
*
i1
)],
&
c_extension
[
i1
],
(
2
*
ncols
*
Zc
*
sizeof
(
unsigned
char
))
-
i1
);
// memset(&c_extension[(2*ncols*Zc*i1)],0,i1);
/*
printf("shift %d: ",i1);
for (int j=0;j<64;j++) printf("%d ",c_extension[(2*ncols*Zc*i1)+j]);
printf("\n");
*/
}
stop_meas
(
tprep
);
//parity check part
start_meas
(
tparity
);
encode_parity_check_part_optim
(
c_extension
,
d
,
BG
,
Zc
,
Kb
);
stop_meas
(
tparity
);
}
for
(
i1
=
1
;
i1
<
simd_size
;
i1
++
)
{
memcpy
(
&
c_extension
[(
2
*
ncols
*
Zc
*
i1
)],
&
c_extension
[
i1
],
(
2
*
ncols
*
Zc
*
sizeof
(
unsigned
char
))
-
i1
);
// memset(&c_extension[(2*ncols*Zc*i1)],0,i1);
/*
printf("shift %d: ",i1);
for (int j=0;j<64;j++) printf("%d ",c_extension[(2*ncols*Zc*i1)+j]);
printf("\n");
*/
else
if
(
BG
==
2
)
{
if
(
encode_parity_check_part_orig
(
c
,
d
,
BG
,
Zc
,
Kb
,
block_length
)
!=
0
)
{
printf
(
"Problem with encoder
\n
"
);
return
(
-
1
);
}
}
stop_meas
(
tprep
);
//parity check part
start_meas
(
tparity
);
encode_parity_check_part_optim
(
c_extension
,
d
,
BG
,
Zc
,
Kb
);
stop_meas
(
tparity
);
else
{
printf
(
"Problem with encoder
\n
"
);
return
(
-
1
);
}
start_meas
(
toutput
);
// information part and puncture columns
memcpy
(
&
channel_input
[
0
],
&
c
[
2
*
Zc
],
(
block_length
-
2
*
Zc
)
*
sizeof
(
unsigned
char
));
...
...
openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
View file @
75684d75
...
...
@@ -905,7 +905,8 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
start_meas
(
te_stats
);
memset
(
dlsch
->
harq_processes
[
harq_pid
]
->
d
[
r
],
0
,(
96
+
12
+
3
+
3
*
8448
)
*
sizeof
(
uint8_t
));
ldpc_encoder
((
unsigned
char
*
)
dlsch
->
harq_processes
[
harq_pid
]
->
c
[
r
],(
unsigned
char
*
)
&
dlsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
96
],
Kr
,
1
,
3
);
//ldpc_encoder((unsigned char*)dlsch->harq_processes[harq_pid]->c[r],(unsigned char*)&dlsch->harq_processes[harq_pid]->d[r][96],Kr,1,3);
ldpc_encoder_optim
((
unsigned
char
*
)
dlsch
->
harq_processes
[
harq_pid
]
->
c
[
r
],(
unsigned
char
*
)
&
dlsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
96
],
Kr
,
1
,
3
,
NULL
,
NULL
,
NULL
,
NULL
);
stop_meas
(
te_stats
);
#endif
...
...
openair1/PHY/TOOLS/time_meas.c
View file @
75684d75
...
...
@@ -43,7 +43,7 @@ double get_cpu_freq_GHz(void) {
void
print_meas_now
(
time_stats_t
*
ts
,
const
char
*
name
,
FILE
*
file_name
){
if
(
opp_enabled
)
{
if
(
opp_enabled
&&
ts
)
{
//static double cpu_freq_GHz = 3.2;
...
...
@@ -62,7 +62,7 @@ void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
void
print_meas
(
time_stats_t
*
ts
,
const
char
*
name
,
time_stats_t
*
total_exec_time
,
time_stats_t
*
sf_exec_time
)
{
if
(
opp_enabled
)
{
if
(
opp_enabled
&&
ts
)
{
static
int
first_time
=
0
;
static
double
cpu_freq_GHz
=
0
.
0
;
...
...
openair1/PHY/TOOLS/time_meas.h
View file @
75684d75
...
...
@@ -98,7 +98,7 @@ static inline uint32_t rdtsc_oai(void)
static
inline
void
start_meas
(
time_stats_t
*
ts
)
{
if
(
opp_enabled
)
{
if
(
opp_enabled
&&
ts
)
{
if
(
ts
->
meas_flag
==
0
)
{
ts
->
trials
++
;
ts
->
in
=
rdtsc_oai
();
...
...
@@ -113,7 +113,7 @@ static inline void start_meas(time_stats_t *ts)
static
inline
void
stop_meas
(
time_stats_t
*
ts
)
{
if
(
opp_enabled
)
{
if
(
opp_enabled
&&
ts
)
{
long
long
out
=
rdtsc_oai
();
ts
->
diff_now
=
(
out
-
ts
->
in
);
...
...
@@ -133,6 +133,8 @@ static inline void stop_meas(time_stats_t *ts)
static
inline
void
reset_meas
(
time_stats_t
*
ts
)
{
if
(
ts
)
{
ts
->
trials
=
0
;
ts
->
diff
=
0
;
ts
->
diff_now
=
0
;
...
...
@@ -141,6 +143,7 @@ static inline void reset_meas(time_stats_t *ts) {
ts
->
max
=
0
;
ts
->
meas_flag
=
0
;
}
}
static
inline
void
copy_meas
(
time_stats_t
*
dst_ts
,
time_stats_t
*
src_ts
)
...
...
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