pradeep.vrr Posted April 3, 2015 Report Share Posted April 3, 2015 Hi all,I am trying to interface a systemc module with a AMS TDF module. I am trying to do with converter ports. My AMS module is a LPF. I want to drive its input from a SystemC module. Here is what im doing..SC_MODULE(LPF){sca_tdf::sc_in<double> tdf_IN; // input from SC module, LPF inputsca_tdf::sca_out<double> tdf_OUT; // LPF output.sca_eln::sca_node_ref GND; // Ground reference. // LPF is implemented using ELNsca_eln::sca_tdf_vsource *V_IN; // ELN input portsca_eln::sca_tdf_vsink *V_OUT; // ELN output port . . . SCA_CTOR(LPF) { V_IN = new sca_eln::sca_tdf_vsource("V_IN",1.0); V_IN->inp(tdf_IN); // ERROR //This is the error i am getting for the above line. error: no match for call to ‘(sca_tdf::sca_in<double>) (sca_tdf::sc_in<double>&)’ V_IN->p(IN); V_IN -> n(GND); . . . }};How will i interface these two blocks?Thanks in advance. Quote Link to comment Share on other sites More sharing options...
dakupoto Posted April 4, 2015 Report Share Posted April 4, 2015 Hi all, I am trying to interface a systemc module with a AMS TDF module. I am trying to do with converter ports. My AMS module is a LPF. I want to drive its input from a SystemC module. Here is what im doing.. SC_MODULE(LPF) { sca_tdf::sc_in<double> tdf_IN; // input from SC module, LPF input sca_tdf::sca_out<double> tdf_OUT; // LPF output. sca_eln::sca_node_ref GND; // Ground reference. // LPF is implemented using ELN sca_eln::sca_tdf_vsource *V_IN; // ELN input port sca_eln::sca_tdf_vsink *V_OUT; // ELN output port . . . SCA_CTOR(LPF) { V_IN = new sca_eln::sca_tdf_vsource("V_IN",1.0); V_IN->inp(tdf_IN); // ERROR //This is the error i am getting for the above line. error: no match for call to ‘(sca_tdf::sca_in<double>) (sca_tdf::sc_in<double>&)’ V_IN->p(IN); V_IN -> n(GND); . . . } }; How will i interface these two blocks? Thanks in advance. Hello Sir, Please check the properties of converter ports as: sca_tdf::sca_de::sca_in<T> sca_tdf::sca_de::sca_out<T> etc., Hope this helps. Quote Link to comment Share on other sites More sharing options...
pradeep.vrr Posted April 4, 2015 Author Report Share Posted April 4, 2015 Hi dakupoto,Thank you for your suggestion. I used sca_tdf::sca_de::sca_in<T> as you suggested. I am able to make it without any errors. But i am getting the following error when i run the output.exeError: SystemC-AMS: The sca_tdf::sca_de::sca_out port LPF.sca_tdf_sc_in_0 must be instantiated in the context of an sca_tdf::sca_modulePlease help me in clearing this. And can you also explain me the <T> in sca_tdf::sca_de::sca_in<T>?Thanks in advance. Quote Link to comment Share on other sites More sharing options...
dakupoto Posted April 5, 2015 Report Share Posted April 5, 2015 Hi dakupoto, Thank you for your suggestion. I used sca_tdf::sca_de::sca_in<T> as you suggested. I am able to make it without any errors. But i am getting the following error when i run the output.exe Error: SystemC-AMS: The sca_tdf::sca_de::sca_out port LPF.sca_tdf_sc_in_0 must be instantiated in the context of an sca_tdf::sca_module Please help me in clearing this. And can you also explain me the <T> in sca_tdf::sca_de::sca_in<T>? Thanks in advance. First of all, please note that both SystemC and SystemC-AMS are C/C++ libraries, not standalone languages. So, please have a good C/C++ reference at hand, Please also note that both the converter ports: sca_tdf::sca_de::sca_in<T> sca_tdf::sca_de::sca_out<T> Can be used only from inside a TDF module. Please check this carefully -- note the scope resolution operator "::" in these port declaration/definitions. As for your last question, please refer to a good C/C++ reference. 'T' is the common notation for a generic template type. Hope this helps. Quote Link to comment Share on other sites More sharing options...
Martin Barnasconi Posted April 8, 2015 Report Share Posted April 8, 2015 The TDF converter ports sca_tdf::sca_de::sca_in<T> or shorter version sca_tdf::sc_in<T> are normally used in TDF modules (of class sca_tdf::sca_module) where you connect to the SystemC discrete event domain. In your case, you correctly create a regular SystemC module (of class sc_module), in which you instantiate ELN primitive modules. If you want to connect such model to the SystemC discrete event domain, you should use the regular SC port of type sc_core::sc_in<T>. In order to have the voltage source to access discrete event signals, you need to select the component sca_eln::sca_de::sca_vsource or shorter version sca_eln::sca_de_vsource. Also note that this is a regular SystemC module, so use the normal constructor or macro (SC_CTOR) and not SCA_CTOR. Anohter good coding style is only to use capitals for the macro and defines, not in port and modules names, etc. 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.