Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hls::vector interface for DuplicateStreams #141

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

vopade
Copy link

@vopade vopade commented Apr 24, 2024

Changed interfaces of DuplicateStreams and DuplicateStreams_Batch as well as pooling operators from packed to hls::vector

Copy link
Collaborator

@preusser preusser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, @vopade!
Please, review the comments. Mostly, I'd like to ask you to avoid whitespace changes that are a mere consequence of editor settings or personal preference.

streamtools.h Outdated
T e = in.read();
out1.write(e);
out2.write(e);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, undo mere indentation changes.

streamtools.h Show resolved Hide resolved
streamtools.h Outdated
template<typename T, unsigned int NumTotal >
void DuplicateStreams_Batch(hls::stream<T> & in, hls::stream<T> & out1,
hls::stream<T> & out2, const unsigned int numReps) {
for (unsigned int image = 0; image < numReps; image++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't just change indentation.

using T = ap_uint<8>;
constexpr unsigned NUM_REPEAT = 4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix missing end of line.

stream<T> output_stream1("output_stream");
stream<T> output_stream2("output_stream");
static T expected[NUM_REPEAT*MAX_IMAGES];
unsigned int count_out = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, many lines are just indentation changes. Please, undo.

@@ -2,10 +2,15 @@
using namespace hls;
#include "ap_int.h"
#include "bnn-library.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you could reduce these includes to hls_stream.h only. Please, do if possible.

void Testbench_dup_stream(stream<ap_uint<WIDTH> > & in, stream<ap_uint<WIDTH> > & out1, stream<ap_uint<WIDTH> > & out2, unsigned int numReps){
DuplicateStreams_Batch<WIDTH, NUM_REPEAT>(in, out1, out2, numReps);
}
void Testbench_dup_stream(stream<T> & in, stream<T> & out1, stream<T> & out2, unsigned int numReps){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a consequence of the above, please, use hls::stream rather than stream.

@vopade
Copy link
Author

vopade commented May 10, 2024

Hi @preusser,
I made the requested changes, please review again.

@preusser
Copy link
Collaborator

THanks, @vopade! This looks good. Getting ready for the merge ...

@vopade
Copy link
Author

vopade commented Jun 5, 2024

Commit for pooling operators was automatically added to this PR since it was still open. Please review @preusser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants