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
zzha zzha
OpenXG-RAN
Commits
c548f425
Commit
c548f425
authored
Sep 04, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nr-pdsch' into nr_pdsch
parents
261b586e
714cdc09
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
91 deletions
+129
-91
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+12
-1
openair1/PHY/CODING/TESTBENCH/ldpctest.c
openair1/PHY/CODING/TESTBENCH/ldpctest.c
+76
-63
openair1/PHY/CODING/nrLDPC_encoder/defs.h
openair1/PHY/CODING/nrLDPC_encoder/defs.h
+13
-1
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
+3
-3
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
+10
-14
openair1/PHY/CODING/nrLDPC_encoder/ldpc_generate_coefficient.c
...ir1/PHY/CODING/nrLDPC_encoder/ldpc_generate_coefficient.c
+15
-9
No files found.
cmake_targets/CMakeLists.txt
View file @
c548f425
...
...
@@ -1143,7 +1143,13 @@ set(PHY_POLARSRC
)
set
(
PHY_TURBOIF
${
OPENAIR1_DIR
}
/PHY/CODING/coding_load.c
)
)
set
(
PHY_LDPCSRC
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_encoder/ldpc_generate_coefficient.c
)
add_library
(
coding MODULE
${
PHY_TURBOSRC
}
)
...
...
@@ -1298,6 +1304,7 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/TOOLS/time_meas.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lut.c
${
PHY_POLARSRC
}
${
PHY_LDPCSRC
}
)
set
(
PHY_NR_UE_SRC
...
...
@@ -1335,6 +1342,7 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/TOOLS/lut.c
${
OPENAIR1_DIR
}
/PHY/INIT/nr_init_ue.c
${
PHY_POLARSRC
}
${
PHY_LDPCSRC
}
)
...
...
@@ -2557,6 +2565,9 @@ target_link_libraries (dlsim_tm4
add_executable
(
polartest
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/polartest.c
)
target_link_libraries
(
polartest m SIMU PHY PHY_NR PHY_COMMON -lm
${
ATLAS_LIBRARIES
}
)
add_executable
(
ldpctest
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/ldpctest.c
)
target_link_libraries
(
ldpctest m SIMU PHY PHY_NR
${
ATLAS_LIBRARIES
}
)
foreach
(
myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim
)
add_executable
(
${
myExe
}
...
...
openair1/PHY/CODING/TESTBENCH/ldpctest.c
View file @
c548f425
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrLDPC_encoder/defs.h
View file @
c548f425
...
...
@@ -31,6 +31,18 @@
#include "PHY/TOOLS/time_meas.h"
/*ldpc_encoder.c*/
int
encode_parity_check_part_orig
(
unsigned
char
*
c
,
unsigned
char
*
d
,
short
BG
,
short
Zc
,
short
Kb
,
short
block_length
);
/*ldpc_encoder2.c*/
void
encode_parity_check_part_optim
(
uint8_t
*
c
,
uint8_t
*
d
,
short
BG
,
short
Zc
,
short
Kb
);
int
ldpc_encoder_optim
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
short
BG
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
);
int
ldpc_encoder_optim_8seg
(
unsigned
char
**
test_input
,
unsigned
char
**
channel_input
,
short
block_length
,
short
BG
,
int
n_segments
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
);
/*ldpc_generate_coefficient.c*/
int
ldpc_encoder_orig
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
short
BG
,
unsigned
char
gen_code
);
/*
int encode_parity_check_part(unsigned char *c,unsigned char *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, double rate);
...
...
@@ -38,4 +50,4 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
int ldpc_encoder_multi_segment(unsigned char **test_input,unsigned char **channel_input,short block_length,double rate,uint8_t n_segments);
int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,short block_length,int nom_rate,int denom_rate,time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput);
int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_input,short block_length,int nom_rate,int denom_rate,int n_segments,time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput);
*/
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
View file @
c548f425
...
...
@@ -50,14 +50,14 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
int
i1
,
i2
,
i3
,
i4
,
i5
,
temp_prime
;
unsigned
char
channel_temp
,
temp
;
//
if (BG==1)
if
(
BG
==
1
)
{
no_shift_values
=
(
short
*
)
no_shift_values_BG1
;
pointer_shift_values
=
(
short
*
)
pointer_shift_values_BG1
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
}
/*
else if (BG==2)
else
if
(
BG
==
2
)
{
no_shift_values
=
(
short
*
)
no_shift_values_BG2
;
pointer_shift_values
=
(
short
*
)
pointer_shift_values_BG2
;
...
...
@@ -68,7 +68,7 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
printf
(
"problem with BG
\n
"
);
return
(
-
1
);
}
*/
no_punctured_columns
=
(
int
)((
nrows
-
2
)
*
Zc
+
block_length
-
block_length
*
3
)
/
Zc
;
...
...
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c
View file @
c548f425
...
...
@@ -198,10 +198,10 @@ void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,sho
}
int
ldpc_encoder_optim
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
int
nom_rate
,
int
denom_rate
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
)
int
ldpc_encoder_optim
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
short
BG
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
)
{
short
BG
,
Zc
,
Kb
,
nrows
,
ncols
;
short
Kb
,
Zc
,
nrows
,
ncols
;
int
i
,
i1
;
int
no_punctured_columns
,
removed_bit
;
...
...
@@ -211,16 +211,14 @@ 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
)
if
(
BG
==
1
)
{
BG
=
1
;
Kb
=
22
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
}
/*else if (block_length<=3840
)
else
if
(
BG
==
2
)
{
BG=2;
nrows
=
42
;
//parity check bits
ncols
=
10
;
// info bits
...
...
@@ -232,7 +230,7 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh
Kb
=
8
;
else
Kb
=
6
;
}*/
}
//find minimum value in all sets of lifting size
Zc
=
0
;
...
...
@@ -315,10 +313,10 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh
return
0
;
}
int
ldpc_encoder_optim_8seg
(
unsigned
char
**
test_input
,
unsigned
char
**
channel_input
,
short
block_length
,
int
nom_rate
,
int
denom_rate
,
int
n_segments
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
)
int
ldpc_encoder_optim_8seg
(
unsigned
char
**
test_input
,
unsigned
char
**
channel_input
,
short
block_length
,
short
BG
,
int
n_segments
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
)
{
short
BG
,
Zc
,
Kb
,
nrows
,
ncols
;
short
Kb
,
Zc
,
nrows
,
ncols
;
int
i
,
i1
,
j
;
int
no_punctured_columns
,
removed_bit
;
//Table of possible lifting sizes
...
...
@@ -345,16 +343,14 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i
AssertFatal
(
n_segments
>
0
&&
n_segments
<=
8
,
"0 < n_segments %d <= 8
\n
"
,
n_segments
);
//determine number of bits in codeword
//if (block_length>3840
)
if
(
BG
==
1
)
{
BG
=
1
;
Kb
=
22
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
}
/*else if (block_length<=3840
)
else
if
(
BG
==
2
)
{
BG=2;
nrows
=
42
;
//parity check bits
ncols
=
10
;
// info bits
...
...
@@ -366,7 +362,7 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i
Kb
=
8
;
else
Kb
=
6
;
}*/
}
//find minimum value in all sets of lifting size
Zc
=
0
;
...
...
openair1/PHY/CODING/nrLDPC_encoder/ldpc_generate_coefficient.c
View file @
c548f425
...
...
@@ -361,13 +361,13 @@ short *choose_generator_matrix(short BG,short Zc)
return
Gen_shift_values
;
}
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_orig
(
unsigned
char
*
test_input
,
unsigned
char
*
channel_input
,
short
block_length
,
short
BG
,
unsigned
char
gen_code
)
{
unsigned
char
c
[
22
*
384
];
//padded input, unpacked, max size
unsigned
char
d
[
68
*
384
];
//coded output, unpacked, max size
unsigned
char
channel_temp
,
temp
;
short
*
Gen_shift_values
,
*
no_shift_values
,
*
pointer_shift_values
;
short
BG
,
Zc
,
Kb
,
nrows
,
ncols
;
short
Zc
,
Kb
,
nrows
,
ncols
;
int
i
,
i1
,
i2
,
i3
,
i4
,
i5
,
temp_prime
,
var
;
int
no_punctured_columns
,
removed_bit
;
//Table of possible lifting sizes
...
...
@@ -378,16 +378,14 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
int
indlist2
[
1000
];
//determine number of bits in codeword
//if (block_length>3840
)
if
(
BG
==
1
)
{
BG
=
1
;
Kb
=
22
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
}
/*else if (block_length<=3840
)
else
if
(
BG
==
2
)
{
BG=2;
nrows
=
42
;
//parity check bits
ncols
=
10
;
// info bits
...
...
@@ -399,7 +397,7 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
Kb
=
8
;
else
Kb
=
6
;
}*/
}
//find minimum value in all sets of lifting size
Zc
=
0
;
...
...
@@ -417,6 +415,8 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
return
(
-
1
);
}
int
K
=
ncols
*
Zc
;
Gen_shift_values
=
choose_generator_matrix
(
BG
,
Zc
);
if
(
Gen_shift_values
==
NULL
)
{
printf
(
"ldpc_encoder_orig: could not find generator matrix
\n
"
);
...
...
@@ -438,9 +438,15 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
}
no_punctured_columns
=
(
int
)((
nrows
-
2
)
*
Zc
+
block_length
-
block_length
*
3
)
/
Zc
;
//nrows - no_punctured_columns = 2 +2*block_length/Zc
removed_bit
=
(
nrows
-
no_punctured_columns
-
2
)
*
Zc
+
block_length
-
(
block_length
*
3
);
// ((nrows-no_punctured_columns) * Zc-removed_bit) =
// 2Zc + 2*block_length
//printf("%d\n",no_punctured_columns);
//printf("%d\n",removed_bit);
//printf("%d\n",nrows-no_punctured_columns);
//printf("%d\n",((nrows-no_punctured_columns) * Zc-removed_bit));
// unpack input
memset
(
c
,
0
,
sizeof
(
unsigned
char
)
*
ncols
*
Zc
);
memset
(
d
,
0
,
sizeof
(
unsigned
char
)
*
nrows
*
Zc
);
...
...
@@ -608,8 +614,8 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,sho
}
// information part and puncture columns
memcpy
(
&
channel_input
[
0
],
&
c
[
2
*
Zc
],
(
block_length
-
2
*
Zc
)
*
sizeof
(
unsigned
char
));
memcpy
(
&
channel_input
[
block_length
-
2
*
Zc
],
&
d
[
0
],
((
nrows
-
no_punctured_columns
)
*
Zc
-
removed_bit
)
*
sizeof
(
unsigned
char
));
memcpy
(
&
channel_input
[
0
],
&
c
[
2
*
Zc
],
(
block_length
-
2
*
Zc
)
*
sizeof
(
unsigned
char
));
//systematic bits
memcpy
(
&
channel_input
[
block_length
-
2
*
Zc
],
&
d
[
0
],
((
nrows
-
no_punctured_columns
)
*
Zc
-
removed_bit
)
*
sizeof
(
unsigned
char
));
//systematic bits 2Zc + 2*block_length
//memcpy(channel_input,c,Kb*Zc*sizeof(unsigned char));
return
0
;
}
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