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
391b73c4
Commit
391b73c4
authored
5 years ago
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding the option of 16 bit crc at gNB
parent
3a5d27c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
16 deletions
+31
-16
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+31
-16
No files found.
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
391b73c4
...
@@ -326,32 +326,47 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
...
@@ -326,32 +326,47 @@ int nr_dlsch_encoding(unsigned char *a,int frame,
printf("%02x.",a[i]);
printf("%02x.",a[i]);
printf("\n");
printf("\n");
*/
*/
// Add 24-bit crc (polynomial A) to payload
crc
=
crc24a
(
a
,
A
)
>>
8
;
if
(
A
>
3824
)
{
a
[
A
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
2
];
// Add 24-bit crc (polynomial A) to payload
a
[
1
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
1
];
crc
=
crc24a
(
a
,
A
)
>>
8
;
a
[
2
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
a
[
A
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
2
];
//printf("CRC %x (A %d)\n",crc,A);
a
[
1
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
1
];
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
a
[
2
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
//printf("CRC %x (A %d)\n",crc,A);
dlsch
->
harq_processes
[
harq_pid
]
->
B
=
A
+
24
;
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
// dlsch->harq_processes[harq_pid]->b = a;
dlsch
->
harq_processes
[
harq_pid
]
->
B
=
A
+
24
;
// dlsch->harq_processes[harq_pid]->b = a;
AssertFatal
((
A
/
8
)
+
4
<=
MAX_DLSCH_PAYLOAD_BYTES
,
"A %d is too big (A/8+4 = %d > %d)
\n
"
,
A
,(
A
/
8
)
+
4
,
MAX_DLSCH_PAYLOAD_BYTES
);
AssertFatal
((
A
/
8
)
+
4
<=
MAX_DLSCH_PAYLOAD_BYTES
,
"A %d is too big (A/8+4 = %d > %d)
\n
"
,
A
,(
A
/
8
)
+
4
,
MAX_DLSCH_PAYLOAD_BYTES
);
memcpy
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
a
,(
A
/
8
)
+
4
);
memcpy
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
a
,(
A
/
8
)
+
4
);
// why is this +4 if the CRC is only 3 bytes?
}
else
{
// Add 16-bit crc (polynomial A) to payload
crc
=
crc16
(
a
,
A
)
>>
16
;
a
[
A
>>
3
]
=
((
uint8_t
*
)
&
crc
)[
1
];
a
[
1
+
(
A
>>
3
)]
=
((
uint8_t
*
)
&
crc
)[
0
];
//printf("CRC %x (A %d)\n",crc,A);
//printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]);
dlsch
->
harq_processes
[
harq_pid
]
->
B
=
A
+
16
;
// dlsch->harq_processes[harq_pid]->b = a;
AssertFatal
((
A
/
8
)
+
3
<=
MAX_DLSCH_PAYLOAD_BYTES
,
"A %d is too big (A/8+3 = %d > %d)
\n
"
,
A
,(
A
/
8
)
+
3
,
MAX_DLSCH_PAYLOAD_BYTES
);
memcpy
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
a
,(
A
/
8
)
+
3
);
// using 3 bytes to mimic the case of 24 bit crc
}
if
(
R
<
1000
)
if
(
R
<
1000
)
Coderate
=
(
float
)
R
/
(
float
)
1024
;
Coderate
=
(
float
)
R
/
(
float
)
1024
;
else
// to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools
else
// to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools
Coderate
=
(
float
)
R
/
(
float
)
2048
;
Coderate
=
(
float
)
R
/
(
float
)
2048
;
if
((
A
<=
292
)
||
((
A
<=
3824
)
&&
(
Coderate
<=
0
.
6667
))
||
Coderate
<=
0
.
25
)
{
if
((
A
<=
292
)
||
((
A
<=
3824
)
&&
(
Coderate
<=
0
.
6667
))
||
Coderate
<=
0
.
25
)
BG
=
2
;
BG
=
2
;
}
else
else
{
BG
=
1
;
BG
=
1
;
}
nr_segmentation
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
nr_segmentation
(
dlsch
->
harq_processes
[
harq_pid
]
->
b
,
dlsch
->
harq_processes
[
harq_pid
]
->
c
,
dlsch
->
harq_processes
[
harq_pid
]
->
c
,
...
...
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