mcgiritli Posted August 15, 2015 Report Share Posted August 15, 2015 Hi all, As everybody can guess, ı'm quite new to SystemC and SystemC-ams world. Just for practice ı was working on a Sin wave generator example that ı found on internet. it was working at the beginning, ı could able to take a look at my trace files. But some how ı begin to get this error from my compiler. I have not change anything about the systemc-ams file on my computer. does anybody have any idea what may cause this error ? kindly help about clearing this , thank you in advance.. /home/studentcps/giritli/Code/build> make [100%] Building CXX object src/CMakeFiles/template.dir/main.cpp.o /home/studentcps/giritli/Code/src/main.cpp:5:23: fatal error: systemc-ams: No such file or directory compilation terminated. make[2]: *** [src/CMakeFiles/template.dir/main.cpp.o] Error 1 make[1]: *** [src/CMakeFiles/template.dir/all] Error 2 make: *** [all] Error 2 *** Failed *** and here is my code, #define SC_INCLUDE_DYNAMIC_PROCESSES #include <cmath> #include <systemc> #include <systemc-ams> using namespace sc_core; SCA_TDF_MODULE(Sine_Src) { sca_tdf::sca_out<double> out; // output port void set_attributes() { //set_timestep(100,SC_NS); out.set_timestep (sca_core::sca_time(10,sc_core::SC_US)); } void processing() { ampl=1000; double temp_value = (ampl* std::sin( sca_get_time().to_seconds()*(100.*2.*M_PI))); if (temp_value > 0 ){ out.write (temp_value); } else if (temp_value <= 0 ){ out.write ( 0 ); } } SCA_CTOR (Sine_Src){} private: double ampl; }; SCA_TDF_MODULE (drain) { sca_tdf::sca_in<double> input; SCA_CTOR (drain){} }; int sc_main(int argc, char* argv[]) { sca_tdf::sca_signal<double> half_rec_sinyal; Sine_Src sin("sin"); sin.out(half_rec_sinyal); drain drn("drn"); drn.input(half_rec_sinyal); // vcd trace file writing sca_util::sca_trace_file* Tfile = sca_util::sca_create_vcd_trace_file("trace"); sca_util::sca_trace_file* Ttfile = sca_util::sca_create_tabular_trace_file("trace_matlab"); sca_util::sca_trace(Tfile,half_rec_sinyal,"Half_Rec_Sine"); sca_util::sca_trace(Ttfile,half_rec_sinyal,"Half_Rec_Sine"); sc_start(100, SC_MS); std::cout << "Simulation finished!" << std::endl; sca_util::sca_close_vcd_trace_file(Tfile); sca_util::sca_close_tabular_trace_file(Ttfile); return 0; Quote Link to comment Share on other sites More sharing options...
apfitch Posted August 15, 2015 Report Share Posted August 15, 2015 The error message is complaining about this line: #include <systemc-ams> and says it can't find the systemc-ams. I imagine there is a variable in the Makefile that points to the SystemC AMS code, and the code isn't where the variable points. That Makefile variable may also depend on an environment variable, and perhaps that environment variable is not set? regards Alan Quote Link to comment Share on other sites More sharing options...
Martin Barnasconi Posted August 15, 2015 Report Share Posted August 15, 2015 some other proposed fixes: remove the #define SC_INCLUDE_DYNAMIC_PROCESSES as you do not need this the method sca_get_time() does not exist, use get_time() instead it would be more logical to move the ampl=1000 to the constructor Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.