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
常顺宇
OpenXG-RAN
Commits
5270d6c4
Commit
5270d6c4
authored
Nov 30, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nr_pdsch' of
https://gitlab.eurecom.fr/oai/openairinterface5g
into nr_pdsch
parents
2afb6ce1
eb381216
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
14 deletions
+89
-14
openair1/PHY/CODING/crc_byte.c
openair1/PHY/CODING/crc_byte.c
+67
-0
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+1
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+18
-12
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+2
-1
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+1
-1
No files found.
openair1/PHY/CODING/crc_byte.c
View file @
5270d6c4
...
...
@@ -257,6 +257,73 @@ unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table
return
crc
;
}
int
check_crc
(
uint8_t
*
decoded_bytes
,
uint32_t
n
,
uint32_t
F
,
uint8_t
crc_type
)
{
uint32_t
crc
,
oldcrc
;
uint8_t
crc_len
,
temp
;
switch
(
crc_type
)
{
case
CRC24_A
:
case
CRC24_B
:
crc_len
=
3
;
break
;
case
CRC16
:
crc_len
=
2
;
break
;
case
CRC8
:
crc_len
=
1
;
break
;
default:
crc_len
=
3
;
}
oldcrc
=
*
((
unsigned
int
*
)(
&
decoded_bytes
[(
n
>>
3
)
-
crc_len
]));
switch
(
crc_type
)
{
case
CRC24_A
:
oldcrc
&=
0x00ffffff
;
crc
=
crc24a
(
&
decoded_bytes
[
F
>>
3
],
n
-
24
-
F
)
>>
8
;
temp
=
((
uint8_t
*
)
&
crc
)[
2
];
((
uint8_t
*
)
&
crc
)[
2
]
=
((
uint8_t
*
)
&
crc
)[
0
];
((
uint8_t
*
)
&
crc
)[
0
]
=
temp
;
break
;
case
CRC24_B
:
oldcrc
&=
0x00ffffff
;
crc
=
crc24b
(
decoded_bytes
,
n
-
24
)
>>
8
;
temp
=
((
uint8_t
*
)
&
crc
)[
2
];
((
uint8_t
*
)
&
crc
)[
2
]
=
((
uint8_t
*
)
&
crc
)[
0
];
((
uint8_t
*
)
&
crc
)[
0
]
=
temp
;
break
;
case
CRC16
:
oldcrc
&=
0x0000ffff
;
crc
=
crc16
(
decoded_bytes
,
n
-
16
)
>>
16
;
break
;
case
CRC8
:
oldcrc
&=
0x000000ff
;
crc
=
crc8
(
decoded_bytes
,
n
-
8
)
>>
24
;
break
;
}
if
(
crc
==
oldcrc
)
return
(
1
);
else
return
(
0
);
}
#ifdef DEBUG_CRC
...
...
openair1/PHY/INIT/nr_init.c
View file @
5270d6c4
...
...
@@ -24,6 +24,7 @@
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
5270d6c4
...
...
@@ -152,7 +152,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
}
dlsch
->
txdataF
[
layer
]
=
(
int32_t
*
)
malloc16
((
NR_MAX_PDSCH_ENCODED_LENGTH
>>
1
)
*
sizeof
(
int32_t
*
));
}
}
for
(
int
q
=
0
;
q
<
NR_MAX_NB_CODEWORDS
;
q
++
)
dlsch
->
mod_symbs
[
q
]
=
(
int32_t
*
)
malloc16
((
NR_MAX_PDSCH_ENCODED_LENGTH
>>
1
)
*
sizeof
(
int32_t
*
));
...
...
@@ -196,7 +196,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(unsigned char Kmimo,
for
(
r
=
0
;
r
<
MAX_NUM_NR_DLSCH_SEGMENTS
/
bw_scaling
;
r
++
)
{
// account for filler in first segment and CRCs for multiple segment case
dlsch
->
harq_processes
[
i
]
->
c
[
r
]
=
(
uint8_t
*
)
malloc16
(
8448
);
dlsch
->
harq_processes
[
i
]
->
d
[
r
]
=
(
uint8_t
*
)
malloc16
(
3
*
8448
);
dlsch
->
harq_processes
[
i
]
->
d
[
r
]
=
(
uint8_t
*
)
malloc16
(
68
*
384
);
if
(
dlsch
->
harq_processes
[
i
]
->
c
[
r
])
{
bzero
(
dlsch
->
harq_processes
[
i
]
->
c
[
r
],
8448
);
}
else
{
...
...
@@ -277,8 +277,8 @@ int nr_dlsch_encoding(unsigned char *a,
nfapi_nr_dl_config_dlsch_pdu_rel15_t
rel15
=
dlsch
->
harq_processes
[
harq_pid
]
->
dlsch_pdu
.
dlsch_pdu_rel15
;
uint16_t
nb_rb
=
rel15
.
n_prb
;
uint8_t
nb_symb_sch
=
rel15
.
nb_symbols
;
uint
16
_t
A
,
Z
;
uint
16
_t
*
pz
=
&
Z
;
uint
32
_t
A
,
Z
;
uint
32
_t
*
pz
=
&
Z
;
uint8_t
mod_order
=
rel15
.
modulation_order
;
uint16_t
Kr
=
0
,
r
,
r_offset
=
0
;
//Kr_bytes
uint8_t
*
d_tmp
[
MAX_NUM_DLSCH_SEGMENTS
];
...
...
@@ -288,8 +288,14 @@ int nr_dlsch_encoding(unsigned char *a,
uint32_t
Tbslbrm
=
950984
;
//max tbs
uint8_t
nb_re_dmrs
=
rel15
.
nb_re_dmrs
;
uint16_t
length_dmrs
=
1
;
uint8_t
*
channel_input
[
MAX_NUM_DLSCH_SEGMENTS
];
//unsigned char
/*
uint8_t *channel_input[MAX_NUM_DLSCH_SEGMENTS]; //unsigned char
for(j=0;j<MAX_NUM_DLSCH_SEGMENTS;j++) {
channel_input[j] = (unsigned char *)malloc16(sizeof(unsigned char) * 68*384);
}
*/
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING
,
VCD_FUNCTION_IN
);
A
=
rel15
.
transport_block_size
;
...
...
@@ -324,12 +330,12 @@ int nr_dlsch_encoding(unsigned char *a,
memcpy
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
a
,(
A
/
8
)
+
4
);
nr_segmentation
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
dlsch
->
harq_processes
[
harq_pid
]
->
c
,
dlsch
->
harq_processes
[
harq_pid
]
->
B
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
C
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
K
,
pz
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
F
);
dlsch
->
harq_processes
[
harq_pid
]
->
c
,
dlsch
->
harq_processes
[
harq_pid
]
->
B
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
C
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
K
,
pz
,
&
dlsch
->
harq_processes
[
harq_pid
]
->
F
);
kb
=
dlsch
->
harq_processes
[
harq_pid
]
->
K
/
(
*
pz
);
if
(
kb
==
22
){
...
...
@@ -347,7 +353,7 @@ int nr_dlsch_encoding(unsigned char *a,
//start_meas(te_stats);
for
(
r
=
0
;
r
<
dlsch
->
harq_processes
[
harq_pid
]
->
C
;
r
++
)
{
d_tmp
[
r
]
=
&
dlsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
0
];
channel_input
[
r
]
=
&
dlsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
0
];
//
channel_input[r] = &dlsch->harq_processes[harq_pid]->d[r][0];
#ifdef DEBUG_DLSCH_CODING
printf
(
"Encoder: B %d F %d
\n
"
,
dlsch
->
harq_processes
[
harq_pid
]
->
B
,
dlsch
->
harq_processes
[
harq_pid
]
->
F
);
printf
(
"start ldpc encoder segment %d/%d
\n
"
,
r
,
dlsch
->
harq_processes
[
harq_pid
]
->
C
);
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
5270d6c4
...
...
@@ -507,8 +507,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
,
p_procTime
);
/*
if (check_crc(llrProcBuf,Kr,crc_type)) {
if (check_crc(llrProcBuf,Kr,
harq_process->F,
crc_type)) {
printf("CRC OK\n");
ret = 2;
}
...
...
openair1/PHY/defs_gNB.h
View file @
5270d6c4
...
...
@@ -113,7 +113,7 @@ typedef struct {
/// Modulated symbols buffer
int32_t
*
mod_symbs
[
NR_MAX_NB_CODEWORDS
];
/// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers?
int32_t
**
ue_spec_bf_weights
[
4
];
int32_t
**
ue_spec_bf_weights
[
NR_MAX_NB_LAYERS
];
/// dl channel estimates (estimated from ul channel estimates)
int32_t
**
calib_dl_ch_estimates
;
/// Allocated RNTI (0 means DLSCH_t is not currently used)
...
...
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