Jump to content

Error when interfacing SystemC with a SystemC-AMS TDF Module.


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...