Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - simcontext error Message Thread: Previous | Next
  • To: systemc-forum@xxxxxxxxxxxxxxxxx
  • From: yoman yoman <saynotosystemc@xxxxxxxxx>
  • Date: Wed, 27 Oct 2010 11:30:25 +0530
Send Email to systemc-forum@lists.systemc.org:
Send new message
Reply to this message
Hi All,

I've a small module containing only one .h file. Contents of it are as
below:

************************************************


#ifndef _TRAFFIC_GENERATOR_

#define _TRAFFIC_GENERATOR_

#include "systemc.h"

template <unsigned int DATA_BUS_WIDTH_BYTES> class father:public sc_module {

public:

father(){}

virtual void father_func(void)=0;

};

template <unsigned int DATA_BUS_WIDTH_BYTES, unsigned int ID_WIDTH_BYTES>
class traffic_generator :public father<DATA_BUS_WIDTH_BYTES> {

public:

SC_HAS_PROCESS(traffic_generator);

traffic_generator(sc_module_name name):

sc_module(name),

father<DATA_BUS_WIDTH_BYTES>("FATHER",2),

ACLK("ACLK"),

ARESETn("ARESETn"){

SC_THREAD( do_transaction );

sensitive<<ACLK<<ARESETn;

dont_initialize();

}

void end_of_elaboration(void){

}

void father_func(void){}

~traffic_generator(void) {}

void do_transaction( void) {

}

public:

sc_in < bool > ACLK;

sc_in < bool > ARESETn;

unsigned count;

};

#endif // _TRAFFIC_GENERATOR_

*******************************************************************

This code gets compiled with gcc_3.2.3 wbut with gcc_3.4.3 and higher
versions it gives following error:



************************************************************************

In file included from src/main.cpp:1:
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h: In
constructor `traffic_generator<DATA_BUS_WIDTH_BYTES,
ID_WIDTH_BYTES>::traffic_generator(sc_core::sc_module_name)':
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:21: error:
there are no arguments to `simcontext' that depend on a template parameter,
so a declaration of `simcontext' must be available
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:21: error:
(if you use `-fpermissive', G++ will accept your code, but allowing the use
of an undeclared name is deprecated)
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:21: error:
`sensitive' undeclared (first use this function)
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:21: error:
(Each undeclared identifier is reported only once for each function it
appears in.)
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:21: error:
`sensitive_pos' undeclared (first use this function)
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:21: error:
`sensitive_neg' undeclared (first use this function)
/data/abc/users/aknis/SOCD/plt/top/include/traffic_generator.h:23: error:
there are no arguments to `dont_initialize' that depend on a template
parameter, so a declaration of `dont_initialize' must be available
make[1]: *** [obj/main.o] Error 1
make[1]: Leaving directory
`/data/abc/users/aknis/AKNIS/SocD_20Oct_7_6/build_exmp_new_27oct/plt/top'
make: *** [everything] Error 2
Exit 2
***************************************************************************************

can any one pls tell me why this error is coming and what is the solution
for it ??

Thanks in Advance for your time.

By Date: Previous | Next Current Thread By Thread: Previous | Next