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
canghaiwuhen
OpenXG-RAN
Commits
96009882
Commit
96009882
authored
May 14, 2020
by
OpInConnect_NCTU Terngyin/NY/GK/KM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dual thread for pdsch with pressure test
parent
9a474707
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
300 additions
and
208 deletions
+300
-208
common/utils/LOG/vcd_signal_dumper.c
common/utils/LOG/vcd_signal_dumper.c
+0
-10
common/utils/LOG/vcd_signal_dumper.h
common/utils/LOG/vcd_signal_dumper.h
+0
-10
common/utils/T/T_defs.h
common/utils/T/T_defs.h
+0
-10
openair1/PHY/CODING/nrLDPC_encoder/defs.h
openair1/PHY/CODING/nrLDPC_encoder/defs.h
+0
-10
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+43
-12
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+27
-20
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+7
-10
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+223
-126
No files found.
common/utils/LOG/vcd_signal_dumper.c
View file @
96009882
...
...
@@ -31,16 +31,6 @@
* \warning
*/
/*!\file vcd_signal_dumper.c
* \brief Add some VCD signals of multi_ldpc_encoder
* \author Terngyin, NY, GK, KM (ISIP)
* \email tyhsu@cs.nctu.edu.tw
* \date 07-04-2020
* \version 1.0
* \note
* \warning
*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
...
...
common/utils/LOG/vcd_signal_dumper.h
View file @
96009882
...
...
@@ -32,16 +32,6 @@
* \warning
*/
/*!\file vcd_signal_dumper.h
* \brief Add some VCD signals of multi_ldpc_encoder
* \author Terngyin, NY, GK, KM (ISIP)
* \email tyhsu@cs.nctu.edu.tw
* \date 07-04-2020
* \version 1.0
* \note
* \warning
*/
#ifndef VCD_SIGNAL_DUMPER_H_
#define VCD_SIGNAL_DUMPER_H_
...
...
common/utils/T/T_defs.h
View file @
96009882
...
...
@@ -19,16 +19,6 @@
* contact@openairinterface.org
*/
/*!\file T_defs.h
* \brief Update VCD_NUM_FUNCTIONS and VCD_NUM_VARIABLES
* \author Terngyin, NY, GK, KM (ISIP)
* \email tyhsu@cs.nctu.edu.tw
* \date 07-04-2020
* \version 1.0
* \note
* \warning
*/
#ifndef _T_defs_H_
#define _T_defs_H_
...
...
openair1/PHY/CODING/nrLDPC_encoder/defs.h
View file @
96009882
...
...
@@ -29,16 +29,6 @@
* \warning
*/
/*!\file defs.h
* \brief Declarations of parameters of multi_ldpc_encoder
* \author Terngyin, NY, GK, KM (ISIP)
* \email tyhsu@cs.nctu.edu.tw
* \date 07-04-2020
* \version 1.0
* \note
* \warning
*/
#include "PHY/TOOLS/time_meas.h"
// ==[START]multi_ldpc_encoder
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
96009882
...
...
@@ -30,16 +30,6 @@
* \warning
*/
/*!\file PHY/NR_TRANSPORT/dlsch_decoding.c
* \brief Add triggers for parameterized dual thread
* \author Terngyin, NY, GK, KM (OpInConnect_NCTU)
* \email tyhsu@cs.nctu.edu.tw
* \date 01-05-2020
* \version 1.2
* \note
* \warning
*/
//pipeline scrambling and modulation from Ian
#include "PHY/phy_extern.h"
#include "PHY/defs_gNB.h"
...
...
@@ -124,7 +114,6 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
//printf("rel15->nb_codewords : %d\n", rel15->nb_codewords);
#ifdef DEBUG_DLSCH // ==Show original payload & encoded payload ==***
printf
(
"PDSCH encoding:
\n
Payload:
\n
"
);
uint32_t
encoded_length
=
nb_symbols
*
Qm
;
for
(
int
i
=
0
;
i
<
harq
->
B
>>
7
;
i
++
)
{
for
(
int
j
=
0
;
j
<
16
;
j
++
)
printf
(
"0x%02x
\t
"
,
harq
->
pdu
[(
i
<<
4
)
+
j
]);
...
...
@@ -219,7 +208,7 @@ uint16_t n_RNTI = (pdcch_params.search_space_type == NFAPI_NR_SEARCH_SPACE_TYPE_
uint16_t
Nid
=
(
pdcch_params
.
search_space_type
==
NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
)
?
pdcch_params
.
scrambling_id
:
config
->
sch_config
.
physical_cell_id
.
value
;
printf
(
"================[Scr_Mod]================
\n
"
);
printf
(
" [Movement] [No.] [Round] [Cost time]
\n
"
);
//Get value
//Get value
for dual thread
for
(
int
q
=
0
;
q
<
thread_num_pdsch
;
q
++
){
gNB
->
multi_encoder
[
q
].
f
=
harq
->
f
;
gNB
->
multi_encoder
[
q
].
encoded_length
=
encoded_length
;
...
...
@@ -229,16 +218,58 @@ for (int q=0; q<thread_num_pdsch; q++){
gNB
->
multi_encoder
[
q
].
Qm
=
Qm
;
gNB
->
multi_encoder
[
q
].
mod_symbs
=
mod_symbs
[
q
];
// ==Need to change ==***
}
//Get value for pressure
for
(
int
q
=
0
;
q
<
2
;
q
++
){
//gNB->pressure_test[q].f = harq->f;
gNB
->
pressure_test
[
q
].
encoded_length
=
encoded_length
;
gNB
->
pressure_test
[
q
].
Nid
=
Nid
;
gNB
->
pressure_test
[
q
].
n_RNTI
=
n_RNTI
;
//gNB->pressure_test[q].scrambled_output = scrambled_output[q]; // ==Need to change ==***
gNB
->
pressure_test
[
q
].
Qm
=
Qm
;
//gNB->pressure_test[q].mod_symbs = mod_symbs[q]; // ==Need to change ==***
}
for
(
int
th
=
0
;
th
<
2
;
th
++
){
for
(
int
q
=
0
;
q
<
NR_MAX_NB_CODEWORDS
;
q
++
){
gNB
->
pressure_test
[
th
].
mod_symbs_test
[
q
]
=
(
int32_t
*
)
malloc16
(
NR_MAX_PDSCH_ENCODED_LENGTH
*
sizeof
(
int32_t
));
}
for
(
int
i
=
0
;
i
<
encoded_length
>>
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
gNB
->
pressure_test
[
th
].
f_test
[(
i
<<
3
)
+
j
]
=
harq
->
f
[(
i
<<
3
)
+
j
];
}
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
->
pressure_test
[
th
].
scrambled_output_test
[
q
],
0
,
(
encoded_length
>>
5
)
*
sizeof
(
uint32_t
));
}
//Show value for pressure
// printf("\nEncoded payload:\n");
// for (int i=0; i<10; i++) {
// for (int j=0; j<3; j++)
// printf("%d", harq->f[(i<<3)+j]);
// printf("\t");
// }
// printf("\nEncoded payload:\n");
// for (int i=0; i<10; i++) {
// for (int j=0; j<3; j++)
// printf("%d", gNB->pressure_test[0].f_test[(i<<3)+j]);
// printf("\t");
// }
//Awake threads
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_MULTI_ENC
,
1
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
start_ts
);
//timing
for
(
int
q
=
0
;
q
<
thread_num_pdsch
;
q
++
){
pthread_cond_signal
(
&
(
gNB
->
multi_encoder
[
q
].
cond_scr_mod
));
}
for
(
int
q
=
0
;
q
<
2
;
q
++
){
pthread_cond_signal
(
&
(
gNB
->
pressure_test
[
q
].
cond_scr_mod
));
}
//Wait threads
for
(
int
q
=
0
;
q
<
thread_num_pdsch
;
q
++
){
while
(
gNB
->
multi_encoder
[
q
].
complete_scr_mod
!=
1
);
}
for
(
int
q
=
0
;
q
<
2
;
q
++
){
while
(
gNB
->
pressure_test
[
q
].
complete_scr_mod
!=
1
);
}
clock_gettime
(
CLOCK_MONOTONIC
,
&
end_ts
);
//timing
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_MULTI_ENC
,
0
);
//printf(" Movement No. Round Cost time \n");
printf
(
" Total %.2f usec
\n
"
,
(
end_ts
.
tv_nsec
-
start_ts
.
tv_nsec
)
*
1
.
0
/
1000
);
//[END]multi_genetate_pdsch_proc
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
96009882
...
...
@@ -30,16 +30,6 @@
* \warning
*/
/*!\file PHY/NR_TRANSPORT/dlsch_coding.c
* \brief Add triggers for parameterized dual thread
* \author Terngyin, NY, GK, KM (OpInConnect_NCTU)
* \email tyhsu@cs.nctu.edu.tw
* \date 01-05-2020
* \version 1.2
* \note
* \warning
*/
#include "PHY/defs_gNB.h"
#include "PHY/phy_extern.h"
#include "PHY/CODING/coding_extern.h"
...
...
@@ -459,20 +449,28 @@ int nr_dlsch_encoding(unsigned char *a, //harq->pdu => dlsch->harq_processes[har
gNB
->
multi_encoder
[
th
].
BG
=
BG
;
gNB
->
multi_encoder
[
th
].
n_segments
=
dlsch
->
harq_processes
[
harq_pid
]
->
C
;
}
/*cpy c to c_test*/
// unsigned char bw_scaling =2; // ==Need to change ==***
/*cpy original data to pressure data*/
unsigned
char
bw_scaling
=
2
;
// ==Need to change ==***
// for(int r=0;r<MAX_NUM_NR_DLSCH_SEGMENTS/bw_scaling;r++){
// dlsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(8448);
// dlsch->harq_processes[i]->d[r] = (uint8_t*)malloc16(68*384); //max size for coded output
// }
// for(int th=0;th<thread_num_pdsch;th++){
// 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_encoder[th].c_test[j]=(uint8_t*)malloc16(8448);//(unsigned char *)malloc16(sizeof(unsigned char) * Kr/8);
// gNB->multi_encoder[th].d_test[j]=(uint8_t*)malloc16(68*384);//(unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
// memcpy(gNB->multi_encoder[th].c_test[j], dlsch->harq_processes[harq_pid]->c[j], 8448); // ==Check 8448 ==***
// }
// }
for
(
int
th
=
0
;
th
<
2
;
th
++
){
for
(
int
j
=
0
;
j
<
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
;
j
++
){
// ==Why can not just be MAX_NUM_NR_DLSCH_SEGMENTS ==???
gNB
->
pressure_test
[
th
].
c_test
[
j
]
=
(
uint8_t
*
)
malloc16
(
8448
);
//(unsigned char *)malloc16(sizeof(unsigned char) * Kr/8);
gNB
->
pressure_test
[
th
].
d_test
[
j
]
=
(
uint8_t
*
)
malloc16
(
68
*
384
);
//(unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
memcpy
(
gNB
->
pressure_test
[
th
].
c_test
[
j
],
dlsch
->
harq_processes
[
harq_pid
]
->
c
[
j
],
8448
);
// ==Check 8448 ==***
}
}
for
(
int
th
=
0
;
th
<
2
;
th
++
){
//gNB->pressure_test[th].test_input = dlsch->harq_processes[harq_pid]->c;
//gNB->pressure_test[th].channel_input_optim = dlsch->harq_processes[harq_pid]->d;
gNB
->
pressure_test
[
th
].
Zc
=
*
Zc
;
gNB
->
pressure_test
[
th
].
Kb
=
Kb
;
gNB
->
pressure_test
[
th
].
block_length
=
Kr
;
gNB
->
pressure_test
[
th
].
BG
=
BG
;
gNB
->
pressure_test
[
th
].
n_segments
=
dlsch
->
harq_processes
[
harq_pid
]
->
C
;
}
/*Show c_test*/
// printf("c_test :\n");
// for (int i=0; i<3; i++){
...
...
@@ -485,17 +483,26 @@ int nr_dlsch_encoding(unsigned char *a, //harq->pdu => dlsch->harq_processes[har
// printf("/%p\n", &gNB->multi_encoder[0].c_test[0][i]);
// }
//Awake threads & Wait threads finish
printf
(
"================[Encoder]================
\n
"
);
printf
(
" [Movement] [No.] [Round] [Cost time]
\n
"
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_MULTI_ENC
,
1
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
start_ts
);
//timing
for
(
int
th
=
0
;
th
<
thread_num_pdsch
;
th
++
){
pthread_cond_signal
(
&
(
gNB
->
multi_encoder
[
th
].
cond
));
}
for
(
int
th
=
0
;
th
<
2
;
th
++
){
pthread_cond_signal
(
&
(
gNB
->
pressure_test
[
th
].
cond
));
}
for
(
int
th
=
0
;
th
<
thread_num_pdsch
;
th
++
){
while
(
gNB
->
multi_encoder
[
th
].
complete
!=
1
);
// ==check if multi_ldpc_enc done ==
}
for
(
int
th
=
0
;
th
<
2
;
th
++
){
while
(
gNB
->
pressure_test
[
th
].
complete
!=
1
);
// ==check if multi_ldpc_enc done ==
}
clock_gettime
(
CLOCK_MONOTONIC
,
&
end_ts
);
//timing
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_MULTI_ENC
,
0
);
//printf(" Movement No. Round Cost time \n");
printf
(
" Total %.2f usec
\n
"
,
(
end_ts
.
tv_nsec
-
start_ts
.
tv_nsec
)
*
1
.
0
/
1000
);
// for(int th = 0;th<thread_num_pdsch;th++){
...
...
openair1/PHY/defs_gNB.h
View file @
96009882
...
...
@@ -30,16 +30,6 @@
\warning
*/
/*! \file PHY/defs_gNB.h
* \brief Add thread_num_pdsch to parameterize dual thread
* \author Terngyin, NY, GK, KM (OpInConnect_NCTU)
* \email tyhsu@cs.nctu.edu.tw
* \date 01-05-2020
* \version 1.2
* \note
* \warning
*/
#ifndef __PHY_DEFS_GNB__H__
#define __PHY_DEFS_GNB__H__
...
...
@@ -87,6 +77,12 @@ typedef struct{
uint16_t
Nid
;
uint16_t
n_RNTI
;
uint8_t
Qm
;
/*pressure test*/
uint8_t
*
c_test
[
MAX_NUM_NR_DLSCH_SEGMENTS
];
uint8_t
*
d_test
[
MAX_NUM_NR_DLSCH_SEGMENTS
];
uint8_t
f_test
[
MAX_NUM_NR_CHANNEL_BITS
]
__attribute__
((
aligned
(
32
)));
int32_t
*
mod_symbs_test
[
NR_MAX_NB_CODEWORDS
];
uint32_t
scrambled_output_test
[
NR_MAX_NB_CODEWORDS
][
NR_MAX_PDSCH_ENCODED_LENGTH
>>
5
];
}
multi_ldpc_encoder_gNB
;
typedef
struct
{
...
...
@@ -919,6 +915,7 @@ typedef struct PHY_VARS_gNB_s {
dlsch_encoding_ISIP
thread_encode
[
4
];
ldpc_encoding_ISIP
ldpc_encode
;
multi_ldpc_encoder_gNB
multi_encoder
[
thread_num_pdsch
];
multi_ldpc_encoder_gNB
pressure_test
[
2
];
volatile
uint8_t
complete_encode
[
4
];
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
96009882
This diff is collapsed.
Click to expand it.
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