Jump to content

mcgiritli

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. 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;
×