Jump to content

Search the Community

Showing results for tags 'systemc-ams'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Accellera Systems Initiative
    • Information
    • Announcements
    • In the News
  • SystemC
    • SystemC Language
    • SystemC AMS (Analog/Mixed-Signal)
    • SystemC TLM (Transaction-level Modeling)
    • SystemC Verification (UVM-SystemC, SCV, CRAVE, FC4SC)
    • SystemC CCI (Configuration, Control & Inspection)
    • SystemC Datatypes
  • UVM (Universal Verification Methodology)
    • UVM (IEEE 1800.2) - Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • UVM Simulator Specific Issues
    • UVM Commercial Announcements
    • UVM (Pre-IEEE) Methodology and BCL Forum
  • Portable Stimulus
    • Portable Stimulus Discussion
    • Portable Stimulus 2.0 Public Review Feedback
  • IP Security
    • SA-EDI Standard Discussion
    • IP Security Assurance Whitepaper Discussion
  • IP-XACT
    • IP-XACT Discussion
  • SystemRDL
    • SystemRDL Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • Commercial Announcements
    • Announcements

Categories

  • SystemC
  • UVM
  • UCIS
  • IEEE 1735/IP Encryption

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Biography


Location


Interests


Occupation


Company

Found 16 results

  1. 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; }
  2. Hello All, I have a problem regarding Input stimuli. I have a text file, In which I have written an AC signal. Text file example: Time output voltage (volt) 0 us 2.0 v 10 us 2.1 v 20 us 2.2 v . . . 100 us 3.0 v and so on..... I want to use this file, more specifically the "output voltage" signal as an input stimuli to a SystemC-AMS code say for example an amplifier or an A2D converter. in SystemC-AMS code, I do have a signal sca_tdf::sca_signal<double> in; how can i assign the output voltage in the text file to a "in" signal ? how can i handle time intricacies ? thanks in advance !!! regards, Milind
  3. I'd like to know which tools in the market, other than COSEDE, support SystemC-AMS ? e.g. Questasim, SynopsysVCS, Incisive ? Thank you !
  4. hello everyone,I want to add and install systemc-ams library on visual studio 2013.could you please guide me how to download and install it on vs2013?or provide me some instructions.(what are the steps?)by the way i've already install systemc library. I know this is very elementary question but i'm very beginner in systemc and your help will greatly appreciated. Thanks a millionBest regards
  5. Hi all, This is my first SystemC/SystemC-AMS code, so please ignore any bad coding that might exist. I wanted to design a PLL just to test SystemC-AMS. The code is available at: https://github.com/americodias/systemc-ams_pll It is working, but I had to change the signals UP and DN from sc_signal<bool> to sc_signal<unsigned char>. If I use bool I get the following linking problem: Undefined symbols for architecture x86_64: "sca_tdf::sca_de::sca_in<bool>::bind(sc_core::sc_port_b<sc_core::sc_signal_in_if<bool> >&)", referenced from: vtable for sca_tdf::sc_in<bool> in main.cpp.o "sca_tdf::sca_de::sca_in<bool>::trace(sc_core::sc_trace_file*) const", referenced from: vtable for sca_tdf::sc_in<bool> in main.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Using "sc_bit" also fix the problem, but this type is deprecated. I am using SystemC 2.3.1 and SystemC-AMS 2.1. Thanks in advance. PS: The issue seems to be on the chargepump ams module when I use "sca_tdf::sc_in<bool>" do declare UP and DN. Américo
  6. Hello, I'm trying to download the SystemC AMS packages from https://www.eas.iis.fraunhofer.de/en/business_areas/design_methodology/systemleveldesign/open_source.html but the page states downloads are unavailable temporary. Is there any timeline defined for when they will be made available again? Or am I missing something here? Thanks, Antonio or
  7. 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;
  8. Hi all, I had to modelise and simulate in systemC-ams a SD ADC. but i do not found the right simulator to do that? is it Spectre, eclipse? any body have idea? Regards, saket
  9. I have a question which probably is quite stupid. I developed a Software in the Loop framework in SytemC. This framework is supposed to call in specific discrete time instants some modules to execute. For instance suppose we have module A and B. Module A has to be executed every 10 ms and Module B every 20 ms. The execution order has to be first A and then B when both modules have to be executed. I am able to do that by having a coordinator module triggered by a clock of 10 ms. Every module ( module A, B and scheduler) are related with an event. Module A and B they look like this: while(1){ Wait(ev_mod_i) { ... trigger_ev_coordinator }} The coordinator which knows the frequency of each module will notify the correct event to trigger the corresponding module. So for instance for t=10ms the coordinator will be triggered by the clock and it will trigger event_mod_A. Then for t=20ms it will trigger event_mod_A, after module A is finished coordinator will trigger event_mod_B. After module B is also finished, the coordinator will wait for the next clock tick e.t.c Now i would like to insert an AMS model into my system. The desired MoC is continuous TDF. However I can't use statements like event.notify(zerotime) or wait(ev_i) in TDF according to the AMS manual. Moreover TDF modules include a time step by which they are executed. This is something that is not fully desired because i can't find a way to control the TDF modules. Could you please give me any ideas on how I can embed a TDF model into a SystemC framework and at the same time to be able to control when the model has to be executed for a specific clock tick? Probably by doing this I am ruining the whole concept of continuous TDF MoC. If this is right do you have any alternative ideas? Thanks in advance.
  10. Hi again! Maybe this is too obvious, but I've been wonderin for a while now and never found the answer (and dared to ask for it ). Is it possible to directly pass whatever comes from an tdf_in port to a tdf_out port? Not only that, is it possible to do it in a sc_module instead of a sca_module? For a better explanation I'll leave a piece of code. Let's say I have: #include <systemc-ams> class some_module : public sc_core::sc_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; some_module(sc_core::sc_module_name nm); }; Until now I was adding an object, let's call it "tdf_some": #include <systemc-ams> class tdf_some_module : public sca_tdf::sca_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; tdf_some_module(sc_core::sc_module_name nm) {} void processing() { out.write( in.read() ); } }; Then, in the previous class I would change to: #include <systemc-ams> class some_module : public sc_core::sc_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; // Add new TDF module tdf_some *ts; some_module(sc_core::sc_module_name nm) { // Instantiate and bind ports ts = new tdf_some("ts"); ts->in(in); ts->out(out); } }; Looks like a very simple question (and I hope so), but I still haven't been able to solve it. Any ideas? Thanks
  11. Hi all! I have an error that I never had before with AMS. I have a few sc_modules with in and out TDF ports. Inside these sc_modules I have sca_modules, which are connected to those in and out TDF ports. This have been working fine until now, but I created a new class of module exactly the same way as the others and I have this error. I checked in the library and it seems like my sca_module is not assigned to any view: if (view_interface == NULL) { std::ostringstream str; str << "Error: " << name() << " a sca_module must be associated with a concrete view!" << std::endl; str << "It is not allowed to instantiate the sca_module base class." << std::endl; SC_REPORT_ERROR("SystemC-AMS",str.str().c_str()); } I know that maybe it not clear. I can give more details. But I am totally lost with this. Any ideas? Thanks
  12. Hi all, I have been trying to do something that I'm not sure it's possible. I have some TDF modules that are connected to each other by sca_in and sca_out ports. All of this modules will have at least one of each in/out ports. My idea was that maybe some of them will have some extra in/out ports. For example, if I want two TDFs outputs to go to one TDF input, it is not possible using just one port. Instead, those TDF modules would have a vector of sca_in's so, if I need an extra port, this will be initialized and bound to a signal. All this is already done and compiling. My problem is that when I initialize and bind that new port, it is not specifically assigned to a TDF so I get this error: "Error: (E100) port specified outside of module: port 'sca_tdf_in_0' (sc_port_base)". I understand the reason of this error, but I would like to know if it is possible to assign this port to its TDF. Here I will show my code, maybe it's helpful. class 'gen' is a generator of doubles. It sends an increasing double through its 'out' port. class 'pass' is just getting whatever comes from its 'in' port and sending it out through its 'out' port. class 'waste' is where the 'magic' may be. Receives whatever which is coming from 'pass'. main.cpp: #include <systemc-ams> #include "gen.h" #include "waste.h" #include "pass.h" int sc_main(int argc, char *argv[]) { gen g("g"); pass p("p"); pass p2("p2"); waste w("w"); sca_tdf::sca_signal<double> sig("sig"); sca_tdf::sca_signal<double> sig2("sig2"); sca_tdf::sca_signal<double> sig3("sig3"); g.out(sig); p.in(sig); // Both 'p' and 'p2' receive from the same signal 'sig'. p2.in(sig); // This works perfectly. p.out(sig2); // The out port of both are bound to different signals. p2.out(sig3); // Otherwise, I would get an error. w.in(sig2); // This is a normal binding (to 'p' and 'sig') that works just fine. w.bind(sig3); // Here's where I want to implement my idea. Look at 'waste.h' sc_core::sc_start(500.0, sc_core::SC_MS); sc_core::sc_stop(); return 0; }; waste.h: #ifndef WASTE_H #define WASTE_H #include <systemc-ams> #include <vector> SCA_TDF_MODULE(waste) { sca_tdf::sca_in<double> in; // Main 'in' port std::vector<sca_tdf::sca_in<double>*> secondary_ins; // Vector of extra 'in' ports std::vector<sca_tdf::sca_in<double>*>::iterator it; // Iterator int ins; // Number of extra 'in' ports SCA_CTOR(waste) { it = secondary_ins.begin(); ins = 0; } // This initializes the extra 'in' port and adds it to the vector // Here should go the 'assignation' if it is possible. void new_in() { sca_tdf::sca_in<double> *sec_in = new sca_tdf::sca_in<double>(); secondary_ins.insert(it, sec_in); ins++; } // This method is called in 'main.cpp' and it might assign // the new 'in' port to the given signal void bind(sca_tdf::sca_signal<double> &s) { new_in(); secondary_ins.at(secondary_ins.size()-1)->bind(s); } void processing() { double d = in.read(); std::cout << name() << " - main_in : " << d << std::endl; for(int i=0; i<secondary_ins.size(); i++) { double d2 = secondary_ins.at(i)->read(); std::cout << name() << " - sec_in(" << i << "): " << d2 << std::endl; } } }; #endif So basically that's it. Any ideas? Is it even possible? Thanks a lot
  13. Lately, I have been dealing with some issues related to the ELN Networks. I am modelling some ELN modules as if they were completely independent, meaning that they can be connected to each other through its terminals no matter what modules it is connected to (considering, of course, the limitations of an ELN network). My problem is that sometimes I would like to have some kind of ELN Cable so I could connect an ELN Node to an ELN Ground (Node Ref), for example. Sounds crazy, but since I am creating a generic way of connecting these modules, sometimes I cannot directly connect a terminal to a ground. So, is there a way to avoid that problem since it is not possible to 'bind' a node? Would be useful to have an ELN Cable? Thanks a lot!
  14. Hi everyone, I have just started working with SystemC-AMS. I have installed the systemcams-1.0.tar package from www.systemc-ams.org . As reference I am using the examples from the book: http://www.amazon.de/SystemC-SystemC-AMS-Practice-2-3-ebook/dp/B00F8HSYF8 SystemC and SystemC-AMS in Practice: SystemC 2.3, 2.2 and SystemC-AMS 1.0 from Amal Banerjee (Autor), Balmiki Sur (Autor) I am trying to run their first example from the book and I find myself stuck at compiling. Here is the part that is giving me a hard time: #include <systemc-ams> #include "commonsrcs.h" //<-- doesn't exist #include "gendatatrace.h" //<-- doesn't exist #include <cstdlib> #include <cstring> #include <iostream> //<-- was not written in original example using namespace std; //<-- was not written in original example int sc_main (int argc, char **argv) { double amplitude; double frequency; if (argc < 3) { cout<<"Insufficient input parameters ..."<<endl; cout<<"give <amplitude> and <frequency> arguments to output file"<<endl; exit(0); } sca_tdf::sca_signal<double> sigin0; sca_tdf::sca_signal<double> sigout0; amplitude = strtod(argv[1], NULL); frequency = strtod(argv[2], NULL); sinsrc sin_src ("sin_src"); //<-- cannot be referenced due to commonsrcs.h not being found tracedoublecombo trdbl ("tr_nd"); //<-- cannot be referenced due to gendatatrace.h not being found sin_src.sigout(sigin0); //<-- cannot be referenced due to error above sin_src.amplitude = amplitude; //<-- cannot be referenced due to error above sin_src.frequency = frequency; //<-- cannot be referenced due to error above trdbl.in1(sigin0); //<-- cannot be referenced due to error above trdbl.in2(sigout0); //<-- cannot be referenced due to error above sc_core::sc_start(100.0, sc_core::SC_MS); sc_core::sc_stop(); return 0; } The compiler version I am using is: gcc version 4.1.2 20080704 The compilation output is: g++ \ -I. -I/home/tabacaru/systemc-2.3.0/include -I/home/tabacaru/systemc-ams-1.0/include \ -L. -L/home/tabacaru/systemc-2.3.0/lib-linux64 -L/home/tabacaru/systemc-ams-1.0/lib-linux64 \ -o butter butter.cpp \ -lsystemc-ams -lsystemc -lm butter.cpp:2:80: error: commonsrcs.h: No such file or directory butter.cpp:3:80: error: gendatatrace.h: No such file or directory butter.cpp: In function 'int sc_main(int, char**)': butter.cpp:28: error: 'sinsrc' was not declared in this scope butter.cpp:28: error: expected `;' before 'sin_src' butter.cpp:29: error: 'tracedoublecombo' was not declared in this scope butter.cpp:29: error: expected `;' before 'trdbl' butter.cpp:31: error: 'sin_src' was not declared in this scope butter.cpp:35: error: 'trdbl' was not declared in this scope I am sure I am doing something wrong, however I do not know what exactly. I already installed the systemc-ams-1.0 package twice and I still get the same problem. Any feedback regarding the 2 header files (commonsrcs.h and gendatatrace.h) would be much appreciated. If you know another package from an official/mirror web-page I would be happy for a link. Thank you in advance. Bogdan
  15. Hi everyone, I have just started working with SystemC-AMS. I have installed the systemcams-1.0.tar package from www.systemc-ams.org . As reference I am using the examples from the book: http://www.amazon.de/SystemC-SystemC-AMS-Practice-2-3-ebook/dp/B00F8HSYF8 SystemC and SystemC-AMS in Practice: SystemC 2.3, 2.2 and SystemC-AMS 1.0 from Amal Banerjee (Autor), Balmiki Sur (Autor) I am trying to run their first example from the book and I find myself stuck at compiling. Here is the part that is giving me a hard time: #include <systemc-ams> #include "commonsrcs.h" //<-- doesn't exist #include "gendatatrace.h" //<-- doesn't exist #include <cstdlib> #include <cstring> #include <iostream> //<-- was not written in original example using namespace std; //<-- was not written in original example int sc_main (int argc, char **argv) { double amplitude; double frequency; if (argc < 3) { cout<<"Insufficient input parameters ..."<<endl; cout<<"give <amplitude> and <frequency> arguments to output file"<<endl; exit(0); } sca_tdf::sca_signal<double> sigin0; sca_tdf::sca_signal<double> sigout0; amplitude = strtod(argv[1], NULL); frequency = strtod(argv[2], NULL); sinsrc sin_src ("sin_src"); //<-- cannot be referenced due to commonsrcs.h not being found tracedoublecombo trdbl ("tr_nd"); //<-- cannot be referenced due to gendatatrace.h not being found sin_src.sigout(sigin0); //<-- cannot be referenced due to error above sin_src.amplitude = amplitude; //<-- cannot be referenced due to error above sin_src.frequency = frequency; //<-- cannot be referenced due to error above trdbl.in1(sigin0); //<-- cannot be referenced due to error above trdbl.in2(sigout0); //<-- cannot be referenced due to error above sc_core::sc_start(100.0, sc_core::SC_MS); sc_core::sc_stop(); return 0; } The compiler version I am using is: gcc version 4.1.2 20080704 The compilation output is: g++ \ -I. -I/home/tabacaru/systemc-2.3.0/include -I/home/tabacaru/systemc-ams-1.0/include \ -L. -L/home/tabacaru/systemc-2.3.0/lib-linux64 -L/home/tabacaru/systemc-ams-1.0/lib-linux64 \ -o butter butter.cpp \ -lsystemc-ams -lsystemc -lm butter.cpp:2:80: error: commonsrcs.h: No such file or directory butter.cpp:3:80: error: gendatatrace.h: No such file or directory butter.cpp: In function 'int sc_main(int, char**)': butter.cpp:28: error: 'sinsrc' was not declared in this scope butter.cpp:28: error: expected `;' before 'sin_src' butter.cpp:29: error: 'tracedoublecombo' was not declared in this scope butter.cpp:29: error: expected `;' before 'trdbl' butter.cpp:31: error: 'sin_src' was not declared in this scope butter.cpp:35: error: 'trdbl' was not declared in this scope I am sure I am doing something wrong, however I do not know what exactly. I already installed the systemc-ams-1.0 package twice and I still get the same problem. Any feedback regarding the 2 header files (commonsrcs.h and gendatatrace.h) would be much appreciated. If you know another package from an official/mirror web-page I would be happy for a link. Thank you in advance. Bogdan
  16. Hello Experts, presently I am designing a simple A2D converter in SystemC-AMS. While compiling complier returns with some errors. I would be very thankful to you, if you could comment on the errors messages. // A2D.h #include <systemc-ams> #include <systemc> #include <stdio.h> using namespace std; SCA_TDF_MODULE (a2d_nbit) { //port declaration sca_tdf::sca_in<double> a_in; // analog input pin sca_tdf::sca_de::sca_in<sc_dt::sc_logic> start; //start signal sca_tdf::sca_de::sca_in<sc_dt::sc_logic> clk; //clock signal sca_tdf::sca_de::sca_out<sc_dt::sc_logic> eoc; //end of conversion pin sca_tdf::sca_de::sca_out< sc_dt::sc_lv<8> > d_out; // digital output signal a2d_nbit(sc_core::sc_module_name nm, double Vmax_ = 5.0, double delay_ = 10.0e-6, int bit_rng = 8): a_in("a_in"), start("start"),clk("clk"), eoc("eoc"), d_out("d_out"), Vmax(Vmax_), delay(delay_), bit_range(bit_rng){} void set_attribute() { set_timestep(10.0, sc_core::SC_US); eoc.set_delay(0); } void initialize() { //eoc.initialize(sc_dt::SC_LOGIC_0); } void processing(); private: double Vmax; // ADC maximum range double delay; // ADC conversion time int bit_range; //vector length of d_temp and d_out }; //A2D.cpp has got only processing function defined. //A2D_top_level.cpp #include<systemc-ams.h> #include<systemc.h> #include<A2D.h> #include<vtg_src.h> using namespace std; using namespace sc_core; SC_MODULE (A2D_top_level) { a2d_nbit a2d; vtg_src input_vtg; sc_clock clk1("clk1", 100, SC_US,0.5, true); void start_logic(){ while(true) { start.write(sc_dt::SC_LOGIC_0); wait(2, sc_core::SC_MS); start.write(sc_dt::SC_LOGIC_1); wait(2, sc_core::SC_MS); start.write(sc_dt::SC_LOGIC_0); sc_core::sc_stop(); } } A2D_top_level(sc_core::sc_module_name nm): in("in"), out("out"), a2d("a2d"), input_vtg("input_vtg"),clk1("clk1"), start("start"), clk("clk"), eoc("eoc") { input_vtg.out(in); clk(clk1.signal()); a2d.a_in(in); a2d.start(start); a2d.clk(clk); a2d.eoc(eoc); // a2d.d_out(out); SC_THREAD(start_logic); } private: sca_tdf::sca_signal <double> in; sc_core::sc_signal<sc_dt::sc_lv<8> > out; sc_core::sc_signal<sc_dt::sc_logic> start, clk, eoc; }; compiler returns with following errors !!! A2D_top_level.cpp:13: error: expected identifier before string constant A2D_top_level.cpp:13: error: expected ‘,’ or ‘...’ before string constant A2D_top_level.cpp: In constructor ‘A2D_top_level::A2D_top_level(sc_core::sc_module_name)’: A2D_top_level.cpp:29: error: class ‘A2D_top_level’ does not have any field named ‘clk1’ A2D_top_level.cpp:33: error: ‘((A2D_top_level*)this)->A2D_top_level::clk1’ does not have class type A2D_top_level.cpp:41: error: ‘SC_CURRENT_USER_MODULE’ has not been declared please let me know your views. thanks in advance. Milind.
×
×
  • Create New...