search
LoginSignup
0

posted at

【VitisHLS】hls::streamを用いた関数のis private within this context

#include "sample.hpp"

void add_st (
    hls::stream<my_axis> in_a,
    hls::stream<my_axis> in_b,
    hls::stream<my_axis> out_res
){

    my_axis a, b, res;

    in_a.read(a);
    in_b.read(b);
    res.data = a.data + b.data;
    res.user = a.user;
    res.last = a.last;
    out_res.write( res );

}

void top_func(
    hls::stream<my_axis>& in_a, 
    hls::stream<my_axis>& in_b, 
    hls::stream<my_axis>& out_res
){

    #pragma HLS INTERFACE axis port=in_a
    #pragma HLS INTERFACE axis port=in_b
    #pragma HLS INTERFACE axis port=out_res
    #pragma HLS DATAFLOW

    add_st( in_a , in_b , out_res );
}
error: ‘hls::stream<__STREAM_T__, 0>::stream(const hls::stream<__STREAM_T__, 0>&) [with __STREAM_T__ = hls::axis<unsigned int, 32ul, 0ul, 0ul>]’ is private within this context

原因:&の付け忘れ

void add_st (
    hls::stream<my_axis>& in_a,
    hls::stream<my_axis>& in_b,
    hls::stream<my_axis>& out_res
){
...

エラー文が微妙に分かり辛い。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0