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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor mishiuss
Visitor
4,621 Views
Registered: ‎12-06-2013

HLS-systemC-Instantiating Modules

Hello! I'm beginner and I encountered a problem when I try run C Synthesis. I can't using ''new" for instantiating module.  How should I modify

my code(ppd.h)?

////fir.h

.....

template<class T, int order>
SC_MODULE(fir)
{

SC_HAS_PROCESS(fir);

fir(sc_module_name name, T* _h) :sc_module(name), h(_h)
{
SC_METHOD(algorithm);
...
};


void algorithm() {...}

}

};

 

 

///ppd.h

#include "fir.h"

 

#define N 33
#define M 3 
#define P 11

 

double** eMat(int rows, int columns, double *h) {....}

double* eVec(int row, int columns, double **Matrix) {.....}

 

class ppd : public sc_module
{
public:

//signals ....

 


double **Matrix;
double *tmpE;
double *h;


fir<double,P> *E[M];

SC_HAS_PROCESS(ppd) ;


ppd(sc_module_name name, double* _h, fir<double,P>) : sc_module(name), h(_h)
{


SC_METHOD(algorithm);

Matrix = eMat(M,P,h);

for (unsigned int i = 0; i < M; i++)
{
tmpE = eVec(i,P,Matrix);


E [i] = new fir<double,P>(sc_gen_unique_name("E"),tmpE);

 

E[i] ->CLK(CLK);
E[i] -> firIN(delay[i]);
E[i] -> firOUT(sum[i]);

}

}

 

void algorithm()
{....}

};

 

Thanks,

 

Olga

 

 

0 Kudos
1 Reply
Moderator
Moderator
4,592 Views
Registered: ‎04-17-2011

Re: HLS-systemC-Instantiating Modules

An SC_MODULE cannot be instantiated as new. Refer to page 319 of the document to modify your code accordingly: http://www.xilinx.com/support/documentation/sw_manuals/xilinx2013_3/ug902-vivado-high-level-synthesis.pdf
Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos