text: /*
   * (c) Copyright 2020 Xilinx, Inc. All rights reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   */
   #pragma once
  
  #include <adf.h>
  #include "system_settings.h"
  #include "aie_kernels.h"
  
  
  using namespace adf;
  
  std::vector<cint16> taps = std::vector<cint16>({
  	{   -82,  -253},{     0,  -204},{    11,   -35},{  -198,   273},
  	{  -642,   467},{ -1026,   333},{  -927,     0},{  -226,   -73},
  	{   643,   467},{   984,  1355},{   550,  1691},{     0,   647},
  	{   538, -1656},{  2860, -3936},{  6313, -4587},{  9113, -2961},
  	{  9582,     0},{  7421,  2411},{  3936,  2860},{  1023,  1409},
  	{  -200,  -615},{     0, -1778},{   517, -1592},{   467,  -643},
  	{  -192,   140},{  -882,   287},{ -1079,     0},{  -755,  -245},
  	{  -273,  -198},{    22,    30},{    63,   194},{     0,   266}
  });
  
  const int SHIFT = 0; // to analyze the output generated by impulses at the input
  //const int SHIFT = 15; // for realistic input samples
  
  
  class FIRGraph_OneKernel: public adf::graph
  {
  private:
  	kernel k;
  
  public:
  	input_port in;
  	output_port out;
  
  	FIRGraph_OneKernel()
  	{
  		k = kernel::create_object<SingleStream::FIR_SingleStream<NUM_SAMPLES,SHIFT>>(taps);
  
  		connect<stream> net0(in,k.in[0]);
  		connect<stream> net1(k.out[0],out);
  
  		source(k) = "aie_kernels/FirSingleStream.cpp";
  		headers(k) = {"aie_kernels/FirSingleStream.h"};
  		runtime<ratio>(k) = 0.9;
  	}
  };
  
  
  
  class TopGraph: public adf::graph
  {
  public:
  	FIRGraph_OneKernel G1;
  
  	input_port in;
  	output_port out;
  
  	TopGraph()
  	{
  		connect<> (in,G1.in);
  		connect<> (G1.out,out);
  	}
  };
  