UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Error:Cout Cannot be resolved

Accepted Solution Solved
Highlighted
Explorer
Posts: 218
Registered: ‎03-29-2017
Accepted Solution

Error:Cout Cannot be resolved

Hi,

 

I need to simulate my codes, so i have included "Cout" command in test bench file. But i getting an error that Cout and endl" cannot resolved.Please suggest me. Thanks

#include <stdlib.h>
#include <iostream>
#include <math.h>
#include "ap_int.h"


#define ROWS 102  //k
#define COLS 204
int main()
{

	ap_uint<1> dout[COLS];

	ap_uint<1> Generator[ROWS][COLS];
	ap_uint<1> G[ROWS][COLS];
	int i,j,k,r,c,n;

k = ROWS;
r = ROWS;
c = COLS;
n = COLS;


Encoder_Arbitray(msg, dout);
ap_uint<1> Codeword[COLS];
int s = 0;


for (i=0;i<k;i++)
    for(j=0;j<k;j++)
        if(i == j)
        G[i][j] = 1;

for(i=0;i<r;i++)
    for(j=0;j<k;j++)
        G[j][k+i] = H[i][j];

for(i=0;i<r;i++)
{
    for(j=0;j<c;j++)
    	Generator[i][j]=G[i][j];
}

for(j=0;j<n;j++)
{
    for(i=0;i<k;i++)
    {
        s = s + msg[i]*Generator[i][j];
    }
    Codeword[j] = s % 2;
    s = 0;
}

for(i=0;i<n;i++)
{
	dout[i]=Codeword[i];
	cout << dout << endl;
}
}

Hls.PNG

 


Accepted Solutions
Moderator
Posts: 5,501
Registered: ‎08-01-2008

Re: Error:Cout Cannot be resolved

Put the following code before int main():

using namespace std;
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.

View solution in original post


All Replies
Moderator
Posts: 5,501
Registered: ‎08-01-2008

Re: Error:Cout Cannot be resolved

Put the following code before int main():

using namespace std;
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
Explorer
Posts: 218
Registered: ‎03-29-2017

Re: Error:Cout Cannot be resolved

Hi,

 

Thanks for your response.

 

Still one more Error

 

Top Function : void Encoder_Arbitray(ap_uint<1> msg[ROWS], ap_uint<1> dout[COLS])

 

Please see error screen shot below

Hls.PNG

 

 

Please suggest me :) Thanks

Posts: 1,268
Registered: ‎06-24-2015

Re: Error:Cout Cannot be resolved

@thaus_015

 

The function Encoder_Arbitray does not have the function declared or the function body anywhere in the code.

You need to include the function definition and body so that it will be used.

Thanks,
Nupur
--------------------------------------------------------------------------------------------
Google your question before posting. If someone's post answers your question, mark the post as answer with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (click on the star mark).