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
1197c561
Commit
1197c561
authored
Nov 14, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Payload emulation/scrambling update
parent
93641258
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
12 deletions
+24
-12
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+11
-10
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+2
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+1
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+7
-0
openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
+2
-2
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+1
-0
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
1197c561
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include "nr_dci.h"
#include "nr_dci.h"
#include "nr_sch_dmrs.h"
#include "nr_sch_dmrs.h"
//
#define DEBUG_DLSCH
#define DEBUG_DLSCH
//#define DEBUG_DLSCH_MAPPING
//#define DEBUG_DLSCH_MAPPING
uint8_t
mod_order
[
5
]
=
{
1
,
2
,
4
,
6
,
8
};
uint8_t
mod_order
[
5
]
=
{
1
,
2
,
4
,
6
,
8
};
...
@@ -47,18 +47,21 @@ void nr_pdsch_codeword_scrambling(uint8_t *in,
...
@@ -47,18 +47,21 @@ void nr_pdsch_codeword_scrambling(uint8_t *in,
uint32_t
n_RNTI
,
uint32_t
n_RNTI
,
uint32_t
*
out
)
{
uint32_t
*
out
)
{
uint8_t
reset
;
uint8_t
reset
,
b_idx
;
uint32_t
x1
,
x2
,
s
=
0
;
uint32_t
x1
,
x2
,
s
=
0
;
reset
=
1
;
reset
=
1
;
x2
=
(
n_RNTI
<<
15
)
+
(
q
<<
14
)
+
Nid
;
x2
=
(
n_RNTI
<<
15
)
+
(
q
<<
14
)
+
Nid
;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
if
((
i
&
0x1f
)
==
0
)
{
b_idx
=
i
&
0x1f
;
if
(
b_idx
==
0
)
{
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
reset
=
0
;
reset
=
0
;
if
(
i
)
out
++
;
}
}
*
out
^=
((
in
[
i
])
&
1
)
^
((
s
>>
i
)
&
1
)
;
*
out
^=
((
(
in
[
i
])
&
1
)
^
((
s
>>
b_idx
)
&
1
))
<<
b_idx
;
}
}
}
}
...
@@ -209,17 +212,16 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
...
@@ -209,17 +212,16 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
uint16_t
encoded_length
=
nb_symbols
*
Qm
;
uint16_t
encoded_length
=
nb_symbols
*
Qm
;
/// CRC, coding, interleaving and rate matching
/// CRC, coding, interleaving and rate matching
memset
((
void
*
)
harq
->
pdu
,
1
,
(
TBS
>>
3
)
*
sizeof
(
uint8_t
));
nr_dlsch_encoding
(
harq
->
pdu
,
subframe
,
&
dlsch
,
&
frame_parms
);
nr_dlsch_encoding
(
harq
->
pdu
,
subframe
,
&
dlsch
,
&
frame_parms
);
#ifdef DEBUG_DLSCH
#ifdef DEBUG_DLSCH
printf
(
"PDSCH encoding:
\n
Payload:
\n
"
);
printf
(
"PDSCH encoding:
\n
Payload:
\n
"
);
for
(
int
i
=
0
;
i
<
MAX_NR_DLSCH_PAYLOAD_BYTES
>>
4
;
i
++
)
{
for
(
int
i
=
0
;
i
<
TBS
>>
7
;
i
++
)
{
for
(
int
j
=
0
;
j
<
16
;
j
++
)
for
(
int
j
=
0
;
j
<
16
;
j
++
)
printf
(
"0x%02x
\t
"
,
harq
->
pdu
[(
i
<<
4
)
+
j
]);
printf
(
"0x%02x
\t
"
,
harq
->
pdu
[(
i
<<
4
)
+
j
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
printf
(
"
\n
Encoded payload:
\n
"
);
printf
(
"
\n
Encoded payload:
\n
"
);
for
(
int
i
=
0
;
i
<
encoded_length
>>
4
;
i
++
)
{
for
(
int
i
=
0
;
i
<
encoded_length
>>
7
;
i
++
)
{
for
(
int
j
=
0
;
j
<
16
;
j
++
)
for
(
int
j
=
0
;
j
<
16
;
j
++
)
printf
(
"0x%02x
\t
"
,
harq
->
f
[(
i
<<
4
)
+
j
]);
printf
(
"0x%02x
\t
"
,
harq
->
f
[(
i
<<
4
)
+
j
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
@@ -290,8 +292,8 @@ for (int l=0; l<rel15->nb_layers; l++)
...
@@ -290,8 +292,8 @@ for (int l=0; l<rel15->nb_layers; l++)
l0
=
get_l0
(
dmrs_type
,
2
);
//config.pdsch_config.dmrs_typeA_position.value);
l0
=
get_l0
(
dmrs_type
,
2
);
//config.pdsch_config.dmrs_typeA_position.value);
nr_modulation
(
pdsch_dmrs
[
l0
][
0
],
n_dmrs
,
MOD_QPSK
,
mod_dmrs
);
// currently only codeword 0 is modulated
nr_modulation
(
pdsch_dmrs
[
l0
][
0
],
n_dmrs
,
MOD_QPSK
,
mod_dmrs
);
// currently only codeword 0 is modulated
#ifdef DEBUG_DLSCH
#ifdef DEBUG_DLSCH
printf
(
"DMRS modulation (single symbol %d, %d symbols, type %d):
\n
"
,
l0
,
n_dmrs
,
dmrs_type
);
printf
(
"DMRS modulation (single symbol %d, %d symbols, type %d):
\n
"
,
l0
,
n_dmrs
>>
1
,
dmrs_type
);
for
(
int
i
=
0
;
i
<
n_dmrs
>>
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
n_dmrs
>>
4
;
i
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
printf
(
"%d %d
\t
"
,
mod_dmrs
[((
i
<<
3
)
+
j
)
<<
1
],
mod_dmrs
[(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
printf
(
"%d %d
\t
"
,
mod_dmrs
[((
i
<<
3
)
+
j
)
<<
1
],
mod_dmrs
[(((
i
<<
3
)
+
j
)
<<
1
)
+
1
]);
}
}
...
@@ -366,6 +368,5 @@ m, l, k, ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1],
...
@@ -366,6 +368,5 @@ m, l, k, ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1],
}
}
}
}
}
}
return
0
;
return
0
;
}
}
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
View file @
1197c561
...
@@ -95,3 +95,5 @@ int nr_dlsch_encoding(unsigned char *a,
...
@@ -95,3 +95,5 @@ int nr_dlsch_encoding(unsigned char *a,
NR_gNB_DLSCH_t
*
dlsch
,
NR_gNB_DLSCH_t
*
dlsch
,
NR_DL_FRAME_PARMS
*
frame_parms
);
NR_DL_FRAME_PARMS
*
frame_parms
);
void
nr_emulate_dlsch_payload
(
uint8_t
*
payload
,
uint16_t
size
);
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
1197c561
...
@@ -178,6 +178,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
...
@@ -178,6 +178,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
dlsch
->
harq_processes
[
i
]
->
pdu
=
(
uint8_t
*
)
malloc16
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
dlsch
->
harq_processes
[
i
]
->
pdu
=
(
uint8_t
*
)
malloc16
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
if
(
dlsch
->
harq_processes
[
i
]
->
pdu
)
{
if
(
dlsch
->
harq_processes
[
i
]
->
pdu
)
{
bzero
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
bzero
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
);
nr_emulate_dlsch_payload
(
dlsch
->
harq_processes
[
i
]
->
pdu
,
(
MAX_NR_DLSCH_PAYLOAD_BYTES
/
bw_scaling
)
>>
3
);
}
else
{
}
else
{
printf
(
"Can't allocate PDU
\n
"
);
printf
(
"Can't allocate PDU
\n
"
);
exit_flag
=
1
;
exit_flag
=
1
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
View file @
1197c561
...
@@ -237,3 +237,10 @@ void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t p
...
@@ -237,3 +237,10 @@ void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t p
LOG_I
(
PHY
,
"PRG parameters for BWP %d location %d N_RB %d:
\n
"
,
bwp
->
bwp_id
,
bwp
->
location
,
bwp
->
N_RB
);
LOG_I
(
PHY
,
"PRG parameters for BWP %d location %d N_RB %d:
\n
"
,
bwp
->
bwp_id
,
bwp
->
location
,
bwp
->
N_RB
);
LOG_I
(
PHY
,
"P_prime %d
\t
start size %d
\t
endsize %d
\t
N_PRG %d
\n
"
,
prg_parms
->
P_prime
,
prg_parms
->
start_size
,
prg_parms
->
end_size
,
prg_parms
->
N_PRG
);
LOG_I
(
PHY
,
"P_prime %d
\t
start size %d
\t
endsize %d
\t
N_PRG %d
\n
"
,
prg_parms
->
P_prime
,
prg_parms
->
start_size
,
prg_parms
->
end_size
,
prg_parms
->
N_PRG
);
}
}
/// Payload emulation
void
nr_emulate_dlsch_payload
(
uint8_t
*
pdu
,
uint16_t
size
)
{
set_taus_seed
(
0
);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
*
(
pdu
+
i
)
=
(
uint8_t
)
rand
();
}
openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
View file @
1197c561
...
@@ -160,8 +160,6 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
...
@@ -160,8 +160,6 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
TBS
=
(
CEILIDIV
((
Ninfo_prime
+
24
),
8
)
-
24
)
<<
3
;
TBS
=
(
CEILIDIV
((
Ninfo_prime
+
24
),
8
)
-
24
)
<<
3
;
}
}
}
}
LOG_I
(
MAC
,
"TBS %d : N_RE %d N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d Ninfo %d Ninfo_prime %d R %d Qm %d table %d scale %d
\n
"
,
TBS
,
N_RE
,
N_PRB_DMRS
,
N_sh_symb
,
N_PRB_oh
,
Ninfo
,
Ninfo_prime
,
R
,
Qm
,
table_idx
,
scale
);
dlsch_rel15
->
coding_rate
=
R
;
dlsch_rel15
->
coding_rate
=
R
;
dlsch_rel15
->
modulation_order
=
Qm
;
dlsch_rel15
->
modulation_order
=
Qm
;
...
@@ -169,6 +167,8 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
...
@@ -169,6 +167,8 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
dlsch_rel15
->
nb_re_dmrs
=
N_PRB_DMRS
;
dlsch_rel15
->
nb_re_dmrs
=
N_PRB_DMRS
;
dlsch_rel15
->
nb_mod_symbols
=
N_RE_prime
*
dlsch_rel15
->
n_prb
*
dlsch_rel15
->
nb_codewords
;
dlsch_rel15
->
nb_mod_symbols
=
N_RE_prime
*
dlsch_rel15
->
n_prb
*
dlsch_rel15
->
nb_codewords
;
LOG_I
(
MAC
,
"TBS %d : N_RE %d N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d Ninfo %d Ninfo_prime %d R %d Qm %d table %d scale %d nb_symbols %d
\n
"
,
TBS
,
N_RE
,
N_PRB_DMRS
,
N_sh_symb
,
N_PRB_oh
,
Ninfo
,
Ninfo_prime
,
R
,
Qm
,
table_idx
,
scale
,
dlsch_rel15
->
nb_mod_symbols
);
}
}
uint32_t
nr_get_G
(
uint16_t
nb_rb
,
uint16_t
nb_symb_sch
,
uint8_t
nb_re_dmrs
,
uint16_t
length_dmrs
,
uint8_t
Qm
,
uint8_t
Nl
)
{
uint32_t
nr_get_G
(
uint16_t
nb_rb
,
uint16_t
nb_symb_sch
,
uint8_t
nb_re_dmrs
,
uint16_t
length_dmrs
,
uint8_t
Qm
,
uint8_t
Nl
)
{
...
...
openair1/PHY/defs_nr_common.h
View file @
1197c561
...
@@ -90,6 +90,7 @@
...
@@ -90,6 +90,7 @@
#define NR_MAX_NB_CODEWORDS 2
#define NR_MAX_NB_CODEWORDS 2
#define NR_MAX_NB_HARQ_PROCESSES 16
#define NR_MAX_NB_HARQ_PROCESSES 16
#define NR_MAX_PDSCH_ENCODED_LENGTH 950984
#define NR_MAX_PDSCH_ENCODED_LENGTH 950984
#define NR_MAX_PDSCH_TBS 3824
typedef
enum
{
typedef
enum
{
NR_MU_0
=
0
,
NR_MU_0
=
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