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
lizhongxiao
OpenXG-RAN
Commits
a17124a6
Commit
a17124a6
authored
Jun 04, 2020
by
OpInConnect_NCTU Terngyin/NY/GK/KM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integration of dual thread and multi-parallelism threads
parent
d0e4894f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
22 deletions
+67
-22
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+7
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+4
-0
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+6
-0
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+50
-22
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
a17124a6
...
@@ -242,6 +242,10 @@ for(int th=0;th<thread_num_pressure;th++){
...
@@ -242,6 +242,10 @@ for(int th=0;th<thread_num_pressure;th++){
//Get value for multi pdsch
//Get value for multi pdsch
//scrambling
//scrambling
for
(
int
th
=
0
;
th
<
thread_num_scrambling
;
th
++
){
for
(
int
th
=
0
;
th
<
thread_num_scrambling
;
th
++
){
if
(
th
==
0
){
// ==copy original memory space for check ==
gNB
->
multi_pdsch
.
f_first
=
harq
->
f
;
gNB
->
multi_pdsch
.
scrambled_output_first
=
scrambled_output
[
0
];
// ==Need to change ==***
}
for
(
int
i
=
0
;
i
<
encoded_length
>>
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
encoded_length
>>
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
for
(
int
j
=
0
;
j
<
8
;
j
++
)
gNB
->
multi_pdsch
.
f
[
th
][(
i
<<
3
)
+
j
]
=
harq
->
f
[(
i
<<
3
)
+
j
];
gNB
->
multi_pdsch
.
f
[
th
][(
i
<<
3
)
+
j
]
=
harq
->
f
[(
i
<<
3
)
+
j
];
...
@@ -254,6 +258,9 @@ for (int th=0; th<thread_num_scrambling; th++){
...
@@ -254,6 +258,9 @@ for (int th=0; th<thread_num_scrambling; th++){
}
}
//modulation
//modulation
for
(
int
th
=
0
;
th
<
thread_num_modulation
;
th
++
){
for
(
int
th
=
0
;
th
<
thread_num_modulation
;
th
++
){
if
(
th
==
0
){
// ==copy original memory space for check ==
gNB
->
multi_pdsch
.
mod_symbs_first
=
mod_symbs
[
0
];
// ==Need to change ==***
}
for
(
int
q
=
0
;
q
<
rel15
->
nb_codewords
;
q
++
)
// ==Look out!NR_MAX_NB_CODEWORDS is 2!So we can't let q>2 until spec change
for
(
int
q
=
0
;
q
<
rel15
->
nb_codewords
;
q
++
)
// ==Look out!NR_MAX_NB_CODEWORDS is 2!So we can't let q>2 until spec change
memset
((
void
*
)
gNB
->
multi_pdsch
.
scrambled_output_mod
[
th
][
q
],
0
,
(
encoded_length
>>
5
)
*
sizeof
(
uint32_t
));
memset
((
void
*
)
gNB
->
multi_pdsch
.
scrambled_output_mod
[
th
][
q
],
0
,
(
encoded_length
>>
5
)
*
sizeof
(
uint32_t
));
for
(
int
q
=
0
;
q
<
NR_MAX_NB_CODEWORDS
;
q
++
){
for
(
int
q
=
0
;
q
<
NR_MAX_NB_CODEWORDS
;
q
++
){
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
a17124a6
...
@@ -473,6 +473,10 @@ int nr_dlsch_encoding(unsigned char *a, //harq->pdu => dlsch->harq_processes[har
...
@@ -473,6 +473,10 @@ int nr_dlsch_encoding(unsigned char *a, //harq->pdu => dlsch->harq_processes[har
}
}
/*cpy original data to multi pdsch*/
/*cpy original data to multi pdsch*/
for
(
int
th
=
0
;
th
<
thread_num_ldpc_encoder
;
th
++
){
for
(
int
th
=
0
;
th
<
thread_num_ldpc_encoder
;
th
++
){
if
(
th
==
0
){
// ==copy original memory space for check ==
gNB
->
multi_pdsch
.
test_input_first
=
dlsch
->
harq_processes
[
harq_pid
]
->
c
;
gNB
->
multi_pdsch
.
channel_input_optim_first
=
dlsch
->
harq_processes
[
harq_pid
]
->
d
;
}
for
(
int
j
=
0
;
j
<
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
;
j
++
){
// ==Why can not just be MAX_NUM_NR_DLSCH_SEGMENTS ==???
for
(
int
j
=
0
;
j
<
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
;
j
++
){
// ==Why can not just be MAX_NUM_NR_DLSCH_SEGMENTS ==???
gNB
->
multi_pdsch
.
c
[
th
][
j
]
=
(
uint8_t
*
)
malloc16
(
8448
);
//(unsigned char *)malloc16(sizeof(unsigned char) * Kr/8);
gNB
->
multi_pdsch
.
c
[
th
][
j
]
=
(
uint8_t
*
)
malloc16
(
8448
);
//(unsigned char *)malloc16(sizeof(unsigned char) * Kr/8);
gNB
->
multi_pdsch
.
d
[
th
][
j
]
=
(
uint8_t
*
)
malloc16
(
68
*
384
);
//(unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
gNB
->
multi_pdsch
.
d
[
th
][
j
]
=
(
uint8_t
*
)
malloc16
(
68
*
384
);
//(unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
...
...
openair1/PHY/defs_gNB.h
View file @
a17124a6
...
@@ -110,6 +110,12 @@ typedef struct{
...
@@ -110,6 +110,12 @@ typedef struct{
volatile
uint8_t
complete_enc
[
thread_num_ldpc_encoder
];
volatile
uint8_t
complete_enc
[
thread_num_ldpc_encoder
];
volatile
uint8_t
complete_scr
[
thread_num_scrambling
];
volatile
uint8_t
complete_scr
[
thread_num_scrambling
];
volatile
uint8_t
complete_mod
[
thread_num_modulation
];
volatile
uint8_t
complete_mod
[
thread_num_modulation
];
/*memorys of the first thread*/
unsigned
char
**
test_input_first
;
unsigned
char
**
channel_input_optim_first
;
uint8_t
*
f_first
;
uint32_t
*
scrambled_output_first
;
int16_t
*
mod_symbs_first
;
/*encoder*/
/*encoder*/
uint8_t
*
c
[
thread_num_ldpc_encoder
][
MAX_NUM_NR_DLSCH_SEGMENTS
];
uint8_t
*
c
[
thread_num_ldpc_encoder
][
MAX_NUM_NR_DLSCH_SEGMENTS
];
uint8_t
*
d
[
thread_num_ldpc_encoder
][
MAX_NUM_NR_DLSCH_SEGMENTS
];
uint8_t
*
d
[
thread_num_ldpc_encoder
][
MAX_NUM_NR_DLSCH_SEGMENTS
];
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
a17124a6
...
@@ -141,11 +141,11 @@ int32_t nr_segmentation(unsigned char *input_buffer, unsigned char **output_buff
...
@@ -141,11 +141,11 @@ int32_t nr_segmentation(unsigned char *input_buffer, unsigned char **output_buff
int
ldpc_encoder_optim_8seg_multi
(
unsigned
char
**
test_input
,
unsigned
char
**
channel_input
,
int
Zc
,
int
Kb
,
short
block_length
,
short
BG
,
int
n_segments
,
unsigned
int
macro_num
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
);
int
ldpc_encoder_optim_8seg_multi
(
unsigned
char
**
test_input
,
unsigned
char
**
channel_input
,
int
Zc
,
int
Kb
,
short
block_length
,
short
BG
,
int
n_segments
,
unsigned
int
macro_num
,
time_stats_t
*
tinput
,
time_stats_t
*
tprep
,
time_stats_t
*
tparity
,
time_stats_t
*
toutput
);
/*! \file openair1/SIMULATION/NR_PHY/dlsim.c
/*! \file openair1/SIMULATION/NR_PHY/dlsim.c
* \brief
parameterized multi-parallelism threads for pdsch
* \brief
Integration of dual thread and multi-parallelism threads
* \author Terngyin Hsu, Sendren Xu, Nungyi Kuo, Kuankai Hsiung, Kaimi Yang (OpInConnect_NCTU)
* \author Terngyin Hsu, Sendren Xu, Nungyi Kuo, Kuankai Hsiung, Kaimi Yang (OpInConnect_NCTU)
* \email tyhsu@cs.nctu.edu.tw
* \email tyhsu@cs.nctu.edu.tw
* \date
28-05
-2020
* \date
04-06
-2020
* \version 3.
1
* \version 3.
2
* \note
* \note
* \warning
* \warning
*/
*/
...
@@ -375,15 +375,27 @@ static void *multi_ldpc_encoder_proc(int id){
...
@@ -375,15 +375,27 @@ static void *multi_ldpc_encoder_proc(int id){
printf
(
" Active %d(e) %d
\n
"
,
id
,
j
);
printf
(
" Active %d(e) %d
\n
"
,
id
,
j
);
//clock_gettime(CLOCK_MONOTONIC, &start_perpre_ts[id]); //timing
//clock_gettime(CLOCK_MONOTONIC, &start_perpre_ts[id]); //timing
}
}
ldpc_encoder_optim_8seg_multi
(
gNB
->
multi_pdsch
.
c
[
id
],
if
(
id
==
0
){
// ==deal with original memory space for check ==
gNB
->
multi_pdsch
.
d
[
id
],
ldpc_encoder_optim_8seg_multi
(
gNB
->
multi_pdsch
.
test_input_first
,
gNB
->
multi_pdsch
.
Zc
[
id
],
gNB
->
multi_pdsch
.
channel_input_optim_first
,
gNB
->
multi_pdsch
.
Kb
[
id
],
gNB
->
multi_pdsch
.
Zc
[
id
],
gNB
->
multi_pdsch
.
block_length
[
id
],
gNB
->
multi_pdsch
.
Kb
[
id
],
gNB
->
multi_pdsch
.
BG
[
id
],
gNB
->
multi_pdsch
.
block_length
[
id
],
gNB
->
multi_pdsch
.
n_segments
[
id
],
gNB
->
multi_pdsch
.
BG
[
id
],
j
,
gNB
->
multi_pdsch
.
n_segments
[
id
],
NULL
,
NULL
,
NULL
,
NULL
);
j
,
NULL
,
NULL
,
NULL
,
NULL
);
}
else
{
ldpc_encoder_optim_8seg_multi
(
gNB
->
multi_pdsch
.
c
[
id
],
gNB
->
multi_pdsch
.
d
[
id
],
gNB
->
multi_pdsch
.
Zc
[
id
],
gNB
->
multi_pdsch
.
Kb
[
id
],
gNB
->
multi_pdsch
.
block_length
[
id
],
gNB
->
multi_pdsch
.
BG
[
id
],
gNB
->
multi_pdsch
.
n_segments
[
id
],
j
,
NULL
,
NULL
,
NULL
,
NULL
);
}
if
(
check_time
){
if
(
check_time
){
// clock_gettime(CLOCK_MONOTONIC, &end_perpre_ts[id]); //timing
// clock_gettime(CLOCK_MONOTONIC, &end_perpre_ts[id]); //timing
// printf(" Done %d(e) %d %.2f usec\n", id, j, (end_perpre_ts[id].tv_nsec - start_perpre_ts[id].tv_nsec) *1.0 / 1000);
// printf(" Done %d(e) %d %.2f usec\n", id, j, (end_perpre_ts[id].tv_nsec - start_perpre_ts[id].tv_nsec) *1.0 / 1000);
...
@@ -419,12 +431,21 @@ static void *multi_scrambling_proc(int id){
...
@@ -419,12 +431,21 @@ static void *multi_scrambling_proc(int id){
// clock_gettime(CLOCK_MONOTONIC, &start_perpre_ts[id]); //timing
// clock_gettime(CLOCK_MONOTONIC, &start_perpre_ts[id]); //timing
}
}
//if(0){
//if(0){
nr_pdsch_codeword_scrambling
(
gNB
->
multi_pdsch
.
f
[
id
],
if
(
id
==
0
){
// ==deal with original memory space for check ==
gNB
->
multi_pdsch
.
encoded_length_scr
[
id
],
nr_pdsch_codeword_scrambling
(
gNB
->
multi_pdsch
.
f_first
,
q
,
gNB
->
multi_pdsch
.
encoded_length_scr
[
id
],
gNB
->
multi_pdsch
.
Nid
[
id
],
q
,
gNB
->
multi_pdsch
.
n_RNTI
[
id
],
gNB
->
multi_pdsch
.
Nid
[
id
],
gNB
->
multi_pdsch
.
scrambled_output_scr
[
id
]);
gNB
->
multi_pdsch
.
n_RNTI
[
id
],
gNB
->
multi_pdsch
.
scrambled_output_first
);
}
else
{
nr_pdsch_codeword_scrambling
(
gNB
->
multi_pdsch
.
f
[
id
],
gNB
->
multi_pdsch
.
encoded_length_scr
[
id
],
q
,
gNB
->
multi_pdsch
.
Nid
[
id
],
gNB
->
multi_pdsch
.
n_RNTI
[
id
],
gNB
->
multi_pdsch
.
scrambled_output_scr
[
id
]);
}
if
(
check_time
){
if
(
check_time
){
// clock_gettime(CLOCK_MONOTONIC, &end_perpre_ts[id]); //timing
// clock_gettime(CLOCK_MONOTONIC, &end_perpre_ts[id]); //timing
// printf(" Done %d(p) %d %.2f usec\n", id, q, (end_perpre_ts[id].tv_nsec - start_perpre_ts[id].tv_nsec) *1.0 / 1000);
// printf(" Done %d(p) %d %.2f usec\n", id, q, (end_perpre_ts[id].tv_nsec - start_perpre_ts[id].tv_nsec) *1.0 / 1000);
...
@@ -461,10 +482,17 @@ static void *multi_modulation_proc(int id){
...
@@ -461,10 +482,17 @@ static void *multi_modulation_proc(int id){
printf
(
" Active %d(m) %d
\n
"
,
id
,
q
);
printf
(
" Active %d(m) %d
\n
"
,
id
,
q
);
// clock_gettime(CLOCK_MONOTONIC, &start_perpre_ts[id]); //timing
// clock_gettime(CLOCK_MONOTONIC, &start_perpre_ts[id]); //timing
}
}
nr_modulation
(
gNB
->
multi_pdsch
.
scrambled_output_mod
[
id
],
if
(
id
==
0
){
// ==deal with original memory space for check ==
gNB
->
multi_pdsch
.
encoded_length_mod
[
id
],
nr_modulation
(
gNB
->
multi_pdsch
.
scrambled_output_first
,
gNB
->
multi_pdsch
.
Qm
[
id
],
gNB
->
multi_pdsch
.
encoded_length_mod
[
id
],
*
gNB
->
multi_pdsch
.
mod_symbs
[
id
]);
//gNB->pressure_test[id].mod_symbs_test);
gNB
->
multi_pdsch
.
Qm
[
id
],
gNB
->
multi_pdsch
.
mod_symbs_first
);
}
else
{
nr_modulation
(
gNB
->
multi_pdsch
.
scrambled_output_mod
[
id
],
gNB
->
multi_pdsch
.
encoded_length_mod
[
id
],
gNB
->
multi_pdsch
.
Qm
[
id
],
*
gNB
->
multi_pdsch
.
mod_symbs
[
id
]);
//gNB->pressure_test[id].mod_symbs_test);
}
if
(
check_time
){
if
(
check_time
){
// clock_gettime(CLOCK_MONOTONIC, &end_perpre_ts[id]); //timing
// clock_gettime(CLOCK_MONOTONIC, &end_perpre_ts[id]); //timing
// printf(" Done %d(p) %d %.2f usec\n", id, q, (end_perpre_ts[id].tv_nsec - start_perpre_ts[id].tv_nsec) *1.0 / 1000);
// printf(" Done %d(p) %d %.2f usec\n", id, q, (end_perpre_ts[id].tv_nsec - start_perpre_ts[id].tv_nsec) *1.0 / 1000);
...
...
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