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
317989f8
Commit
317989f8
authored
3 years ago
by
Vipin Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Update pixel.cpp
parent
87c7c24e
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
+14
-10
14 additions, 10 deletions
pixel.cpp
with
14 additions
and
10 deletions
pixel.cpp
+
14
−
10
View file @
317989f8
...
...
@@ -13,6 +13,7 @@ static long long final_char=0;
int
addNum
=
0
;
static
int
decNum
=
0
;
static
int
decimalCounter
=
0
;
static
int
decimalOut
=
0
;
int
lastDecimalVal
;
long
long
convert
(
int
n
);
...
...
@@ -22,12 +23,11 @@ void toAscii(char *c);
int
getDecimal
(
int
n
);
void
pixel
(
ap_int
<
32
>
in_decimal
,
void
pixel
(
ap_int
<
32
>
&
in_decimal
,
ap_int
<
32
>
selector
,
ap_int
<
32
>
position1
,
ap_int
<
32
>
position2
,
ap_int
<
32
>
stream_count
,
ap_int
<
32
>
&
ascii
,
hls
::
stream
<
pkt_t
>
&
din
,
hls
::
stream
<
pkt_t
>
&
dout
)
{
...
...
@@ -37,7 +37,6 @@ void pixel(ap_int<32> in_decimal,
#pragma HLS INTERFACE s_axilite port=position1
#pragma HLS INTERFACE s_axilite port=position2
#pragma HLS INTERFACE s_axilite port=stream_count
#pragma HLS INTERFACE s_axilite port=ascii
#pragma HLS INTERFACE axis port=din
#pragma HLS INTERFACE axis port=dout
...
...
@@ -48,13 +47,12 @@ void pixel(ap_int<32> in_decimal,
case
0
:
if
(
count_streams
==
0
){
in_decimal
=
0
;
final_char
=
0
;
decNum
=
in_decimal
;
}
//123456321
if
((
count_streams
>=
3
*
(
position1
-
1
))
&&
(
count_streams
<
3
*
(
position2
)
-
1
)
){
if
((
count_streams
>=
(
position1
-
1
))
&&
(
count_streams
<
position2
)){
// addNum=0;
addNum
=
0
;
if
(
decimalCounter
%
8
==
0
){
...
...
@@ -86,12 +84,17 @@ void pixel(ap_int<32> in_decimal,
break
;
case
1
:
if
((
count_streams
>=
3
*
(
position1
-
1
))
&&
(
count_streams
<
3
*
(
position2
)
-
1
)){
if
((
count_streams
>=
(
position1
-
1
))
&&
(
count_streams
<
position2
)){
decrypt
(
pkt
.
data
);
decimalCounter
++
;
if
(
decimalCounter
==
8
){
decimalOut
=
decimalOut
*
1000
+
convertBinInt
(
final_char
);
decimalCounter
=
0
;
}
}
break
;
...
...
@@ -105,10 +108,11 @@ void pixel(ap_int<32> in_decimal,
count_streams
=
0
;
charIn
=
0
;
addNum
=
0
;
ascii
=
0
;
decimalCounter
=
0
;
if
(
selector
==
1
){
ascii
=
convertBinInt
(
final_char
);
final_char
=
0
;
in_decimal
=
decimalOut
;
decimalOut
=
0
;
}
}
...
...
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