no matching function for call to sc_trace in systemc -


i using systemc simulation , got error message telling that

g++ -i/opt/xilinx-14.2/vivado_hls/2012.2/linux_x86_64/tools/systemc/include/ -o testbench.exe testbench.cc -l/opt/xilinx-14.2/vivado_hls/2012.2/linux_x86_64/tools/systemc/lib -lsystemc -lm /opt/xilinx-14.2/vivado_hls/2012.2/linux_x86_64/tools/systemc/include/sysc/communication/sc_signal_ports.h: in member function void sc_core::sc_in::end_of_elaboration() [with t = std::basic_string, std::allocator >]: testbench.cc:126: instantiated here

/opt/xilinx-14.2/vivado_hls/2012.2/linux_x86_64/tools/systemc/include/sysc/communication/sc_signal_ports.h:285: error: no matching function call sc_trace(sc_core::sc_trace_file*&, const std::basic_string, std::allocator >&, std::string&)รข€™

do guys have idea error , how fix it?

#include "systemc.h" #include "multichipmodule.cc" #include <vector> #include <string> #include <iostream> int converttime(std::string input){    // main invocator function int timeint=atoi(input.substr(0,11).c_str()); int output =0; for(int i=0;timeint >0;i++){  if(timeint % 10 ==1) {     output += static_cast<int> (pow(2,i));     }     timeint /=10;  }     return output; }   // include string int sc_main(int argc,char* argv[]){ sc_signal<bool> bcoclock; sc_signal<bool> mca; sc_signal<bool> mcb; sc_signal<bool> enable; sc_signal<sc_uint<8> > bconumber; sc_signal<std::string > inputmessage; // input message have 24 bits. first 11 bits time. //the next 3 bits more moduleno, 3 bits chipno, 7 bits  //stripno. in total 24 bits.   sc_signal<bool> sclk; sc_signal<bool> rclk; sc_signal<bool> outclk;   multichipmodule module1("module1"); module1.bcoclock(bcoclock); module1.mca(mca); module1.mcb(mcb); module1.sclk(sclk); module1.rclk(rclk); module1.outclk(outclk); module1.enable(enable); module1.bconumber(bconumber); module1.inputmessage(inputmessage);  sc_start(0); /* sc_trace_file *wf=sc_create_vcd_trace_file("testbench"); sc_trace(wf,bcoclock,"bcoclock"); sc_trace(wf,mca,"mca"); sc_trace(wf,mcb,"mcb"); sc_trace(wf,enable,"enable"); sc_trace(wf,bconumber,"bconumber"); //sc_trace wf,coretalking sc_trace(wf,sclk,"sclk"); sc_trace(wf,rclk,"rclk"); sc_trace(wf,outclk,"outclk"); */ //initialize variables cout<<"@"<<sc_time_stamp()<<"asserting enable\n"<<endl; enable=1; sclk=1; rclk=1; outclk=0; bcoclock=1; mca=1; mcb=0; bconumber=0; std::vector<std::string> vec1; std::vector<int> vec2; std::vector<std::string>::iterator it1; std::vector<int>::iterator it2; it1=vec1.begin(); it2=vec2.begin(); std::string input ="000111101000010010000000"; int time= converttime(input); it1=vec1.insert(it1,input); it2=vec2.insert(it2,time); input="010000100110010011111111"; time=converttime(input); it1=vec1.insert(it1,input); it2=vec2.insert(it2,time); //sorting here int minimum=vec2[0]; int index=0; for(int i=0;i<vec2.size();i++){   (int j=i;j<vec2.size();j++){   if(vec2[j]<minimum){     minimum=vec2[j];     index=j;     }   }   int temptime =vec2[i];   vec2[i]=vec2[index];   vec2[index]=temptime;   std::string tempstring=vec1[i];   vec1[i]=vec1[index];   vec1[index]=tempstring;    minimum=vec2[i];   index=i; }  int t=0; for(int i=0;i<1000;i++){  for(int j=0;j<vec2.size();j++){   if(i==vec2[j])     inputmessage=vec1[j];  } if(i%10==0)   mca=!mca; if((i-5)%10==0)   mcb=!mcb; if(i%132==0)   bcoclock=!bcoclock;   sc_start(1); } cout<<"@"<<sc_time_stamp()<<"de-asserting enable\n"<<endl; enable=0;  cout<<"@"<<sc_time_stamp()<<"terminating simulation\n"<<endl; sc_close_vcd_trace_file(wf); return 0; } 

error "sc_signal<std::string > inputmessage;". whole bunch of template classes/functions not defined "t = std::string", including sc_in, sc_trace, vcd_trace.

but problem more fundamental, why std::string sc_signal? comments in code better of using sc_uintt<24> can initialize binary strings "0b1111..11"

instead of     std::string input ="000111101000010010000000"; use     sc_uint<24> input = "0b000111101000010010000000"; 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -