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
eb381216
Commit
eb381216
authored
Nov 30, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding check_crc. to be tested
parent
a06671df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
openair1/PHY/CODING/crc_byte.c
openair1/PHY/CODING/crc_byte.c
+67
-0
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+2
-1
No files found.
openair1/PHY/CODING/crc_byte.c
View file @
eb381216
...
@@ -257,6 +257,73 @@ unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table
...
@@ -257,6 +257,73 @@ unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table
return
crc
;
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
#ifdef DEBUG_CRC
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
eb381216
...
@@ -507,8 +507,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
...
@@ -507,8 +507,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
(
int8_t
*
)
&
pl
[
0
],
(
int8_t
*
)
&
pl
[
0
],
llrProcBuf
,
llrProcBuf
,
p_procTime
);
p_procTime
);
/*
/*
if (check_crc(llrProcBuf,Kr,crc_type)) {
if (check_crc(llrProcBuf,Kr,
harq_process->F,
crc_type)) {
printf("CRC OK\n");
printf("CRC OK\n");
ret = 2;
ret = 2;
}
}
...
...
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