Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Embedded Acceleration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vipin Thomas
Embedded Acceleration
Commits
fc50dcb0
Commit
fc50dcb0
authored
3 years ago
by
Vipin Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Update pixel.cpp
parent
c170036e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pixel.cpp
+17
-18
17 additions, 18 deletions
pixel.cpp
with
17 additions
and
18 deletions
pixel.cpp
+
17
−
18
View file @
fc50dcb0
...
@@ -21,24 +21,22 @@ int convertBinInt(long long n);
...
@@ -21,24 +21,22 @@ int convertBinInt(long long n);
void
decrypt
(
int
data
);
void
decrypt
(
int
data
);
void
toAscii
(
char
*
c
);
void
toAscii
(
char
*
c
);
int
getDecimal
(
int
n
);
int
getDecimal
(
int
n
);
pkt_t
tmpA
;
void
pixel
(
ap_int
<
32
>
&
in_decimal
,
void
pixel
(
ap_int
<
32
>
&
in_decimal
,
ap_int
<
32
>
selector
,
ap_int
<
32
>
selector
,
ap_int
<
32
>
position1
,
ap_int
<
32
>
stream_count
,
ap_int
<
32
>
position2
,
hls
::
stream
<
pkt_t
>
&
din
,
hls
::
stream
<
pkt_t
>
&
din
,
hls
::
stream
<
pkt_t
>
&
dout
hls
::
stream
<
pkt_t
>
&
dout
)
{
)
{
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE s_axilite port=in_decimal
#pragma HLS INTERFACE s_axilite port=in_decimal
#pragma HLS INTERFACE s_axilite port=selector
#pragma HLS INTERFACE s_axilite port=selector
#pragma HLS INTERFACE s_axilite port=position1
#pragma HLS INTERFACE s_axilite port=stream_count
#pragma HLS INTERFACE s_axilite port=position2
#pragma HLS INTERFACE axis port=din
#pragma HLS INTERFACE axis port=din
#pragma HLS INTERFACE axis port=dout
#pragma HLS INTERFACE axis port=dout
pkt_t
pkt
=
din
.
read
()
;
din
>>
tmpA
;
// toAscii(key);
// toAscii(key);
switch
(
selector
)
switch
(
selector
)
{
{
...
@@ -49,7 +47,6 @@ void pixel(ap_int<32> &in_decimal,
...
@@ -49,7 +47,6 @@ void pixel(ap_int<32> &in_decimal,
decNum
=
in_decimal
;
decNum
=
in_decimal
;
}
}
//123456321
//123456321
if
((
count_streams
>=
(
position1
-
1
))
&&
(
count_streams
<
position2
)){
// addNum=0;
// addNum=0;
addNum
=
0
;
addNum
=
0
;
if
(
decimalCounter
%
8
==
0
){
if
(
decimalCounter
%
8
==
0
){
...
@@ -67,24 +64,21 @@ void pixel(ap_int<32> &in_decimal,
...
@@ -67,24 +64,21 @@ void pixel(ap_int<32> &in_decimal,
// decNum = decNum/1000;
// decNum = decNum/1000;
// }
// }
if
(
pkt
.
data
%
2
==
0
&&
addNum
==
1
){
if
(
tmpA
.
data
%
2
==
0
&&
addNum
==
1
){
pkt
.
data
+=
1
;
tmpA
.
data
+=
1
;
}
else
if
(
pkt
.
data
%
2
!=
0
&&
addNum
==
0
){
}
else
if
(
tmpA
.
data
%
2
!=
0
&&
addNum
==
0
){
pkt
.
data
-=
1
;
tmpA
.
data
-=
1
;
}
}
decimalCounter
++
;
decimalCounter
++
;
}
break
;
break
;
case
1
:
case
1
:
if
((
count_streams
>=
(
position1
-
1
))
&&
(
count_streams
<
position2
)){
decrypt
(
pkt
.
data
);
decrypt
(
tmpA
.
data
);
decimalCounter
++
;
decimalCounter
++
;
if
(
decimalCounter
==
8
){
if
(
decimalCounter
==
8
){
decimalOut
=
decimalOut
*
100
+
convertBinInt
(
final_char
);
decimalOut
=
decimalOut
*
100
+
convertBinInt
(
final_char
);
...
@@ -93,7 +87,6 @@ void pixel(ap_int<32> &in_decimal,
...
@@ -93,7 +87,6 @@ void pixel(ap_int<32> &in_decimal,
}
}
}
break
;
break
;
default
:
default
:
...
@@ -102,7 +95,7 @@ void pixel(ap_int<32> &in_decimal,
...
@@ -102,7 +95,7 @@ void pixel(ap_int<32> &in_decimal,
count_streams
++
;
count_streams
++
;
if
(
count_streams
==
position2
-
1
){
if
(
count_streams
==
stream_count
){
count_streams
=
0
;
count_streams
=
0
;
charIn
=
0
;
charIn
=
0
;
addNum
=
0
;
addNum
=
0
;
...
@@ -115,7 +108,13 @@ void pixel(ap_int<32> &in_decimal,
...
@@ -115,7 +108,13 @@ void pixel(ap_int<32> &in_decimal,
}
}
dout
.
write
(
pkt
);
if
(
count_streams
==
stream_count
){
tmpA
.
last
=
1
;
}
tmpA
.
strb
=
0xf
;
dout
<<
tmpA
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment