Jump to content

errors with sc_start


rkrara

Recommended Posts

Hi,

I am new to systemC.

I was trying to run this example code from this link but there is an error I cant resolve.

Can you please help. This is the errors I get.

first_counter_tb.cpp: In function ‘int sc_main(int, char**)’:
first_counter_tb.cpp:17: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:32: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:34: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:40: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:42: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:48: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:50: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:56: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
first_counter_tb.cpp:58: error: no matching function for call to ‘sc_start(int)’
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:106: note: candidates are: void sc_core::sc_start()
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:173: note:				 void sc_core::sc_start(const sc_core::sc_time&, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:109: note:				 void sc_core::sc_start(int, sc_core::sc_time_unit, sc_core::sc_starvation_policy)
/usr/local/systemc-2.3.0/include/sysc/kernel/sc_simcontext.h:115: note:				 void sc_core::sc_start(double, sc_core::sc_time_unit, sc_core::sc_starvation_policy)

I have ubuntu 10.10 system with SystemC 2.3.0

Thanks.

Link to post
Share on other sites

Hello,

The sample code available at the Asic World Web site is

literally decades old, written in an old version of SystemC,

which the author is too lazy to update. Some of the old

SystemC features are deprecated. Try the following:

#include <systemc>

SC_MODULE(hello)

{

void sayhello()

{

std::cout<<"Hello there !!"<<std::endl;

}

SC_CTOR(hello)

{

SC_METHOD(sayhello);

}

~hello(){ }

};

int sc_main(int argc, char **argv)

{

hello hel_lo("hel_lo");

sc_core::sc_start(10.0, sc_core::SC_NS);

sc_core::sc_stop();

return 0;

}

Then download some documentation (Users' Guide

etc.,) from the Accellera site to know/digest the

details. I am afraid most of the free sample SystemC

code on the Internet is too old to be of much use.

Link to post
Share on other sites

Hi,

Thanks for your reply.

Could you please re write me the second example (counter) on the same link above.

Actually the hello world program worked as it is from that link.

Hello,

The sample code available at the Asic World Web site is

literally decades old, written in an old version of SystemC,

which the author is too lazy to update. Some of the old

SystemC features are deprecated. Try the following:

#include <systemc>

SC_MODULE(hello)

{

void sayhello()

{

std::cout<<"Hello there !!"<<std::endl;

}

SC_CTOR(hello)

{

SC_METHOD(sayhello);

}

~hello(){ }

};

int sc_main(int argc, char **argv)

{

hello hel_lo("hel_lo");

sc_core::sc_start(10.0, sc_core::SC_NS);

sc_core::sc_stop();

return 0;

}

Then download some documentation (Users' Guide

etc.,) from the Accellera site to know/digest the

details. I am afraid most of the free sample SystemC

code on the Internet is too old to be of much use.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...