Jump to content

omaima

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

omaima's Achievements

Member

Member (1/2)

0

Reputation

  1. When I build a program with systemc this Error doesn't apppear , but when I build systemc-ams I get this Error, I think this Error from Gdb because I'm using Eclipse under cygwin64
  2. mr.maehne I have problem when I'm trying to debug a systemc-ams programe I get this message: Error in final launch sequence: Failed to execute MI command: -file-exec-and-symbols C:/Users/ALTQNIA/eclipse-workspace/Td_BBT/src/main.cpp Error message from debugger back end: "C:/Users/ALTQNIA/eclipse-workspace/Td_BBT/src/main.cpp": not in executable format: file format not recognized Failed to execute MI command: -file-exec-and-symbols C:/Users/ALTQNIA/eclipse-workspace/Td_BBT/src/main.cpp Error message from debugger back end: "C:/Users/ALTQNIA/eclipse-workspace/Td_BBT/src/main.cpp": not in executable format: file format not recognized "C:/Users/ALTQNIA/eclipse-workspace/Td_BBT/src/main.cpp": not in executable format: file format not recognized And gdb debug launching stuck at 96% or 94% and when I click run , I get on this message Error Starting process can you help me ,I'm stuck with that for month any tips. Thanks in advance
  3. I found vcf file empty I don't know what the main problem is. Is there an error in the code, or there is a problem of installing systemc-ams Code: #ifndef SRC_INC_SIN_SRC_HPP_ #define SRC_INC_SIN_SRC_HPP_ #include <systemc-ams> SCA_TDF_MODULE (sin_src) { sca_tdf::sca_out<double> out; // output port sin_src( sc_core::sc_module_name nm, double ampl_= 1.0, double freq_ = 1.0e3, sca_core::sca_time Tm_ = sca_core::sca_time(0.125, sc_core::SC_MS)) : out("out"), ampl(ampl_), freq(freq_), Tm(Tm_) {} void set_attributes() { set_timestep(Tm); } void processing() { double t = get_time().to_seconds(); // actual time out.write( ampl * std::sin( 2.0 * M_PI * freq * t ) ); } private: double ampl; // amplitude double freq; // frequency sca_core::sca_time Tm; // module time step }; #endif /* SRC_INC_SIN_SRC_HPP_ */ ////////////////////////////////////////////////////////////////////////////////////// #ifndef SRC_INC_COMPARATOR_HPP_ #define SRC_INC_COMPARATOR_HPP_ #include <systemc-ams> SCA_TDF_MODULE( comparator ) { sca_tdf::sca_in<double> vplus; sca_tdf::sca_in<double> vminus; sca_tdf::sca_de::sca_out<bool> comp; void set_attributes() {}; void initialize() { }; void processing() { if(vplus.read() > vminus.read()) { comp.write(1); } else { comp.write(0); } } void ac_processing() {}; SCA_CTOR( comparator) : vplus("vplus"), vminus("vminus"){} }; #endif /* SRC_INC_COMPARATOR_HPP_ */ ////////////////////////////////////////////////////////////////////////////////////////// #ifndef SRC_INC_CONSTANT_VOLTAGE_TDF_HPP_ #define SRC_INC_CONSTANT_VOLTAGE_TDF_HPP_ #include <systemc-ams> SCA_TDF_MODULE (constant_voltage_tdf) { sca_tdf::sca_out<double> out; // output port constant_voltage_tdf( sc_core::sc_module_name nm, double ampl_= 1.0) : out("out"), ampl(ampl_) {} void set_attributes() { } void processing() { out.write( ampl); } private: double ampl; // amplitude }; #endif /* SRC_INC_CONSTANT_VOLTAGE_TDF_HPP_ */ /////////////////////////////////////////////////////////////////////////////////////////////////////// #include <systemc-ams> #include "inc/comparator.hpp" #include "inc/sin_src.hpp" #include "inc/constant_voltage_tdf.hpp" int sc_main (int argc, char* argv[]) { uint32_t i; sca_tdf::sca_signal<double> vp; sca_tdf::sca_signal<double> vn; sc_core::sc_signal<bool> z; sc_core::sc_time time_step(10.0, sc_core::SC_NS); comparator comp0("comp0"); comp0.vplus(vp); comp0.vminus(vn); comp0.comp(z); sin_src sin0("sin0",3.3,10000,time_step); sin0.out(vp); constant_voltage_tdf ref("ref",1.2); ref.out(vn); sca_util::sca_trace_file *vcdfile= sca_util::sca_create_vcd_trace_file("comparator-tdf.vcd"); sca_util::sca_trace(vcdfile, vp, "v_p"); sca_util::sca_trace(vcdfile, vn, "v_n"); sca_util:: sca_trace(vcdfile, z, "z"); sc_start(5, sc_core::SC_MS); sca_util::sca_close_vcd_trace_file(vcdfile); return 0; }
  4. What should I use instead VCD file
  5. Thanks a lot , but when I went to cygwin to open the vcd file I got this message GTKWave Analyzer v3.3.100 (w)1999-2019 BSI No symbols in VCD file..is it malformed Exit
  6. Hello I'm traying to creating frontend receiver , when I do Run , I get this Error Error: SystemC-AMS: Error at least one sample period must be assigned per cluster the following modules are included in the current cluster (max. 20 printed): rf_src_1 rffe_1.mxr_1 rffe_1.lpf_1 osc_src_1 In file: ../../../../../src/scams/impl/synchronization/sca_synchronization_alg.cpp:1330 this is my code : sin.h #include <cmath> #include <systemc-ams> class sinsourc : public sca_tdf::sca_module { public: sca_tdf::sca_out<double> out; // Output. // Construct sinusoidal source and name its ports. sinsourc(sc_core::sc_module_name nm, double off = 0.0, double amp = 1.0, double f = 50.0, double phi = 0.0) : out("out"), off_(off), amp_(amp), f_(f), phi_(phi) {} protected: // Generate sine wave and write it to the out port. void processing() { using std::sin; double val = 0.0; double t = out.get_time().to_seconds(); val = off_ + amp_ * sin(2.0 * M_PI * f_ * t + (M_PI / 180.0) * phi_); out.write(val); } private: double off_, amp_, f_, phi_; // Offset, amplitude, frequency / Hz, phase / DEG. }; mixer.h #ifndef SRC_INCLUDE_MIXER_H_ #define SRC_INCLUDE_MIXER_H_ #include<systemc-ams> SCA_TDF_MODULE(mixer) { sca_tdf::sca_in<double> bpf_in, lo_in; sca_tdf::sca_out<double> if_out; void set_attributes() { sc_core::sc_time(1.0, sc_core::SC_US); } void processing() { if_out.write( bpf_in.read() * lo_in.read() ); } mixer( sc_core::sc_module_name Rx) :bpf_in("bpf_in"),lo_in("lo_inn") ,if_out("if_out"){} }; LPF.h #include<systemc-ams> #include<systemc-ams> SCA_TDF_MODULE(LPF) { sca_tdf::sca_in<double> in; sca_tdf::sca_out<double> out; LPF( sc_core::sc_module_name Rx, double fc_, double h0_ ) : fc(fc_), h0(h0_) {} void initialize() { num(0) = 1.0; den(0) = 1.0; den(1) = 1.0 /( 2.0 * M_PI * fc ); } void processing() { out.write( ltf_nd( num, den, in.read(), h0 ) ); } private: sca_tdf::sca_ltf_nd ltf_nd; // Laplace transfer function sca_util::sca_vector<double> num, den; // numerator and denominator coefficients double fc; // 3dB cut-off frequency in Hz double h0; // DC gain }; front.h #include <systemc-ams> #include "../../src/include/LPF.h" #include "../../src/include/mixer.h" // RF front end module with structural description. class rf_front_end : public sc_core::sc_module { public: // Ports. sca_tdf::sca_in<double> rf_in, osc_in; sca_tdf::sca_out<double> dlpf_out; // Internal components. mixer mxr_1; LPF lpf_1; // Internal signals. sca_tdf::sca_signal<double> mxr_sig; // Construct RF front end using the passed parameters for the components. rf_front_end(sc_core::sc_module_name nm, double fc = 200.0e3, double H0 = 1.0) : mxr_1("mxr_1"), lpf_1("lpf_1", fc, H0) { // Specify connectivity using port-to-port and port-to-signal binding. mxr_1.bpf_in(rf_in); mxr_1.lo_in(osc_in); mxr_1.if_out(mxr_sig); // TODO: Connect the LPF to the mixer output. lpf_1.in(mxr_sig); lpf_1.out(lpf_out); // TODO: Connect the ADC to the LPF output. } }; front.cpp #include <iostream> #include <systemc-ams> #include "../src/include/front.h" #include "../src/include/sin.h" int sc_main(int argc, char* argv[]) { using namespace sc_core; using namespace sca_util; using sca_core::sca_time; //////////////////////////////////////////////////////////////////////// // Component and simulation parameters. //////////////////////////////////////////////////////////////////////// const double fosc = 2444.5; // Carrier signal frequency. const double fbb = 2441.5; // Base band signal frequency. const double fc = 2441.5; // Filter cut-off freqency. const double H0 = 5.0; // Filter gain. const sc_core::sc_time t_sim(5.0, SC_NS); // Time to simulate. sca_tdf::sca_signal<double> rf_sig("rf_sig"), osc_sig("osc_sig") ,lpf_sig("lpf_sig"); // RF signal at 10.004 MHz. sinsourc rf_src_1("rf_src_1", 0.0, 1.0 , fosc - fbb, 0.0); rf_src_1.out(rf_sig); // Carrier with 10 MHz. sinsourc osc_src_1("osc_src_1", 0.0, 1.0 , fosc, 0.0); osc_src_1.out(osc_sig); rf_front_end rffe_1("rffe_1",fc, H0); rffe_1.rf_in(rf_sig); rffe_1.osc_in(osc_sig); rffe_1.lpf_out(lpf_sig); // Tracing of RF signals to DAT file. sca_trace_file *tfp_rf = sca_create_tabular_trace_file("01_rf_front_end_rf_tb_rf"); sca_trace(tfp_rf, rf_sig, "rf_sig"); sca_trace(tfp_rf, osc_sig, "osc_sig"); sca_trace(tfp_rf, rffe_1.mxr_sig, "rffe_1.mxr_sig"); // Tracing of base band signals to DAT file. sca_trace_file *tfp_bb = sca_create_tabular_trace_file("01_rf_front_end_rf_tb_bb"); sca_trace(tfp_bb, lpf_sig, "lpf_sig"); // Tracing to VCD file. sca_util::sca_trace_file* tfp_vcd = sca_util::sca_create_vcd_trace_file("01_rf_front_end_rf_tb"); sca_trace(tfp_vcd, rf_sig, "rf_sig"); sca_trace(tfp_vcd, osc_sig, "osc_sig"); sca_trace(tfp_vcd, rffe_1.mxr_sig, "rffe_1.mxr_sig"); sca_trace(tfp_vcd, lpf_sig, "lpf_sig"); // Simulation try { sc_start(t_sim); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } // Close trace files and stop simulation. sca_close_tabular_trace_file(tfp_rf); sca_close_tabular_trace_file(tfp_bb); sca_close_tabular_trace_file(tfp_vcd); sc_stop(); return sc_core::sc_report_handler::get_count(sc_core::SC_ERROR); } Thanks in advance
  7. I'm trying to create vcd file for data gate and I got on this : Info: (I703) tracing timescale unit set: 1 ns (trace.vcd) Warning: (W571) no activity or clock movement for sc_start() invocation In file: ../../../src/sysc/kernel/sc_simcontext.cpp:1742 my cod: //andh.h file #include <systemc.h> SC_MODULE(andh){ sc_in<bool> a; sc_in<bool> b; sc_out<bool> o; void and_process(){ o.write(a.read()&&b.read()); } SC_CTOR(andh){ SC_METHOD(and_process); sensitive<<a<<b; } }; //////////////////////////////////////////////////////////////////////////////////// andh.cpp file #include<systemc.h> #include"andh.h" #define SC_MAKE_VERSION( x, y, z ) \ (((x)*10000) + ((y)*100) + (z)) int sc_main(int argc, char*argv[]) { andh and1("and1"); sc_signal<bool> A,B,O; and1.a(A); and1.b(B); and1.o(O); sc_start(SC_ZERO_TIME); sc_trace_file *tf=sc_create_vcd_trace_file("trace"); tf->set_time_unit(1,SC_NS); sc_trace(tf,A,"A"); sc_trace(tf,B,"B"); sc_trace(tf,O,"O"); A=0;B=0; sc_start(10,SC_MS); for(int i=0;i<10;i++){ A=((i& 0x1)!=0); B=((i& 0x2)!=0); sc_start(10,SC_NS); } sc_close_vcd_trace_file(tf); sc_start(); return 0; } /////////////////////////////////////////////////////////////////////////////////////////////// this is Warning message
  8. Thanks it worked build succeeded ,but When I run the program I get this message
  9. Hi everyone I'm new in systemc ,I'm trying to design (and gate) and create vcd file for simulation and when build project I got on these error ??:??:?? **** Incremental Build of configuration Debug for project and_get **** make all Building file: ../and_test.cpp Invoking: Cygwin C++ Compiler g++ -I"C:\Users\ALTQNIA\Desktop\systemc-2.3.3\systemc-2.3.3\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"and_test.d" -MT"and_test.o" -o "and_test.o" "../and_test.cpp" ../and_test.cpp:2:9: fatal error: andh2.h: No such file or directory 2 | #include<andh2.h> | ^~~~~~~~~ compilation terminated. make: *** [subdir.mk:20: and_test.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete. ??:??:?? Build Failed. 2 errors, 0 warnings. (took 10s.595ms) these is my code /////////////////////////////////////////////////////////////////////////////// andh2.h #include"systemc.h" SC_MODULE(andh2){ sc_in<bool> a; sc_in<bool> b; sc_out<bool> o; void and_process(){ o.write(a.read()&&b.read()); } SC_CTOR(andh2){ SC_METHOD(and_process); sensitive<<a<<b; } }; ////////////////////////////////////////////////////////////// and_test/cpp #include<systemc.h> #include<andh2.h> void sc_main(int argc, char* argv[]) { andh2 and1("and1"),and2("and2"),and3("and3"); sc_signal<bool> A,B,O; and1.a(A); and2.b(B); and1.o(O); sc_start(SC_ZERO_TIME); sc_trace_file *tf=sc_create_vcd_trace_file("trace"); tf->set_time_unit(1,SC_NS); sc_trace(tf,A,"A");sc_trace(tf,B,"B"); sc_trace(tf,O,"O"); A=0;B=0; sc_start(10,SC_NS); for(int i=0;i<10;i++){ A=((i& 0*1)!=0); B=((i& 0*2)!=0); sc_start(10,SC_NS); } sc_close_vcd_trace_file(tf); sc_start(); }
  10. how can install lib and include library by using cygwin 64 for systemC 2.3.3
  11. Hi

    I  wanna install lib and include library by using cygwin 64 for systemC 2.3.3

     

  12. I wanna install lib and include library by using cygwin for systemC 2.3.3
  13. Hi, I have some errors ,when I unzip SystemC I can't find lib and include files ,Addition I have visual2010
×
×
  • Create New...