Jump to content
rkrara

errors with sc_start

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.

Share this post


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.

Share this post


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×